diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000000000..782153495 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 92394b1e4..7138a79a9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [8, 10, 12, 13] + node: [10, 12, 13] steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 diff --git a/.gitignore b/.gitignore index 0bb5e7858..5d32b2378 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ **/*.log **/node_modules .coverage +coverage .nyc_output docs/ out/ @@ -8,9 +9,6 @@ build/ system-test/secrets.js system-test/*key.json *.lock -.vscode -**/package-lock.json .DS_Store -google-cloud-logging-winston-*.tgz -google-cloud-logging-bunyan-*.tgz +package-lock.json __pycache__ diff --git a/.jsdoc.js b/.jsdoc.js index 223ff94b1..c3850f8ac 100644 --- a/.jsdoc.js +++ b/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. // +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -37,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2019 Google, LLC.', + copyright: 'Copyright 2020 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/pubsub', diff --git a/.mocharc.json b/.mocharc.json new file mode 100644 index 000000000..670c5e2c2 --- /dev/null +++ b/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/src/v1/doc/google/iam/v1/doc_iam_policy.js b/.prettierrc.js similarity index 76% rename from src/v1/doc/google/iam/v1/doc_iam_policy.js rename to .prettierrc.js index 322889591..d1b95106f 100644 --- a/src/v1/doc/google/iam/v1/doc_iam_policy.js +++ b/.prettierrc.js @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -12,5 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/helperMethods.ts.tmpl b/helperMethods.ts.tmpl new file mode 100644 index 000000000..773675cf9 --- /dev/null +++ b/helperMethods.ts.tmpl @@ -0,0 +1,33 @@ + /** + * This part will be added into src/v1/key_management_service_client.ts by synth.py. + * KMS service requires IAM client for [setIamPolicy, getIamPolicy, testIamPerssion] methods. + * But we don't support it now in micro-generators for rerouting one service to another and mix them in. + * New feature request link: [https://github.com/googleapis/gapic-generator-typescript/issues/315] + * + * So this is manually written for providing methods to the KMS client. + * IamClient is created for KMS client in the constructor using src/helper.ts. + * [setIamPolicy, getIamPolicy, testIamPerssion] methods are created which is calling the corresponding methods from IamClient in `helper.ts`. + */ + + getIamPolicy( + request: protos.google.iam.v1.GetIamPolicyRequest, + options: gax.CallOptions, + callback: protos.google.iam.v1.IAMPolicy.GetIamPolicyCallback + ) { + return this._iamClient.getIamPolicy(request, options, callback); + } + setIamPolicy( + request: protos.google.iam.v1.SetIamPolicyRequest, + options: gax.CallOptions, + callback: protos.google.iam.v1.IAMPolicy.SetIamPolicyCallback + ) { + return this._iamClient.setIamPolicy(request, options, callback); + } + testIamPermissions( + request: protos.google.iam.v1.TestIamPermissionsRequest, + options: gax.CallOptions, + callback?: protos.google.iam.v1.IAMPolicy.TestIamPermissionsCallback + ) { + return this._iamClient.testIamPermissions(request, options, callback); + } +} diff --git a/package.json b/package.json index 698b3121c..f392202fe 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,6 @@ "main": "./build/src/index.js", "types": "./build/src/index.d.ts", "files": [ - "build/proto", "build/protos", "build/src" ], @@ -30,19 +29,17 @@ "scripts": { "presystem-test": "npm run compile", "system-test": "mocha build/system-test --timeout 600000", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "test": "c8 mocha build/test/*{,/*}.js", - "lint": "eslint '**/*.js' && gts check", + "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", + "test": "c8 mocha build/test", + "lint": "gts check", "predocs": "npm run compile", "docs": "jsdoc -c .jsdoc.js", - "fix": "eslint --fix '**/*.js' && gts fix", + "fix": "gts fix", "clean": "gts clean", - "compile": "tsc -p . && cp -r src/v1 build/src/ && cp -r protos build/ && cp -r proto build/ && cp smoke-test/*.js build/system-test && cp test/*.js build/test", - "prepare": "npm run compile", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "prepare": "npm run compile-protos && npm run compile", "pretest": "npm run compile", - "proto": "mkdirp proto && npm run proto:pubsub && npm run proto:iam", - "proto:pubsub": "pbjs -t static-module -w commonjs -p protos google/pubsub/v1/pubsub.proto | pbts -o proto/pubsub.d.ts -", - "proto:iam": "pbjs -t static-module -w commonjs -p protos google/iam/v1/iam_policy.proto | pbts -o proto/iam.d.ts -", "docs-test": "linkinator docs", "predocs-test": "npm run docs", "benchwrapper": "node bin/benchwrapper.js" @@ -58,7 +55,7 @@ "async-each": "^1.0.1", "extend": "^3.0.2", "google-auth-library": "^6.0.0", - "google-gax": "^1.14.2", + "google-gax": "^2.0.0", "is-stream-ended": "^0.1.4", "lodash.snakecase": "^4.1.1", "p-defer": "^3.0.0", @@ -72,6 +69,7 @@ "@types/mocha": "^7.0.0", "@types/mv": "^2.1.0", "@types/ncp": "^2.0.1", + "@types/node": "^12.12.30", "@types/proxyquire": "^1.3.28", "@types/sinon": "^9.0.0", "@types/tmp": "^0.1.0", @@ -92,12 +90,16 @@ "mocha": "^7.0.0", "mv": "^2.1.1", "ncp": "^2.0.0", + "null-loader": "^3.0.0", "prettier": "^1.18.2", "proxyquire": "^2.0.0", "sinon": "^9.0.0", "source-map-support": "^0.5.9", + "ts-loader": "^6.2.1", "typescript": "3.6.4", "uuid": "^7.0.0", + "webpack": "^4.42.0", + "webpack-cli": "^3.3.11", "yargs": "^15.0.0" } } diff --git a/proto/iam.d.ts b/proto/iam.d.ts deleted file mode 100644 index 4a149a1a8..000000000 --- a/proto/iam.d.ts +++ /dev/null @@ -1,4418 +0,0 @@ -import * as $protobuf from "protobufjs"; -/** Namespace google. */ -export namespace google { - - /** Namespace iam. */ - namespace iam { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a IAMPolicy */ - class IAMPolicy extends $protobuf.rpc.Service { - - /** - * Constructs a new IAMPolicy service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new IAMPolicy service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): IAMPolicy; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - } - - namespace IAMPolicy { - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy#setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy#getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy#testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - } - - /** Properties of a SetIamPolicyRequest. */ - interface ISetIamPolicyRequest { - - /** SetIamPolicyRequest resource */ - resource?: (string|null); - - /** SetIamPolicyRequest policy */ - policy?: (google.iam.v1.IPolicy|null); - } - - /** Represents a SetIamPolicyRequest. */ - class SetIamPolicyRequest implements ISetIamPolicyRequest { - - /** - * Constructs a new SetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ISetIamPolicyRequest); - - /** SetIamPolicyRequest resource. */ - public resource: string; - - /** SetIamPolicyRequest policy. */ - public policy?: (google.iam.v1.IPolicy|null); - - /** - * Creates a new SetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; - - /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; - - /** - * Verifies a SetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; - - /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. - * @param message SetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GetIamPolicyRequest. */ - interface IGetIamPolicyRequest { - - /** GetIamPolicyRequest resource */ - resource?: (string|null); - - /** GetIamPolicyRequest options */ - options?: (google.iam.v1.IGetPolicyOptions|null); - } - - /** Represents a GetIamPolicyRequest. */ - class GetIamPolicyRequest implements IGetIamPolicyRequest { - - /** - * Constructs a new GetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IGetIamPolicyRequest); - - /** GetIamPolicyRequest resource. */ - public resource: string; - - /** GetIamPolicyRequest options. */ - public options?: (google.iam.v1.IGetPolicyOptions|null); - - /** - * Creates a new GetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; - - /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; - - /** - * Verifies a GetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; - - /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. - * @param message GetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a TestIamPermissionsRequest. */ - interface ITestIamPermissionsRequest { - - /** TestIamPermissionsRequest resource */ - resource?: (string|null); - - /** TestIamPermissionsRequest permissions */ - permissions?: (string[]|null); - } - - /** Represents a TestIamPermissionsRequest. */ - class TestIamPermissionsRequest implements ITestIamPermissionsRequest { - - /** - * Constructs a new TestIamPermissionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); - - /** TestIamPermissionsRequest resource. */ - public resource: string; - - /** TestIamPermissionsRequest permissions. */ - public permissions: string[]; - - /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsRequest instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; - - /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; - - /** - * Verifies a TestIamPermissionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; - - /** - * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. - * @param message TestIamPermissionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestIamPermissionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a TestIamPermissionsResponse. */ - interface ITestIamPermissionsResponse { - - /** TestIamPermissionsResponse permissions */ - permissions?: (string[]|null); - } - - /** Represents a TestIamPermissionsResponse. */ - class TestIamPermissionsResponse implements ITestIamPermissionsResponse { - - /** - * Constructs a new TestIamPermissionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); - - /** TestIamPermissionsResponse permissions. */ - public permissions: string[]; - - /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsResponse instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; - - /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; - - /** - * Verifies a TestIamPermissionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; - - /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. - * @param message TestIamPermissionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestIamPermissionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GetPolicyOptions. */ - interface IGetPolicyOptions { - - /** GetPolicyOptions requestedPolicyVersion */ - requestedPolicyVersion?: (number|null); - } - - /** Represents a GetPolicyOptions. */ - class GetPolicyOptions implements IGetPolicyOptions { - - /** - * Constructs a new GetPolicyOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IGetPolicyOptions); - - /** GetPolicyOptions requestedPolicyVersion. */ - public requestedPolicyVersion: number; - - /** - * Creates a new GetPolicyOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns GetPolicyOptions instance - */ - public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; - - /** - * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; - - /** - * Verifies a GetPolicyOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetPolicyOptions - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; - - /** - * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. - * @param message GetPolicyOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetPolicyOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Policy. */ - interface IPolicy { - - /** Policy version */ - version?: (number|null); - - /** Policy bindings */ - bindings?: (google.iam.v1.IBinding[]|null); - - /** Policy etag */ - etag?: (Uint8Array|null); - } - - /** Represents a Policy. */ - class Policy implements IPolicy { - - /** - * Constructs a new Policy. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicy); - - /** Policy version. */ - public version: number; - - /** Policy bindings. */ - public bindings: google.iam.v1.IBinding[]; - - /** Policy etag. */ - public etag: Uint8Array; - - /** - * Creates a new Policy instance using the specified properties. - * @param [properties] Properties to set - * @returns Policy instance - */ - public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; - - /** - * Verifies a Policy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Policy - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @param message Policy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Policy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Binding. */ - interface IBinding { - - /** Binding role */ - role?: (string|null); - - /** Binding members */ - members?: (string[]|null); - - /** Binding condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a Binding. */ - class Binding implements IBinding { - - /** - * Constructs a new Binding. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBinding); - - /** Binding role. */ - public role: string; - - /** Binding members. */ - public members: string[]; - - /** Binding condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new Binding instance using the specified properties. - * @param [properties] Properties to set - * @returns Binding instance - */ - public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Binding message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; - - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; - - /** - * Verifies a Binding message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Binding - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; - - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @param message Binding - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Binding to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PolicyDelta. */ - interface IPolicyDelta { - - /** PolicyDelta bindingDeltas */ - bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); - - /** PolicyDelta auditConfigDeltas */ - auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); - } - - /** Represents a PolicyDelta. */ - class PolicyDelta implements IPolicyDelta { - - /** - * Constructs a new PolicyDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicyDelta); - - /** PolicyDelta bindingDeltas. */ - public bindingDeltas: google.iam.v1.IBindingDelta[]; - - /** PolicyDelta auditConfigDeltas. */ - public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; - - /** - * Creates a new PolicyDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns PolicyDelta instance - */ - public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; - - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; - - /** - * Verifies a PolicyDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PolicyDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; - - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @param message PolicyDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PolicyDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BindingDelta. */ - interface IBindingDelta { - - /** BindingDelta action */ - action?: (google.iam.v1.BindingDelta.Action|null); - - /** BindingDelta role */ - role?: (string|null); - - /** BindingDelta member */ - member?: (string|null); - - /** BindingDelta condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a BindingDelta. */ - class BindingDelta implements IBindingDelta { - - /** - * Constructs a new BindingDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBindingDelta); - - /** BindingDelta action. */ - public action: google.iam.v1.BindingDelta.Action; - - /** BindingDelta role. */ - public role: string; - - /** BindingDelta member. */ - public member: string; - - /** BindingDelta condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new BindingDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns BindingDelta instance - */ - public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; - - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; - - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; - - /** - * Verifies a BindingDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BindingDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; - - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @param message BindingDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BindingDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace BindingDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - - /** Properties of an AuditConfigDelta. */ - interface IAuditConfigDelta { - - /** AuditConfigDelta action */ - action?: (google.iam.v1.AuditConfigDelta.Action|null); - - /** AuditConfigDelta service */ - service?: (string|null); - - /** AuditConfigDelta exemptedMember */ - exemptedMember?: (string|null); - - /** AuditConfigDelta logType */ - logType?: (string|null); - } - - /** Represents an AuditConfigDelta. */ - class AuditConfigDelta implements IAuditConfigDelta { - - /** - * Constructs a new AuditConfigDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditConfigDelta); - - /** AuditConfigDelta action. */ - public action: google.iam.v1.AuditConfigDelta.Action; - - /** AuditConfigDelta service. */ - public service: string; - - /** AuditConfigDelta exemptedMember. */ - public exemptedMember: string; - - /** AuditConfigDelta logType. */ - public logType: string; - - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditConfigDelta instance - */ - public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; - - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; - - /** - * Verifies an AuditConfigDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditConfigDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; - - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @param message AuditConfigDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditConfigDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace AuditConfigDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - } - } - - /** Namespace api. */ - namespace api { - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|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[]; - - /** - * 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 }; - } - - /** 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 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; - - /** HttpRule put. */ - public put: string; - - /** HttpRule post. */ - public post: string; - - /** HttpRule delete. */ - public delete: string; - - /** HttpRule patch. */ - public patch: string; - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: 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 }; - } - - /** 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 }; - } - } - - /** 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 }; - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** 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); - } - - /** 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 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; - - /** - * 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 }; - } - - /** 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); - } - - /** 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[]; - - /** - * 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 }; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|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; - - /** - * 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 }; - } - - /** 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 }; - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (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); - } - - /** 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; - - /** FieldDescriptorProto type. */ - public type: 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); - - /** - * 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 }; - } - - 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_REQUIRED = 2, - LABEL_REPEATED = 3 - } - } - - /** 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 }; - } - - /** 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); - } - - /** 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); - - /** - * 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 }; - } - - /** 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 }; - } - - /** 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 }; - } - - /** 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 }; - } - - /** 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|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 uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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; - - /** 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 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 }; - } - - 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 uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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 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 }; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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; - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: google.protobuf.FieldOptions.JSType; - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** 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 }; - } - - 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 - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** 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 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 }; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|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 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 }; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|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 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 }; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** 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 }; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|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; - - /** 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 }; - } - - 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|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|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); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: Uint8Array; - - /** 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 }; - } - - 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 }; - } - } - - /** 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 }; - } - - 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 }; - } - } - - /** 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 }; - } - - 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); - } - - /** 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; - - /** - * 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 }; - } - } - } - - /** 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 }; - } - } -} diff --git a/proto/pubsub.d.ts b/proto/pubsub.d.ts deleted file mode 100644 index c44e9a6dc..000000000 --- a/proto/pubsub.d.ts +++ /dev/null @@ -1,9638 +0,0 @@ -import * as $protobuf from "protobufjs"; -import * as Long from "long"; -/** Namespace google. */ -export namespace google { - - /** Namespace pubsub. */ - namespace pubsub { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a Publisher */ - class Publisher extends $protobuf.rpc.Service { - - /** - * Constructs a new Publisher 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 Publisher 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): Publisher; - - /** - * Calls CreateTopic. - * @param request Topic message or plain object - * @param callback Node-style callback called with the error, if any, and Topic - */ - public createTopic(request: google.pubsub.v1.ITopic, callback: google.pubsub.v1.Publisher.CreateTopicCallback): void; - - /** - * Calls CreateTopic. - * @param request Topic message or plain object - * @returns Promise - */ - public createTopic(request: google.pubsub.v1.ITopic): Promise; - - /** - * Calls UpdateTopic. - * @param request UpdateTopicRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Topic - */ - public updateTopic(request: google.pubsub.v1.IUpdateTopicRequest, callback: google.pubsub.v1.Publisher.UpdateTopicCallback): void; - - /** - * Calls UpdateTopic. - * @param request UpdateTopicRequest message or plain object - * @returns Promise - */ - public updateTopic(request: google.pubsub.v1.IUpdateTopicRequest): Promise; - - /** - * Calls Publish. - * @param request PublishRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PublishResponse - */ - public publish(request: google.pubsub.v1.IPublishRequest, callback: google.pubsub.v1.Publisher.PublishCallback): void; - - /** - * Calls Publish. - * @param request PublishRequest message or plain object - * @returns Promise - */ - public publish(request: google.pubsub.v1.IPublishRequest): Promise; - - /** - * Calls GetTopic. - * @param request GetTopicRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Topic - */ - public getTopic(request: google.pubsub.v1.IGetTopicRequest, callback: google.pubsub.v1.Publisher.GetTopicCallback): void; - - /** - * Calls GetTopic. - * @param request GetTopicRequest message or plain object - * @returns Promise - */ - public getTopic(request: google.pubsub.v1.IGetTopicRequest): Promise; - - /** - * Calls ListTopics. - * @param request ListTopicsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTopicsResponse - */ - public listTopics(request: google.pubsub.v1.IListTopicsRequest, callback: google.pubsub.v1.Publisher.ListTopicsCallback): void; - - /** - * Calls ListTopics. - * @param request ListTopicsRequest message or plain object - * @returns Promise - */ - public listTopics(request: google.pubsub.v1.IListTopicsRequest): Promise; - - /** - * Calls ListTopicSubscriptions. - * @param request ListTopicSubscriptionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTopicSubscriptionsResponse - */ - public listTopicSubscriptions(request: google.pubsub.v1.IListTopicSubscriptionsRequest, callback: google.pubsub.v1.Publisher.ListTopicSubscriptionsCallback): void; - - /** - * Calls ListTopicSubscriptions. - * @param request ListTopicSubscriptionsRequest message or plain object - * @returns Promise - */ - public listTopicSubscriptions(request: google.pubsub.v1.IListTopicSubscriptionsRequest): Promise; - - /** - * Calls ListTopicSnapshots. - * @param request ListTopicSnapshotsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTopicSnapshotsResponse - */ - public listTopicSnapshots(request: google.pubsub.v1.IListTopicSnapshotsRequest, callback: google.pubsub.v1.Publisher.ListTopicSnapshotsCallback): void; - - /** - * Calls ListTopicSnapshots. - * @param request ListTopicSnapshotsRequest message or plain object - * @returns Promise - */ - public listTopicSnapshots(request: google.pubsub.v1.IListTopicSnapshotsRequest): Promise; - - /** - * Calls DeleteTopic. - * @param request DeleteTopicRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteTopic(request: google.pubsub.v1.IDeleteTopicRequest, callback: google.pubsub.v1.Publisher.DeleteTopicCallback): void; - - /** - * Calls DeleteTopic. - * @param request DeleteTopicRequest message or plain object - * @returns Promise - */ - public deleteTopic(request: google.pubsub.v1.IDeleteTopicRequest): Promise; - } - - namespace Publisher { - - /** - * Callback as used by {@link google.pubsub.v1.Publisher#createTopic}. - * @param error Error, if any - * @param [response] Topic - */ - type CreateTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Publisher#updateTopic}. - * @param error Error, if any - * @param [response] Topic - */ - type UpdateTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Publisher#publish}. - * @param error Error, if any - * @param [response] PublishResponse - */ - type PublishCallback = (error: (Error|null), response?: google.pubsub.v1.PublishResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Publisher#getTopic}. - * @param error Error, if any - * @param [response] Topic - */ - type GetTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Publisher#listTopics}. - * @param error Error, if any - * @param [response] ListTopicsResponse - */ - type ListTopicsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicsResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Publisher#listTopicSubscriptions}. - * @param error Error, if any - * @param [response] ListTopicSubscriptionsResponse - */ - type ListTopicSubscriptionsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicSubscriptionsResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Publisher#listTopicSnapshots}. - * @param error Error, if any - * @param [response] ListTopicSnapshotsResponse - */ - type ListTopicSnapshotsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicSnapshotsResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Publisher#deleteTopic}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteTopicCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - } - - /** Properties of a MessageStoragePolicy. */ - interface IMessageStoragePolicy { - - /** MessageStoragePolicy allowedPersistenceRegions */ - allowedPersistenceRegions?: (string[]|null); - } - - /** Represents a MessageStoragePolicy. */ - class MessageStoragePolicy implements IMessageStoragePolicy { - - /** - * Constructs a new MessageStoragePolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IMessageStoragePolicy); - - /** MessageStoragePolicy allowedPersistenceRegions. */ - public allowedPersistenceRegions: string[]; - - /** - * Creates a new MessageStoragePolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageStoragePolicy instance - */ - public static create(properties?: google.pubsub.v1.IMessageStoragePolicy): google.pubsub.v1.MessageStoragePolicy; - - /** - * Encodes the specified MessageStoragePolicy message. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. - * @param message MessageStoragePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IMessageStoragePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageStoragePolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. - * @param message MessageStoragePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IMessageStoragePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageStoragePolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageStoragePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.MessageStoragePolicy; - - /** - * Decodes a MessageStoragePolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageStoragePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.MessageStoragePolicy; - - /** - * Verifies a MessageStoragePolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageStoragePolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageStoragePolicy - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.MessageStoragePolicy; - - /** - * Creates a plain object from a MessageStoragePolicy message. Also converts values to other types if specified. - * @param message MessageStoragePolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.MessageStoragePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageStoragePolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Topic. */ - interface ITopic { - - /** Topic name */ - name?: (string|null); - - /** Topic labels */ - labels?: ({ [k: string]: string }|null); - - /** Topic messageStoragePolicy */ - messageStoragePolicy?: (google.pubsub.v1.IMessageStoragePolicy|null); - - /** Topic kmsKeyName */ - kmsKeyName?: (string|null); - } - - /** Represents a Topic. */ - class Topic implements ITopic { - - /** - * Constructs a new Topic. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ITopic); - - /** Topic name. */ - public name: string; - - /** Topic labels. */ - public labels: { [k: string]: string }; - - /** Topic messageStoragePolicy. */ - public messageStoragePolicy?: (google.pubsub.v1.IMessageStoragePolicy|null); - - /** Topic kmsKeyName. */ - public kmsKeyName: string; - - /** - * Creates a new Topic instance using the specified properties. - * @param [properties] Properties to set - * @returns Topic instance - */ - public static create(properties?: google.pubsub.v1.ITopic): google.pubsub.v1.Topic; - - /** - * Encodes the specified Topic message. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. - * @param message Topic message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ITopic, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Topic message, length delimited. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. - * @param message Topic message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ITopic, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Topic message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Topic - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.Topic; - - /** - * Decodes a Topic message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Topic - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.Topic; - - /** - * Verifies a Topic message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Topic message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Topic - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Topic; - - /** - * Creates a plain object from a Topic message. Also converts values to other types if specified. - * @param message Topic - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.Topic, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Topic to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PubsubMessage. */ - interface IPubsubMessage { - - /** PubsubMessage data */ - data?: (Uint8Array|null); - - /** PubsubMessage attributes */ - attributes?: ({ [k: string]: string }|null); - - /** PubsubMessage messageId */ - messageId?: (string|null); - - /** PubsubMessage publishTime */ - publishTime?: (google.protobuf.ITimestamp|null); - - /** PubsubMessage orderingKey */ - orderingKey?: (string|null); - } - - /** Represents a PubsubMessage. */ - class PubsubMessage implements IPubsubMessage { - - /** - * Constructs a new PubsubMessage. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IPubsubMessage); - - /** PubsubMessage data. */ - public data: Uint8Array; - - /** PubsubMessage attributes. */ - public attributes: { [k: string]: string }; - - /** PubsubMessage messageId. */ - public messageId: string; - - /** PubsubMessage publishTime. */ - public publishTime?: (google.protobuf.ITimestamp|null); - - /** PubsubMessage orderingKey. */ - public orderingKey: string; - - /** - * Creates a new PubsubMessage instance using the specified properties. - * @param [properties] Properties to set - * @returns PubsubMessage instance - */ - public static create(properties?: google.pubsub.v1.IPubsubMessage): google.pubsub.v1.PubsubMessage; - - /** - * Encodes the specified PubsubMessage message. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. - * @param message PubsubMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IPubsubMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PubsubMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. - * @param message PubsubMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IPubsubMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PubsubMessage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PubsubMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PubsubMessage; - - /** - * Decodes a PubsubMessage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PubsubMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PubsubMessage; - - /** - * Verifies a PubsubMessage message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PubsubMessage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PubsubMessage - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PubsubMessage; - - /** - * Creates a plain object from a PubsubMessage message. Also converts values to other types if specified. - * @param message PubsubMessage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PubsubMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PubsubMessage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GetTopicRequest. */ - interface IGetTopicRequest { - - /** GetTopicRequest topic */ - topic?: (string|null); - } - - /** Represents a GetTopicRequest. */ - class GetTopicRequest implements IGetTopicRequest { - - /** - * Constructs a new GetTopicRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IGetTopicRequest); - - /** GetTopicRequest topic. */ - public topic: string; - - /** - * Creates a new GetTopicRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetTopicRequest instance - */ - public static create(properties?: google.pubsub.v1.IGetTopicRequest): google.pubsub.v1.GetTopicRequest; - - /** - * Encodes the specified GetTopicRequest message. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. - * @param message GetTopicRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IGetTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. - * @param message GetTopicRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IGetTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetTopicRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.GetTopicRequest; - - /** - * Decodes a GetTopicRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.GetTopicRequest; - - /** - * Verifies a GetTopicRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetTopicRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetTopicRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetTopicRequest; - - /** - * Creates a plain object from a GetTopicRequest message. Also converts values to other types if specified. - * @param message GetTopicRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.GetTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetTopicRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UpdateTopicRequest. */ - interface IUpdateTopicRequest { - - /** UpdateTopicRequest topic */ - topic?: (google.pubsub.v1.ITopic|null); - - /** UpdateTopicRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateTopicRequest. */ - class UpdateTopicRequest implements IUpdateTopicRequest { - - /** - * Constructs a new UpdateTopicRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IUpdateTopicRequest); - - /** UpdateTopicRequest topic. */ - public topic?: (google.pubsub.v1.ITopic|null); - - /** UpdateTopicRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateTopicRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateTopicRequest instance - */ - public static create(properties?: google.pubsub.v1.IUpdateTopicRequest): google.pubsub.v1.UpdateTopicRequest; - - /** - * Encodes the specified UpdateTopicRequest message. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. - * @param message UpdateTopicRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IUpdateTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. - * @param message UpdateTopicRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IUpdateTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateTopicRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.UpdateTopicRequest; - - /** - * Decodes an UpdateTopicRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.UpdateTopicRequest; - - /** - * Verifies an UpdateTopicRequest message. - * @param message Plain 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 UpdateTopicRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateTopicRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateTopicRequest; - - /** - * Creates a plain object from an UpdateTopicRequest message. Also converts values to other types if specified. - * @param message UpdateTopicRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.UpdateTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateTopicRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PublishRequest. */ - interface IPublishRequest { - - /** PublishRequest topic */ - topic?: (string|null); - - /** PublishRequest messages */ - messages?: (google.pubsub.v1.IPubsubMessage[]|null); - } - - /** Represents a PublishRequest. */ - class PublishRequest implements IPublishRequest { - - /** - * Constructs a new PublishRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IPublishRequest); - - /** PublishRequest topic. */ - public topic: string; - - /** PublishRequest messages. */ - public messages: google.pubsub.v1.IPubsubMessage[]; - - /** - * Creates a new PublishRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PublishRequest instance - */ - public static create(properties?: google.pubsub.v1.IPublishRequest): google.pubsub.v1.PublishRequest; - - /** - * Encodes the specified PublishRequest message. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. - * @param message PublishRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IPublishRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PublishRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. - * @param message PublishRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IPublishRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PublishRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PublishRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PublishRequest; - - /** - * Decodes a PublishRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PublishRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PublishRequest; - - /** - * Verifies a PublishRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PublishRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PublishRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PublishRequest; - - /** - * Creates a plain object from a PublishRequest message. Also converts values to other types if specified. - * @param message PublishRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PublishRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PublishRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PublishResponse. */ - interface IPublishResponse { - - /** PublishResponse messageIds */ - messageIds?: (string[]|null); - } - - /** Represents a PublishResponse. */ - class PublishResponse implements IPublishResponse { - - /** - * Constructs a new PublishResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IPublishResponse); - - /** PublishResponse messageIds. */ - public messageIds: string[]; - - /** - * Creates a new PublishResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns PublishResponse instance - */ - public static create(properties?: google.pubsub.v1.IPublishResponse): google.pubsub.v1.PublishResponse; - - /** - * Encodes the specified PublishResponse message. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. - * @param message PublishResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IPublishResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PublishResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. - * @param message PublishResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IPublishResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PublishResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PublishResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PublishResponse; - - /** - * Decodes a PublishResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PublishResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PublishResponse; - - /** - * Verifies a PublishResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PublishResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PublishResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PublishResponse; - - /** - * Creates a plain object from a PublishResponse message. Also converts values to other types if specified. - * @param message PublishResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PublishResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PublishResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListTopicsRequest. */ - interface IListTopicsRequest { - - /** ListTopicsRequest project */ - project?: (string|null); - - /** ListTopicsRequest pageSize */ - pageSize?: (number|null); - - /** ListTopicsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListTopicsRequest. */ - class ListTopicsRequest implements IListTopicsRequest { - - /** - * Constructs a new ListTopicsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListTopicsRequest); - - /** ListTopicsRequest project. */ - public project: string; - - /** ListTopicsRequest pageSize. */ - public pageSize: number; - - /** ListTopicsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListTopicsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTopicsRequest instance - */ - public static create(properties?: google.pubsub.v1.IListTopicsRequest): google.pubsub.v1.ListTopicsRequest; - - /** - * Encodes the specified ListTopicsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. - * @param message ListTopicsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListTopicsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTopicsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. - * @param message ListTopicsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTopicsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTopicsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicsRequest; - - /** - * Decodes a ListTopicsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTopicsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicsRequest; - - /** - * Verifies a ListTopicsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTopicsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTopicsRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicsRequest; - - /** - * Creates a plain object from a ListTopicsRequest message. Also converts values to other types if specified. - * @param message ListTopicsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListTopicsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTopicsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListTopicsResponse. */ - interface IListTopicsResponse { - - /** ListTopicsResponse topics */ - topics?: (google.pubsub.v1.ITopic[]|null); - - /** ListTopicsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListTopicsResponse. */ - class ListTopicsResponse implements IListTopicsResponse { - - /** - * Constructs a new ListTopicsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListTopicsResponse); - - /** ListTopicsResponse topics. */ - public topics: google.pubsub.v1.ITopic[]; - - /** ListTopicsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListTopicsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTopicsResponse instance - */ - public static create(properties?: google.pubsub.v1.IListTopicsResponse): google.pubsub.v1.ListTopicsResponse; - - /** - * Encodes the specified ListTopicsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. - * @param message ListTopicsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListTopicsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTopicsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. - * @param message ListTopicsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTopicsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTopicsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicsResponse; - - /** - * Decodes a ListTopicsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTopicsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicsResponse; - - /** - * Verifies a ListTopicsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTopicsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTopicsResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicsResponse; - - /** - * Creates a plain object from a ListTopicsResponse message. Also converts values to other types if specified. - * @param message ListTopicsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListTopicsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTopicsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListTopicSubscriptionsRequest. */ - interface IListTopicSubscriptionsRequest { - - /** ListTopicSubscriptionsRequest topic */ - topic?: (string|null); - - /** ListTopicSubscriptionsRequest pageSize */ - pageSize?: (number|null); - - /** ListTopicSubscriptionsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListTopicSubscriptionsRequest. */ - class ListTopicSubscriptionsRequest implements IListTopicSubscriptionsRequest { - - /** - * Constructs a new ListTopicSubscriptionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListTopicSubscriptionsRequest); - - /** ListTopicSubscriptionsRequest topic. */ - public topic: string; - - /** ListTopicSubscriptionsRequest pageSize. */ - public pageSize: number; - - /** ListTopicSubscriptionsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListTopicSubscriptionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTopicSubscriptionsRequest instance - */ - public static create(properties?: google.pubsub.v1.IListTopicSubscriptionsRequest): google.pubsub.v1.ListTopicSubscriptionsRequest; - - /** - * Encodes the specified ListTopicSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. - * @param message ListTopicSubscriptionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListTopicSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTopicSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. - * @param message ListTopicSubscriptionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTopicSubscriptionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicSubscriptionsRequest; - - /** - * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTopicSubscriptionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicSubscriptionsRequest; - - /** - * Verifies a ListTopicSubscriptionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTopicSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTopicSubscriptionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSubscriptionsRequest; - - /** - * Creates a plain object from a ListTopicSubscriptionsRequest message. Also converts values to other types if specified. - * @param message ListTopicSubscriptionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListTopicSubscriptionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTopicSubscriptionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListTopicSubscriptionsResponse. */ - interface IListTopicSubscriptionsResponse { - - /** ListTopicSubscriptionsResponse subscriptions */ - subscriptions?: (string[]|null); - - /** ListTopicSubscriptionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListTopicSubscriptionsResponse. */ - class ListTopicSubscriptionsResponse implements IListTopicSubscriptionsResponse { - - /** - * Constructs a new ListTopicSubscriptionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListTopicSubscriptionsResponse); - - /** ListTopicSubscriptionsResponse subscriptions. */ - public subscriptions: string[]; - - /** ListTopicSubscriptionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListTopicSubscriptionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTopicSubscriptionsResponse instance - */ - public static create(properties?: google.pubsub.v1.IListTopicSubscriptionsResponse): google.pubsub.v1.ListTopicSubscriptionsResponse; - - /** - * Encodes the specified ListTopicSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. - * @param message ListTopicSubscriptionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListTopicSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTopicSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. - * @param message ListTopicSubscriptionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTopicSubscriptionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicSubscriptionsResponse; - - /** - * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTopicSubscriptionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicSubscriptionsResponse; - - /** - * Verifies a ListTopicSubscriptionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTopicSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTopicSubscriptionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSubscriptionsResponse; - - /** - * Creates a plain object from a ListTopicSubscriptionsResponse message. Also converts values to other types if specified. - * @param message ListTopicSubscriptionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListTopicSubscriptionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTopicSubscriptionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListTopicSnapshotsRequest. */ - interface IListTopicSnapshotsRequest { - - /** ListTopicSnapshotsRequest topic */ - topic?: (string|null); - - /** ListTopicSnapshotsRequest pageSize */ - pageSize?: (number|null); - - /** ListTopicSnapshotsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListTopicSnapshotsRequest. */ - class ListTopicSnapshotsRequest implements IListTopicSnapshotsRequest { - - /** - * Constructs a new ListTopicSnapshotsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListTopicSnapshotsRequest); - - /** ListTopicSnapshotsRequest topic. */ - public topic: string; - - /** ListTopicSnapshotsRequest pageSize. */ - public pageSize: number; - - /** ListTopicSnapshotsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListTopicSnapshotsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTopicSnapshotsRequest instance - */ - public static create(properties?: google.pubsub.v1.IListTopicSnapshotsRequest): google.pubsub.v1.ListTopicSnapshotsRequest; - - /** - * Encodes the specified ListTopicSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. - * @param message ListTopicSnapshotsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListTopicSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTopicSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. - * @param message ListTopicSnapshotsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTopicSnapshotsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicSnapshotsRequest; - - /** - * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTopicSnapshotsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicSnapshotsRequest; - - /** - * Verifies a ListTopicSnapshotsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTopicSnapshotsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTopicSnapshotsRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSnapshotsRequest; - - /** - * Creates a plain object from a ListTopicSnapshotsRequest message. Also converts values to other types if specified. - * @param message ListTopicSnapshotsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListTopicSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTopicSnapshotsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListTopicSnapshotsResponse. */ - interface IListTopicSnapshotsResponse { - - /** ListTopicSnapshotsResponse snapshots */ - snapshots?: (string[]|null); - - /** ListTopicSnapshotsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListTopicSnapshotsResponse. */ - class ListTopicSnapshotsResponse implements IListTopicSnapshotsResponse { - - /** - * Constructs a new ListTopicSnapshotsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListTopicSnapshotsResponse); - - /** ListTopicSnapshotsResponse snapshots. */ - public snapshots: string[]; - - /** ListTopicSnapshotsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListTopicSnapshotsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTopicSnapshotsResponse instance - */ - public static create(properties?: google.pubsub.v1.IListTopicSnapshotsResponse): google.pubsub.v1.ListTopicSnapshotsResponse; - - /** - * Encodes the specified ListTopicSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. - * @param message ListTopicSnapshotsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListTopicSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTopicSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. - * @param message ListTopicSnapshotsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTopicSnapshotsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicSnapshotsResponse; - - /** - * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTopicSnapshotsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicSnapshotsResponse; - - /** - * Verifies a ListTopicSnapshotsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTopicSnapshotsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTopicSnapshotsResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSnapshotsResponse; - - /** - * Creates a plain object from a ListTopicSnapshotsResponse message. Also converts values to other types if specified. - * @param message ListTopicSnapshotsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListTopicSnapshotsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTopicSnapshotsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DeleteTopicRequest. */ - interface IDeleteTopicRequest { - - /** DeleteTopicRequest topic */ - topic?: (string|null); - } - - /** Represents a DeleteTopicRequest. */ - class DeleteTopicRequest implements IDeleteTopicRequest { - - /** - * Constructs a new DeleteTopicRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IDeleteTopicRequest); - - /** DeleteTopicRequest topic. */ - public topic: string; - - /** - * Creates a new DeleteTopicRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteTopicRequest instance - */ - public static create(properties?: google.pubsub.v1.IDeleteTopicRequest): google.pubsub.v1.DeleteTopicRequest; - - /** - * Encodes the specified DeleteTopicRequest message. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. - * @param message DeleteTopicRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IDeleteTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. - * @param message DeleteTopicRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IDeleteTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteTopicRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DeleteTopicRequest; - - /** - * Decodes a DeleteTopicRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DeleteTopicRequest; - - /** - * Verifies a DeleteTopicRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteTopicRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteTopicRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteTopicRequest; - - /** - * Creates a plain object from a DeleteTopicRequest message. Also converts values to other types if specified. - * @param message DeleteTopicRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.DeleteTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteTopicRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Subscriber */ - class Subscriber extends $protobuf.rpc.Service { - - /** - * Constructs a new Subscriber 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 Subscriber 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): Subscriber; - - /** - * Calls CreateSubscription. - * @param request Subscription message or plain object - * @param callback Node-style callback called with the error, if any, and Subscription - */ - public createSubscription(request: google.pubsub.v1.ISubscription, callback: google.pubsub.v1.Subscriber.CreateSubscriptionCallback): void; - - /** - * Calls CreateSubscription. - * @param request Subscription message or plain object - * @returns Promise - */ - public createSubscription(request: google.pubsub.v1.ISubscription): Promise; - - /** - * Calls GetSubscription. - * @param request GetSubscriptionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Subscription - */ - public getSubscription(request: google.pubsub.v1.IGetSubscriptionRequest, callback: google.pubsub.v1.Subscriber.GetSubscriptionCallback): void; - - /** - * Calls GetSubscription. - * @param request GetSubscriptionRequest message or plain object - * @returns Promise - */ - public getSubscription(request: google.pubsub.v1.IGetSubscriptionRequest): Promise; - - /** - * Calls UpdateSubscription. - * @param request UpdateSubscriptionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Subscription - */ - public updateSubscription(request: google.pubsub.v1.IUpdateSubscriptionRequest, callback: google.pubsub.v1.Subscriber.UpdateSubscriptionCallback): void; - - /** - * Calls UpdateSubscription. - * @param request UpdateSubscriptionRequest message or plain object - * @returns Promise - */ - public updateSubscription(request: google.pubsub.v1.IUpdateSubscriptionRequest): Promise; - - /** - * Calls ListSubscriptions. - * @param request ListSubscriptionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSubscriptionsResponse - */ - public listSubscriptions(request: google.pubsub.v1.IListSubscriptionsRequest, callback: google.pubsub.v1.Subscriber.ListSubscriptionsCallback): void; - - /** - * Calls ListSubscriptions. - * @param request ListSubscriptionsRequest message or plain object - * @returns Promise - */ - public listSubscriptions(request: google.pubsub.v1.IListSubscriptionsRequest): Promise; - - /** - * Calls DeleteSubscription. - * @param request DeleteSubscriptionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteSubscription(request: google.pubsub.v1.IDeleteSubscriptionRequest, callback: google.pubsub.v1.Subscriber.DeleteSubscriptionCallback): void; - - /** - * Calls DeleteSubscription. - * @param request DeleteSubscriptionRequest message or plain object - * @returns Promise - */ - public deleteSubscription(request: google.pubsub.v1.IDeleteSubscriptionRequest): Promise; - - /** - * Calls ModifyAckDeadline. - * @param request ModifyAckDeadlineRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public modifyAckDeadline(request: google.pubsub.v1.IModifyAckDeadlineRequest, callback: google.pubsub.v1.Subscriber.ModifyAckDeadlineCallback): void; - - /** - * Calls ModifyAckDeadline. - * @param request ModifyAckDeadlineRequest message or plain object - * @returns Promise - */ - public modifyAckDeadline(request: google.pubsub.v1.IModifyAckDeadlineRequest): Promise; - - /** - * Calls Acknowledge. - * @param request AcknowledgeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public acknowledge(request: google.pubsub.v1.IAcknowledgeRequest, callback: google.pubsub.v1.Subscriber.AcknowledgeCallback): void; - - /** - * Calls Acknowledge. - * @param request AcknowledgeRequest message or plain object - * @returns Promise - */ - public acknowledge(request: google.pubsub.v1.IAcknowledgeRequest): Promise; - - /** - * Calls Pull. - * @param request PullRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PullResponse - */ - public pull(request: google.pubsub.v1.IPullRequest, callback: google.pubsub.v1.Subscriber.PullCallback): void; - - /** - * Calls Pull. - * @param request PullRequest message or plain object - * @returns Promise - */ - public pull(request: google.pubsub.v1.IPullRequest): Promise; - - /** - * Calls StreamingPull. - * @param request StreamingPullRequest message or plain object - * @param callback Node-style callback called with the error, if any, and StreamingPullResponse - */ - public streamingPull(request: google.pubsub.v1.IStreamingPullRequest, callback: google.pubsub.v1.Subscriber.StreamingPullCallback): void; - - /** - * Calls StreamingPull. - * @param request StreamingPullRequest message or plain object - * @returns Promise - */ - public streamingPull(request: google.pubsub.v1.IStreamingPullRequest): Promise; - - /** - * Calls ModifyPushConfig. - * @param request ModifyPushConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public modifyPushConfig(request: google.pubsub.v1.IModifyPushConfigRequest, callback: google.pubsub.v1.Subscriber.ModifyPushConfigCallback): void; - - /** - * Calls ModifyPushConfig. - * @param request ModifyPushConfigRequest message or plain object - * @returns Promise - */ - public modifyPushConfig(request: google.pubsub.v1.IModifyPushConfigRequest): Promise; - - /** - * Calls GetSnapshot. - * @param request GetSnapshotRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Snapshot - */ - public getSnapshot(request: google.pubsub.v1.IGetSnapshotRequest, callback: google.pubsub.v1.Subscriber.GetSnapshotCallback): void; - - /** - * Calls GetSnapshot. - * @param request GetSnapshotRequest message or plain object - * @returns Promise - */ - public getSnapshot(request: google.pubsub.v1.IGetSnapshotRequest): Promise; - - /** - * Calls ListSnapshots. - * @param request ListSnapshotsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSnapshotsResponse - */ - public listSnapshots(request: google.pubsub.v1.IListSnapshotsRequest, callback: google.pubsub.v1.Subscriber.ListSnapshotsCallback): void; - - /** - * Calls ListSnapshots. - * @param request ListSnapshotsRequest message or plain object - * @returns Promise - */ - public listSnapshots(request: google.pubsub.v1.IListSnapshotsRequest): Promise; - - /** - * Calls CreateSnapshot. - * @param request CreateSnapshotRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Snapshot - */ - public createSnapshot(request: google.pubsub.v1.ICreateSnapshotRequest, callback: google.pubsub.v1.Subscriber.CreateSnapshotCallback): void; - - /** - * Calls CreateSnapshot. - * @param request CreateSnapshotRequest message or plain object - * @returns Promise - */ - public createSnapshot(request: google.pubsub.v1.ICreateSnapshotRequest): Promise; - - /** - * Calls UpdateSnapshot. - * @param request UpdateSnapshotRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Snapshot - */ - public updateSnapshot(request: google.pubsub.v1.IUpdateSnapshotRequest, callback: google.pubsub.v1.Subscriber.UpdateSnapshotCallback): void; - - /** - * Calls UpdateSnapshot. - * @param request UpdateSnapshotRequest message or plain object - * @returns Promise - */ - public updateSnapshot(request: google.pubsub.v1.IUpdateSnapshotRequest): Promise; - - /** - * Calls DeleteSnapshot. - * @param request DeleteSnapshotRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteSnapshot(request: google.pubsub.v1.IDeleteSnapshotRequest, callback: google.pubsub.v1.Subscriber.DeleteSnapshotCallback): void; - - /** - * Calls DeleteSnapshot. - * @param request DeleteSnapshotRequest message or plain object - * @returns Promise - */ - public deleteSnapshot(request: google.pubsub.v1.IDeleteSnapshotRequest): Promise; - - /** - * Calls Seek. - * @param request SeekRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SeekResponse - */ - public seek(request: google.pubsub.v1.ISeekRequest, callback: google.pubsub.v1.Subscriber.SeekCallback): void; - - /** - * Calls Seek. - * @param request SeekRequest message or plain object - * @returns Promise - */ - public seek(request: google.pubsub.v1.ISeekRequest): Promise; - } - - namespace Subscriber { - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#createSubscription}. - * @param error Error, if any - * @param [response] Subscription - */ - type CreateSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#getSubscription}. - * @param error Error, if any - * @param [response] Subscription - */ - type GetSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#updateSubscription}. - * @param error Error, if any - * @param [response] Subscription - */ - type UpdateSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#listSubscriptions}. - * @param error Error, if any - * @param [response] ListSubscriptionsResponse - */ - type ListSubscriptionsCallback = (error: (Error|null), response?: google.pubsub.v1.ListSubscriptionsResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#deleteSubscription}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteSubscriptionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#modifyAckDeadline}. - * @param error Error, if any - * @param [response] Empty - */ - type ModifyAckDeadlineCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#acknowledge}. - * @param error Error, if any - * @param [response] Empty - */ - type AcknowledgeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#pull}. - * @param error Error, if any - * @param [response] PullResponse - */ - type PullCallback = (error: (Error|null), response?: google.pubsub.v1.PullResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#streamingPull}. - * @param error Error, if any - * @param [response] StreamingPullResponse - */ - type StreamingPullCallback = (error: (Error|null), response?: google.pubsub.v1.StreamingPullResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#modifyPushConfig}. - * @param error Error, if any - * @param [response] Empty - */ - type ModifyPushConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#getSnapshot}. - * @param error Error, if any - * @param [response] Snapshot - */ - type GetSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#listSnapshots}. - * @param error Error, if any - * @param [response] ListSnapshotsResponse - */ - type ListSnapshotsCallback = (error: (Error|null), response?: google.pubsub.v1.ListSnapshotsResponse) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#createSnapshot}. - * @param error Error, if any - * @param [response] Snapshot - */ - type CreateSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#updateSnapshot}. - * @param error Error, if any - * @param [response] Snapshot - */ - type UpdateSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#deleteSnapshot}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteSnapshotCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#seek}. - * @param error Error, if any - * @param [response] SeekResponse - */ - type SeekCallback = (error: (Error|null), response?: google.pubsub.v1.SeekResponse) => void; - } - - /** Properties of a Subscription. */ - interface ISubscription { - - /** Subscription name */ - name?: (string|null); - - /** Subscription topic */ - topic?: (string|null); - - /** Subscription pushConfig */ - pushConfig?: (google.pubsub.v1.IPushConfig|null); - - /** Subscription ackDeadlineSeconds */ - ackDeadlineSeconds?: (number|null); - - /** Subscription retainAckedMessages */ - retainAckedMessages?: (boolean|null); - - /** Subscription messageRetentionDuration */ - messageRetentionDuration?: (google.protobuf.IDuration|null); - - /** Subscription labels */ - labels?: ({ [k: string]: string }|null); - - /** Subscription enableMessageOrdering */ - enableMessageOrdering?: (boolean|null); - - /** Subscription expirationPolicy */ - expirationPolicy?: (google.pubsub.v1.IExpirationPolicy|null); - - /** Subscription deadLetterPolicy */ - deadLetterPolicy?: (google.pubsub.v1.IDeadLetterPolicy|null); - } - - /** Represents a Subscription. */ - class Subscription implements ISubscription { - - /** - * Constructs a new Subscription. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ISubscription); - - /** Subscription name. */ - public name: string; - - /** Subscription topic. */ - public topic: string; - - /** Subscription pushConfig. */ - public pushConfig?: (google.pubsub.v1.IPushConfig|null); - - /** Subscription ackDeadlineSeconds. */ - public ackDeadlineSeconds: number; - - /** Subscription retainAckedMessages. */ - public retainAckedMessages: boolean; - - /** Subscription messageRetentionDuration. */ - public messageRetentionDuration?: (google.protobuf.IDuration|null); - - /** Subscription labels. */ - public labels: { [k: string]: string }; - - /** Subscription enableMessageOrdering. */ - public enableMessageOrdering: boolean; - - /** Subscription expirationPolicy. */ - public expirationPolicy?: (google.pubsub.v1.IExpirationPolicy|null); - - /** Subscription deadLetterPolicy. */ - public deadLetterPolicy?: (google.pubsub.v1.IDeadLetterPolicy|null); - - /** - * Creates a new Subscription instance using the specified properties. - * @param [properties] Properties to set - * @returns Subscription instance - */ - public static create(properties?: google.pubsub.v1.ISubscription): google.pubsub.v1.Subscription; - - /** - * Encodes the specified Subscription message. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. - * @param message Subscription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ISubscription, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Subscription message, length delimited. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. - * @param message Subscription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ISubscription, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Subscription message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Subscription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.Subscription; - - /** - * Decodes a Subscription message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Subscription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.Subscription; - - /** - * Verifies a Subscription message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Subscription message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Subscription - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Subscription; - - /** - * Creates a plain object from a Subscription message. Also converts values to other types if specified. - * @param message Subscription - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.Subscription, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Subscription to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DeadLetterPolicy. */ - interface IDeadLetterPolicy { - - /** DeadLetterPolicy deadLetterTopic */ - deadLetterTopic?: (string|null); - - /** DeadLetterPolicy maxDeliveryAttempts */ - maxDeliveryAttempts?: (number|null); - } - - /** Represents a DeadLetterPolicy. */ - class DeadLetterPolicy implements IDeadLetterPolicy { - - /** - * Constructs a new DeadLetterPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IDeadLetterPolicy); - - /** DeadLetterPolicy deadLetterTopic. */ - public deadLetterTopic: string; - - /** DeadLetterPolicy maxDeliveryAttempts. */ - public maxDeliveryAttempts: number; - - /** - * Creates a new DeadLetterPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns DeadLetterPolicy instance - */ - public static create(properties?: google.pubsub.v1.IDeadLetterPolicy): google.pubsub.v1.DeadLetterPolicy; - - /** - * Encodes the specified DeadLetterPolicy message. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. - * @param message DeadLetterPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IDeadLetterPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeadLetterPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. - * @param message DeadLetterPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IDeadLetterPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeadLetterPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeadLetterPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DeadLetterPolicy; - - /** - * Decodes a DeadLetterPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeadLetterPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DeadLetterPolicy; - - /** - * Verifies a DeadLetterPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeadLetterPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeadLetterPolicy - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeadLetterPolicy; - - /** - * Creates a plain object from a DeadLetterPolicy message. Also converts values to other types if specified. - * @param message DeadLetterPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.DeadLetterPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeadLetterPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ExpirationPolicy. */ - interface IExpirationPolicy { - - /** ExpirationPolicy ttl */ - ttl?: (google.protobuf.IDuration|null); - } - - /** Represents an ExpirationPolicy. */ - class ExpirationPolicy implements IExpirationPolicy { - - /** - * Constructs a new ExpirationPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IExpirationPolicy); - - /** ExpirationPolicy ttl. */ - public ttl?: (google.protobuf.IDuration|null); - - /** - * Creates a new ExpirationPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns ExpirationPolicy instance - */ - public static create(properties?: google.pubsub.v1.IExpirationPolicy): google.pubsub.v1.ExpirationPolicy; - - /** - * Encodes the specified ExpirationPolicy message. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. - * @param message ExpirationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IExpirationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExpirationPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. - * @param message ExpirationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IExpirationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExpirationPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExpirationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ExpirationPolicy; - - /** - * Decodes an ExpirationPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExpirationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ExpirationPolicy; - - /** - * Verifies an ExpirationPolicy message. - * @param message Plain 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 ExpirationPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExpirationPolicy - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ExpirationPolicy; - - /** - * Creates a plain object from an ExpirationPolicy message. Also converts values to other types if specified. - * @param message ExpirationPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ExpirationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExpirationPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PushConfig. */ - interface IPushConfig { - - /** PushConfig pushEndpoint */ - pushEndpoint?: (string|null); - - /** PushConfig attributes */ - attributes?: ({ [k: string]: string }|null); - - /** PushConfig oidcToken */ - oidcToken?: (google.pubsub.v1.PushConfig.IOidcToken|null); - } - - /** Represents a PushConfig. */ - class PushConfig implements IPushConfig { - - /** - * Constructs a new PushConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IPushConfig); - - /** PushConfig pushEndpoint. */ - public pushEndpoint: string; - - /** PushConfig attributes. */ - public attributes: { [k: string]: string }; - - /** PushConfig oidcToken. */ - public oidcToken?: (google.pubsub.v1.PushConfig.IOidcToken|null); - - /** PushConfig authenticationMethod. */ - public authenticationMethod?: "oidcToken"; - - /** - * Creates a new PushConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PushConfig instance - */ - public static create(properties?: google.pubsub.v1.IPushConfig): google.pubsub.v1.PushConfig; - - /** - * Encodes the specified PushConfig message. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. - * @param message PushConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IPushConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PushConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. - * @param message PushConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IPushConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PushConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PushConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PushConfig; - - /** - * Decodes a PushConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PushConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PushConfig; - - /** - * Verifies a PushConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PushConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PushConfig - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig; - - /** - * Creates a plain object from a PushConfig message. Also converts values to other types if specified. - * @param message PushConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PushConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PushConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace PushConfig { - - /** Properties of an OidcToken. */ - interface IOidcToken { - - /** OidcToken serviceAccountEmail */ - serviceAccountEmail?: (string|null); - - /** OidcToken audience */ - audience?: (string|null); - } - - /** Represents an OidcToken. */ - class OidcToken implements IOidcToken { - - /** - * Constructs a new OidcToken. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.PushConfig.IOidcToken); - - /** OidcToken serviceAccountEmail. */ - public serviceAccountEmail: string; - - /** OidcToken audience. */ - public audience: string; - - /** - * Creates a new OidcToken instance using the specified properties. - * @param [properties] Properties to set - * @returns OidcToken instance - */ - public static create(properties?: google.pubsub.v1.PushConfig.IOidcToken): google.pubsub.v1.PushConfig.OidcToken; - - /** - * Encodes the specified OidcToken message. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. - * @param message OidcToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.PushConfig.IOidcToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OidcToken message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. - * @param message OidcToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.PushConfig.IOidcToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OidcToken message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OidcToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PushConfig.OidcToken; - - /** - * Decodes an OidcToken message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OidcToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PushConfig.OidcToken; - - /** - * Verifies an OidcToken message. - * @param message Plain 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 OidcToken message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OidcToken - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig.OidcToken; - - /** - * Creates a plain object from an OidcToken message. Also converts values to other types if specified. - * @param message OidcToken - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PushConfig.OidcToken, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OidcToken to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a ReceivedMessage. */ - interface IReceivedMessage { - - /** ReceivedMessage ackId */ - ackId?: (string|null); - - /** ReceivedMessage message */ - message?: (google.pubsub.v1.IPubsubMessage|null); - - /** ReceivedMessage deliveryAttempt */ - deliveryAttempt?: (number|null); - } - - /** Represents a ReceivedMessage. */ - class ReceivedMessage implements IReceivedMessage { - - /** - * Constructs a new ReceivedMessage. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IReceivedMessage); - - /** ReceivedMessage ackId. */ - public ackId: string; - - /** ReceivedMessage message. */ - public message?: (google.pubsub.v1.IPubsubMessage|null); - - /** ReceivedMessage deliveryAttempt. */ - public deliveryAttempt: number; - - /** - * Creates a new ReceivedMessage instance using the specified properties. - * @param [properties] Properties to set - * @returns ReceivedMessage instance - */ - public static create(properties?: google.pubsub.v1.IReceivedMessage): google.pubsub.v1.ReceivedMessage; - - /** - * Encodes the specified ReceivedMessage message. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. - * @param message ReceivedMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IReceivedMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReceivedMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. - * @param message ReceivedMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IReceivedMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReceivedMessage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReceivedMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ReceivedMessage; - - /** - * Decodes a ReceivedMessage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReceivedMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ReceivedMessage; - - /** - * Verifies a ReceivedMessage message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReceivedMessage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReceivedMessage - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ReceivedMessage; - - /** - * Creates a plain object from a ReceivedMessage message. Also converts values to other types if specified. - * @param message ReceivedMessage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ReceivedMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReceivedMessage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GetSubscriptionRequest. */ - interface IGetSubscriptionRequest { - - /** GetSubscriptionRequest subscription */ - subscription?: (string|null); - } - - /** Represents a GetSubscriptionRequest. */ - class GetSubscriptionRequest implements IGetSubscriptionRequest { - - /** - * Constructs a new GetSubscriptionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IGetSubscriptionRequest); - - /** GetSubscriptionRequest subscription. */ - public subscription: string; - - /** - * Creates a new GetSubscriptionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetSubscriptionRequest instance - */ - public static create(properties?: google.pubsub.v1.IGetSubscriptionRequest): google.pubsub.v1.GetSubscriptionRequest; - - /** - * Encodes the specified GetSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. - * @param message GetSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IGetSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. - * @param message GetSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IGetSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetSubscriptionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.GetSubscriptionRequest; - - /** - * Decodes a GetSubscriptionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.GetSubscriptionRequest; - - /** - * Verifies a GetSubscriptionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetSubscriptionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetSubscriptionRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetSubscriptionRequest; - - /** - * Creates a plain object from a GetSubscriptionRequest message. Also converts values to other types if specified. - * @param message GetSubscriptionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.GetSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetSubscriptionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UpdateSubscriptionRequest. */ - interface IUpdateSubscriptionRequest { - - /** UpdateSubscriptionRequest subscription */ - subscription?: (google.pubsub.v1.ISubscription|null); - - /** UpdateSubscriptionRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateSubscriptionRequest. */ - class UpdateSubscriptionRequest implements IUpdateSubscriptionRequest { - - /** - * Constructs a new UpdateSubscriptionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IUpdateSubscriptionRequest); - - /** UpdateSubscriptionRequest subscription. */ - public subscription?: (google.pubsub.v1.ISubscription|null); - - /** UpdateSubscriptionRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateSubscriptionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateSubscriptionRequest instance - */ - public static create(properties?: google.pubsub.v1.IUpdateSubscriptionRequest): google.pubsub.v1.UpdateSubscriptionRequest; - - /** - * Encodes the specified UpdateSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. - * @param message UpdateSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IUpdateSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. - * @param message UpdateSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IUpdateSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.UpdateSubscriptionRequest; - - /** - * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.UpdateSubscriptionRequest; - - /** - * Verifies an UpdateSubscriptionRequest message. - * @param message Plain 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 UpdateSubscriptionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateSubscriptionRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateSubscriptionRequest; - - /** - * Creates a plain object from an UpdateSubscriptionRequest message. Also converts values to other types if specified. - * @param message UpdateSubscriptionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.UpdateSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateSubscriptionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListSubscriptionsRequest. */ - interface IListSubscriptionsRequest { - - /** ListSubscriptionsRequest project */ - project?: (string|null); - - /** ListSubscriptionsRequest pageSize */ - pageSize?: (number|null); - - /** ListSubscriptionsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListSubscriptionsRequest. */ - class ListSubscriptionsRequest implements IListSubscriptionsRequest { - - /** - * Constructs a new ListSubscriptionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListSubscriptionsRequest); - - /** ListSubscriptionsRequest project. */ - public project: string; - - /** ListSubscriptionsRequest pageSize. */ - public pageSize: number; - - /** ListSubscriptionsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListSubscriptionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSubscriptionsRequest instance - */ - public static create(properties?: google.pubsub.v1.IListSubscriptionsRequest): google.pubsub.v1.ListSubscriptionsRequest; - - /** - * Encodes the specified ListSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. - * @param message ListSubscriptionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. - * @param message ListSubscriptionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSubscriptionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSubscriptionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSubscriptionsRequest; - - /** - * Decodes a ListSubscriptionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSubscriptionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSubscriptionsRequest; - - /** - * Verifies a ListSubscriptionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSubscriptionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSubscriptionsRequest; - - /** - * Creates a plain object from a ListSubscriptionsRequest message. Also converts values to other types if specified. - * @param message ListSubscriptionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListSubscriptionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSubscriptionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListSubscriptionsResponse. */ - interface IListSubscriptionsResponse { - - /** ListSubscriptionsResponse subscriptions */ - subscriptions?: (google.pubsub.v1.ISubscription[]|null); - - /** ListSubscriptionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSubscriptionsResponse. */ - class ListSubscriptionsResponse implements IListSubscriptionsResponse { - - /** - * Constructs a new ListSubscriptionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListSubscriptionsResponse); - - /** ListSubscriptionsResponse subscriptions. */ - public subscriptions: google.pubsub.v1.ISubscription[]; - - /** ListSubscriptionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListSubscriptionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSubscriptionsResponse instance - */ - public static create(properties?: google.pubsub.v1.IListSubscriptionsResponse): google.pubsub.v1.ListSubscriptionsResponse; - - /** - * Encodes the specified ListSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. - * @param message ListSubscriptionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. - * @param message ListSubscriptionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSubscriptionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSubscriptionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSubscriptionsResponse; - - /** - * Decodes a ListSubscriptionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSubscriptionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSubscriptionsResponse; - - /** - * Verifies a ListSubscriptionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSubscriptionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSubscriptionsResponse; - - /** - * Creates a plain object from a ListSubscriptionsResponse message. Also converts values to other types if specified. - * @param message ListSubscriptionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListSubscriptionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSubscriptionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DeleteSubscriptionRequest. */ - interface IDeleteSubscriptionRequest { - - /** DeleteSubscriptionRequest subscription */ - subscription?: (string|null); - } - - /** Represents a DeleteSubscriptionRequest. */ - class DeleteSubscriptionRequest implements IDeleteSubscriptionRequest { - - /** - * Constructs a new DeleteSubscriptionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IDeleteSubscriptionRequest); - - /** DeleteSubscriptionRequest subscription. */ - public subscription: string; - - /** - * Creates a new DeleteSubscriptionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteSubscriptionRequest instance - */ - public static create(properties?: google.pubsub.v1.IDeleteSubscriptionRequest): google.pubsub.v1.DeleteSubscriptionRequest; - - /** - * Encodes the specified DeleteSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. - * @param message DeleteSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IDeleteSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. - * @param message DeleteSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IDeleteSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DeleteSubscriptionRequest; - - /** - * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DeleteSubscriptionRequest; - - /** - * Verifies a DeleteSubscriptionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteSubscriptionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteSubscriptionRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSubscriptionRequest; - - /** - * Creates a plain object from a DeleteSubscriptionRequest message. Also converts values to other types if specified. - * @param message DeleteSubscriptionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.DeleteSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteSubscriptionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ModifyPushConfigRequest. */ - interface IModifyPushConfigRequest { - - /** ModifyPushConfigRequest subscription */ - subscription?: (string|null); - - /** ModifyPushConfigRequest pushConfig */ - pushConfig?: (google.pubsub.v1.IPushConfig|null); - } - - /** Represents a ModifyPushConfigRequest. */ - class ModifyPushConfigRequest implements IModifyPushConfigRequest { - - /** - * Constructs a new ModifyPushConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IModifyPushConfigRequest); - - /** ModifyPushConfigRequest subscription. */ - public subscription: string; - - /** ModifyPushConfigRequest pushConfig. */ - public pushConfig?: (google.pubsub.v1.IPushConfig|null); - - /** - * Creates a new ModifyPushConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ModifyPushConfigRequest instance - */ - public static create(properties?: google.pubsub.v1.IModifyPushConfigRequest): google.pubsub.v1.ModifyPushConfigRequest; - - /** - * Encodes the specified ModifyPushConfigRequest message. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. - * @param message ModifyPushConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IModifyPushConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ModifyPushConfigRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. - * @param message ModifyPushConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IModifyPushConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModifyPushConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ModifyPushConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ModifyPushConfigRequest; - - /** - * Decodes a ModifyPushConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ModifyPushConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ModifyPushConfigRequest; - - /** - * Verifies a ModifyPushConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ModifyPushConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ModifyPushConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ModifyPushConfigRequest; - - /** - * Creates a plain object from a ModifyPushConfigRequest message. Also converts values to other types if specified. - * @param message ModifyPushConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ModifyPushConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ModifyPushConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PullRequest. */ - interface IPullRequest { - - /** PullRequest subscription */ - subscription?: (string|null); - - /** PullRequest returnImmediately */ - returnImmediately?: (boolean|null); - - /** PullRequest maxMessages */ - maxMessages?: (number|null); - } - - /** Represents a PullRequest. */ - class PullRequest implements IPullRequest { - - /** - * Constructs a new PullRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IPullRequest); - - /** PullRequest subscription. */ - public subscription: string; - - /** PullRequest returnImmediately. */ - public returnImmediately: boolean; - - /** PullRequest maxMessages. */ - public maxMessages: number; - - /** - * Creates a new PullRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PullRequest instance - */ - public static create(properties?: google.pubsub.v1.IPullRequest): google.pubsub.v1.PullRequest; - - /** - * Encodes the specified PullRequest message. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. - * @param message PullRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. - * @param message PullRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PullRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PullRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PullRequest; - - /** - * Decodes a PullRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PullRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PullRequest; - - /** - * Verifies a PullRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PullRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PullRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PullRequest; - - /** - * Creates a plain object from a PullRequest message. Also converts values to other types if specified. - * @param message PullRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PullRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PullRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PullResponse. */ - interface IPullResponse { - - /** PullResponse receivedMessages */ - receivedMessages?: (google.pubsub.v1.IReceivedMessage[]|null); - } - - /** Represents a PullResponse. */ - class PullResponse implements IPullResponse { - - /** - * Constructs a new PullResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IPullResponse); - - /** PullResponse receivedMessages. */ - public receivedMessages: google.pubsub.v1.IReceivedMessage[]; - - /** - * Creates a new PullResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns PullResponse instance - */ - public static create(properties?: google.pubsub.v1.IPullResponse): google.pubsub.v1.PullResponse; - - /** - * Encodes the specified PullResponse message. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. - * @param message PullResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. - * @param message PullResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PullResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PullResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PullResponse; - - /** - * Decodes a PullResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PullResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PullResponse; - - /** - * Verifies a PullResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PullResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PullResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PullResponse; - - /** - * Creates a plain object from a PullResponse message. Also converts values to other types if specified. - * @param message PullResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PullResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PullResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ModifyAckDeadlineRequest. */ - interface IModifyAckDeadlineRequest { - - /** ModifyAckDeadlineRequest subscription */ - subscription?: (string|null); - - /** ModifyAckDeadlineRequest ackIds */ - ackIds?: (string[]|null); - - /** ModifyAckDeadlineRequest ackDeadlineSeconds */ - ackDeadlineSeconds?: (number|null); - } - - /** Represents a ModifyAckDeadlineRequest. */ - class ModifyAckDeadlineRequest implements IModifyAckDeadlineRequest { - - /** - * Constructs a new ModifyAckDeadlineRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IModifyAckDeadlineRequest); - - /** ModifyAckDeadlineRequest subscription. */ - public subscription: string; - - /** ModifyAckDeadlineRequest ackIds. */ - public ackIds: string[]; - - /** ModifyAckDeadlineRequest ackDeadlineSeconds. */ - public ackDeadlineSeconds: number; - - /** - * Creates a new ModifyAckDeadlineRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ModifyAckDeadlineRequest instance - */ - public static create(properties?: google.pubsub.v1.IModifyAckDeadlineRequest): google.pubsub.v1.ModifyAckDeadlineRequest; - - /** - * Encodes the specified ModifyAckDeadlineRequest message. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. - * @param message ModifyAckDeadlineRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IModifyAckDeadlineRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ModifyAckDeadlineRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. - * @param message ModifyAckDeadlineRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IModifyAckDeadlineRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ModifyAckDeadlineRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ModifyAckDeadlineRequest; - - /** - * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ModifyAckDeadlineRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ModifyAckDeadlineRequest; - - /** - * Verifies a ModifyAckDeadlineRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ModifyAckDeadlineRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ModifyAckDeadlineRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ModifyAckDeadlineRequest; - - /** - * Creates a plain object from a ModifyAckDeadlineRequest message. Also converts values to other types if specified. - * @param message ModifyAckDeadlineRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ModifyAckDeadlineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ModifyAckDeadlineRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an AcknowledgeRequest. */ - interface IAcknowledgeRequest { - - /** AcknowledgeRequest subscription */ - subscription?: (string|null); - - /** AcknowledgeRequest ackIds */ - ackIds?: (string[]|null); - } - - /** Represents an AcknowledgeRequest. */ - class AcknowledgeRequest implements IAcknowledgeRequest { - - /** - * Constructs a new AcknowledgeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IAcknowledgeRequest); - - /** AcknowledgeRequest subscription. */ - public subscription: string; - - /** AcknowledgeRequest ackIds. */ - public ackIds: string[]; - - /** - * Creates a new AcknowledgeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns AcknowledgeRequest instance - */ - public static create(properties?: google.pubsub.v1.IAcknowledgeRequest): google.pubsub.v1.AcknowledgeRequest; - - /** - * Encodes the specified AcknowledgeRequest message. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. - * @param message AcknowledgeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IAcknowledgeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AcknowledgeRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. - * @param message AcknowledgeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IAcknowledgeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AcknowledgeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AcknowledgeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.AcknowledgeRequest; - - /** - * Decodes an AcknowledgeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AcknowledgeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.AcknowledgeRequest; - - /** - * Verifies an AcknowledgeRequest message. - * @param message Plain 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 AcknowledgeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AcknowledgeRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.AcknowledgeRequest; - - /** - * Creates a plain object from an AcknowledgeRequest message. Also converts values to other types if specified. - * @param message AcknowledgeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.AcknowledgeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AcknowledgeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a StreamingPullRequest. */ - interface IStreamingPullRequest { - - /** StreamingPullRequest subscription */ - subscription?: (string|null); - - /** StreamingPullRequest ackIds */ - ackIds?: (string[]|null); - - /** StreamingPullRequest modifyDeadlineSeconds */ - modifyDeadlineSeconds?: (number[]|null); - - /** StreamingPullRequest modifyDeadlineAckIds */ - modifyDeadlineAckIds?: (string[]|null); - - /** StreamingPullRequest streamAckDeadlineSeconds */ - streamAckDeadlineSeconds?: (number|null); - } - - /** Represents a StreamingPullRequest. */ - class StreamingPullRequest implements IStreamingPullRequest { - - /** - * Constructs a new StreamingPullRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IStreamingPullRequest); - - /** StreamingPullRequest subscription. */ - public subscription: string; - - /** StreamingPullRequest ackIds. */ - public ackIds: string[]; - - /** StreamingPullRequest modifyDeadlineSeconds. */ - public modifyDeadlineSeconds: number[]; - - /** StreamingPullRequest modifyDeadlineAckIds. */ - public modifyDeadlineAckIds: string[]; - - /** StreamingPullRequest streamAckDeadlineSeconds. */ - public streamAckDeadlineSeconds: number; - - /** - * Creates a new StreamingPullRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns StreamingPullRequest instance - */ - public static create(properties?: google.pubsub.v1.IStreamingPullRequest): google.pubsub.v1.StreamingPullRequest; - - /** - * Encodes the specified StreamingPullRequest message. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. - * @param message StreamingPullRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IStreamingPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StreamingPullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. - * @param message StreamingPullRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IStreamingPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StreamingPullRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StreamingPullRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.StreamingPullRequest; - - /** - * Decodes a StreamingPullRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StreamingPullRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.StreamingPullRequest; - - /** - * Verifies a StreamingPullRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StreamingPullRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StreamingPullRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullRequest; - - /** - * Creates a plain object from a StreamingPullRequest message. Also converts values to other types if specified. - * @param message StreamingPullRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.StreamingPullRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StreamingPullRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a StreamingPullResponse. */ - interface IStreamingPullResponse { - - /** StreamingPullResponse receivedMessages */ - receivedMessages?: (google.pubsub.v1.IReceivedMessage[]|null); - } - - /** Represents a StreamingPullResponse. */ - class StreamingPullResponse implements IStreamingPullResponse { - - /** - * Constructs a new StreamingPullResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IStreamingPullResponse); - - /** StreamingPullResponse receivedMessages. */ - public receivedMessages: google.pubsub.v1.IReceivedMessage[]; - - /** - * Creates a new StreamingPullResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns StreamingPullResponse instance - */ - public static create(properties?: google.pubsub.v1.IStreamingPullResponse): google.pubsub.v1.StreamingPullResponse; - - /** - * Encodes the specified StreamingPullResponse message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. - * @param message StreamingPullResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IStreamingPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StreamingPullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. - * @param message StreamingPullResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IStreamingPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StreamingPullResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StreamingPullResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.StreamingPullResponse; - - /** - * Decodes a StreamingPullResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StreamingPullResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.StreamingPullResponse; - - /** - * Verifies a StreamingPullResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StreamingPullResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StreamingPullResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullResponse; - - /** - * Creates a plain object from a StreamingPullResponse message. Also converts values to other types if specified. - * @param message StreamingPullResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.StreamingPullResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StreamingPullResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CreateSnapshotRequest. */ - interface ICreateSnapshotRequest { - - /** CreateSnapshotRequest name */ - name?: (string|null); - - /** CreateSnapshotRequest subscription */ - subscription?: (string|null); - - /** CreateSnapshotRequest labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a CreateSnapshotRequest. */ - class CreateSnapshotRequest implements ICreateSnapshotRequest { - - /** - * Constructs a new CreateSnapshotRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ICreateSnapshotRequest); - - /** CreateSnapshotRequest name. */ - public name: string; - - /** CreateSnapshotRequest subscription. */ - public subscription: string; - - /** CreateSnapshotRequest labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new CreateSnapshotRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSnapshotRequest instance - */ - public static create(properties?: google.pubsub.v1.ICreateSnapshotRequest): google.pubsub.v1.CreateSnapshotRequest; - - /** - * Encodes the specified CreateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. - * @param message CreateSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ICreateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. - * @param message CreateSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ICreateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateSnapshotRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.CreateSnapshotRequest; - - /** - * Decodes a CreateSnapshotRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.CreateSnapshotRequest; - - /** - * Verifies a CreateSnapshotRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSnapshotRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CreateSnapshotRequest; - - /** - * Creates a plain object from a CreateSnapshotRequest message. Also converts values to other types if specified. - * @param message CreateSnapshotRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.CreateSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateSnapshotRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UpdateSnapshotRequest. */ - interface IUpdateSnapshotRequest { - - /** UpdateSnapshotRequest snapshot */ - snapshot?: (google.pubsub.v1.ISnapshot|null); - - /** UpdateSnapshotRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateSnapshotRequest. */ - class UpdateSnapshotRequest implements IUpdateSnapshotRequest { - - /** - * Constructs a new UpdateSnapshotRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IUpdateSnapshotRequest); - - /** UpdateSnapshotRequest snapshot. */ - public snapshot?: (google.pubsub.v1.ISnapshot|null); - - /** UpdateSnapshotRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateSnapshotRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateSnapshotRequest instance - */ - public static create(properties?: google.pubsub.v1.IUpdateSnapshotRequest): google.pubsub.v1.UpdateSnapshotRequest; - - /** - * Encodes the specified UpdateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. - * @param message UpdateSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IUpdateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. - * @param message UpdateSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IUpdateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateSnapshotRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.UpdateSnapshotRequest; - - /** - * Decodes an UpdateSnapshotRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.UpdateSnapshotRequest; - - /** - * Verifies an UpdateSnapshotRequest message. - * @param message Plain 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 UpdateSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateSnapshotRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateSnapshotRequest; - - /** - * Creates a plain object from an UpdateSnapshotRequest message. Also converts values to other types if specified. - * @param message UpdateSnapshotRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.UpdateSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateSnapshotRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Snapshot. */ - interface ISnapshot { - - /** Snapshot name */ - name?: (string|null); - - /** Snapshot topic */ - topic?: (string|null); - - /** Snapshot expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Snapshot labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a Snapshot. */ - class Snapshot implements ISnapshot { - - /** - * Constructs a new Snapshot. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ISnapshot); - - /** Snapshot name. */ - public name: string; - - /** Snapshot topic. */ - public topic: string; - - /** Snapshot expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Snapshot labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new Snapshot instance using the specified properties. - * @param [properties] Properties to set - * @returns Snapshot instance - */ - public static create(properties?: google.pubsub.v1.ISnapshot): google.pubsub.v1.Snapshot; - - /** - * Encodes the specified Snapshot message. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. - * @param message Snapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. - * @param message Snapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Snapshot message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Snapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.Snapshot; - - /** - * Decodes a Snapshot message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Snapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.Snapshot; - - /** - * Verifies a Snapshot message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Snapshot - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Snapshot; - - /** - * Creates a plain object from a Snapshot message. Also converts values to other types if specified. - * @param message Snapshot - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.Snapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Snapshot to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GetSnapshotRequest. */ - interface IGetSnapshotRequest { - - /** GetSnapshotRequest snapshot */ - snapshot?: (string|null); - } - - /** Represents a GetSnapshotRequest. */ - class GetSnapshotRequest implements IGetSnapshotRequest { - - /** - * Constructs a new GetSnapshotRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IGetSnapshotRequest); - - /** GetSnapshotRequest snapshot. */ - public snapshot: string; - - /** - * Creates a new GetSnapshotRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetSnapshotRequest instance - */ - public static create(properties?: google.pubsub.v1.IGetSnapshotRequest): google.pubsub.v1.GetSnapshotRequest; - - /** - * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. - * @param message GetSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. - * @param message GetSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetSnapshotRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.GetSnapshotRequest; - - /** - * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.GetSnapshotRequest; - - /** - * Verifies a GetSnapshotRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetSnapshotRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetSnapshotRequest; - - /** - * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. - * @param message GetSnapshotRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.GetSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetSnapshotRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListSnapshotsRequest. */ - interface IListSnapshotsRequest { - - /** ListSnapshotsRequest project */ - project?: (string|null); - - /** ListSnapshotsRequest pageSize */ - pageSize?: (number|null); - - /** ListSnapshotsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListSnapshotsRequest. */ - class ListSnapshotsRequest implements IListSnapshotsRequest { - - /** - * Constructs a new ListSnapshotsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListSnapshotsRequest); - - /** ListSnapshotsRequest project. */ - public project: string; - - /** ListSnapshotsRequest pageSize. */ - public pageSize: number; - - /** ListSnapshotsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListSnapshotsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSnapshotsRequest instance - */ - public static create(properties?: google.pubsub.v1.IListSnapshotsRequest): google.pubsub.v1.ListSnapshotsRequest; - - /** - * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. - * @param message ListSnapshotsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. - * @param message ListSnapshotsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSnapshotsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSnapshotsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSnapshotsRequest; - - /** - * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSnapshotsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSnapshotsRequest; - - /** - * Verifies a ListSnapshotsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSnapshotsRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSnapshotsRequest; - - /** - * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. - * @param message ListSnapshotsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSnapshotsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListSnapshotsResponse. */ - interface IListSnapshotsResponse { - - /** ListSnapshotsResponse snapshots */ - snapshots?: (google.pubsub.v1.ISnapshot[]|null); - - /** ListSnapshotsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSnapshotsResponse. */ - class ListSnapshotsResponse implements IListSnapshotsResponse { - - /** - * Constructs a new ListSnapshotsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListSnapshotsResponse); - - /** ListSnapshotsResponse snapshots. */ - public snapshots: google.pubsub.v1.ISnapshot[]; - - /** ListSnapshotsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListSnapshotsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSnapshotsResponse instance - */ - public static create(properties?: google.pubsub.v1.IListSnapshotsResponse): google.pubsub.v1.ListSnapshotsResponse; - - /** - * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. - * @param message ListSnapshotsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. - * @param message ListSnapshotsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSnapshotsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSnapshotsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSnapshotsResponse; - - /** - * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSnapshotsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSnapshotsResponse; - - /** - * Verifies a ListSnapshotsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSnapshotsResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSnapshotsResponse; - - /** - * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. - * @param message ListSnapshotsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListSnapshotsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSnapshotsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DeleteSnapshotRequest. */ - interface IDeleteSnapshotRequest { - - /** DeleteSnapshotRequest snapshot */ - snapshot?: (string|null); - } - - /** Represents a DeleteSnapshotRequest. */ - class DeleteSnapshotRequest implements IDeleteSnapshotRequest { - - /** - * Constructs a new DeleteSnapshotRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IDeleteSnapshotRequest); - - /** DeleteSnapshotRequest snapshot. */ - public snapshot: string; - - /** - * Creates a new DeleteSnapshotRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteSnapshotRequest instance - */ - public static create(properties?: google.pubsub.v1.IDeleteSnapshotRequest): google.pubsub.v1.DeleteSnapshotRequest; - - /** - * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. - * @param message DeleteSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. - * @param message DeleteSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DeleteSnapshotRequest; - - /** - * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DeleteSnapshotRequest; - - /** - * Verifies a DeleteSnapshotRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteSnapshotRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSnapshotRequest; - - /** - * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. - * @param message DeleteSnapshotRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.DeleteSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteSnapshotRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SeekRequest. */ - interface ISeekRequest { - - /** SeekRequest subscription */ - subscription?: (string|null); - - /** SeekRequest time */ - time?: (google.protobuf.ITimestamp|null); - - /** SeekRequest snapshot */ - snapshot?: (string|null); - } - - /** Represents a SeekRequest. */ - class SeekRequest implements ISeekRequest { - - /** - * Constructs a new SeekRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ISeekRequest); - - /** SeekRequest subscription. */ - public subscription: string; - - /** SeekRequest time. */ - public time?: (google.protobuf.ITimestamp|null); - - /** SeekRequest snapshot. */ - public snapshot: string; - - /** SeekRequest target. */ - public target?: ("time"|"snapshot"); - - /** - * Creates a new SeekRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SeekRequest instance - */ - public static create(properties?: google.pubsub.v1.ISeekRequest): google.pubsub.v1.SeekRequest; - - /** - * Encodes the specified SeekRequest message. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. - * @param message SeekRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ISeekRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SeekRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. - * @param message SeekRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ISeekRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SeekRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SeekRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.SeekRequest; - - /** - * Decodes a SeekRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SeekRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.SeekRequest; - - /** - * Verifies a SeekRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SeekRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SeekRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.SeekRequest; - - /** - * Creates a plain object from a SeekRequest message. Also converts values to other types if specified. - * @param message SeekRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.SeekRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SeekRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SeekResponse. */ - interface ISeekResponse { - } - - /** Represents a SeekResponse. */ - class SeekResponse implements ISeekResponse { - - /** - * Constructs a new SeekResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ISeekResponse); - - /** - * Creates a new SeekResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SeekResponse instance - */ - public static create(properties?: google.pubsub.v1.ISeekResponse): google.pubsub.v1.SeekResponse; - - /** - * Encodes the specified SeekResponse message. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. - * @param message SeekResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ISeekResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SeekResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. - * @param message SeekResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ISeekResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SeekResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SeekResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.SeekResponse; - - /** - * Decodes a SeekResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SeekResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.SeekResponse; - - /** - * Verifies a SeekResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SeekResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SeekResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.SeekResponse; - - /** - * Creates a plain object from a SeekResponse message. Also converts values to other types if specified. - * @param message SeekResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.SeekResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SeekResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace api. */ - namespace api { - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; - - /** - * Creates a new Http instance using the specified properties. - * @param [properties] Properties to set - * @returns Http instance - */ - public static create(properties?: google.api.IHttp): google.api.Http; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; - - /** - * Verifies a Http message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** 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; - - /** HttpRule put. */ - public put: string; - - /** HttpRule post. */ - public post: string; - - /** HttpRule delete. */ - public delete: string; - - /** HttpRule patch. */ - public patch: string; - - /** 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 }; - } - - /** 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 }; - } - } - - /** 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 }; - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** 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); - } - - /** 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 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; - - /** - * 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 }; - } - - /** 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); - } - - /** 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[]; - - /** - * 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 }; - } - - 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 }; - } - - /** 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 }; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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[]; - - /** - * 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 }; - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (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); - } - - /** 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; - - /** FieldDescriptorProto type. */ - public type: 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); - - /** - * 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 }; - } - - 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_REQUIRED = 2, - LABEL_REPEATED = 3 - } - } - - /** 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 }; - } - - /** 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); - } - - /** 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[]; - - /** - * 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 }; - } - - 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 }; - } - } - - /** 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 }; - } - - /** 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 }; - } - - /** 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 }; - } - - /** 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|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions phpGenericServices */ - phpGenericServices?: (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 uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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; - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions phpGenericServices. */ - public phpGenericServices: 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 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 }; - } - - 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 uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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 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 }; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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; - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: google.protobuf.FieldOptions.JSType; - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** 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 }; - } - - 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 - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** 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 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 }; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|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 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 }; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|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 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 }; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** 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); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** 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 }; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|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); - } - - /** 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; - - /** 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 }; - } - - 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|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|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); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: Uint8Array; - - /** 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 }; - } - - 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 }; - } - } - - /** 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 }; - } - - 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 }; - } - } - - /** 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 }; - } - - 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); - } - - /** 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; - - /** - * 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 }; - } - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|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); - - /** 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 }; - } - - /** 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 }; - } - - /** 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 }; - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|Long|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); - - /** 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 }; - } - } - - /** Namespace iam. */ - namespace iam { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a IAMPolicy */ - class IAMPolicy extends $protobuf.rpc.Service { - - /** - * Constructs a new IAMPolicy service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new IAMPolicy service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): IAMPolicy; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - } - - namespace IAMPolicy { - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy#setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy#getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy#testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - } - - /** Properties of a SetIamPolicyRequest. */ - interface ISetIamPolicyRequest { - - /** SetIamPolicyRequest resource */ - resource?: (string|null); - - /** SetIamPolicyRequest policy */ - policy?: (google.iam.v1.IPolicy|null); - } - - /** Represents a SetIamPolicyRequest. */ - class SetIamPolicyRequest implements ISetIamPolicyRequest { - - /** - * Constructs a new SetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ISetIamPolicyRequest); - - /** SetIamPolicyRequest resource. */ - public resource: string; - - /** SetIamPolicyRequest policy. */ - public policy?: (google.iam.v1.IPolicy|null); - - /** - * Creates a new SetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; - - /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; - - /** - * Verifies a SetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; - - /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. - * @param message SetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GetIamPolicyRequest. */ - interface IGetIamPolicyRequest { - - /** GetIamPolicyRequest resource */ - resource?: (string|null); - - /** GetIamPolicyRequest options */ - options?: (google.iam.v1.IGetPolicyOptions|null); - } - - /** Represents a GetIamPolicyRequest. */ - class GetIamPolicyRequest implements IGetIamPolicyRequest { - - /** - * Constructs a new GetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IGetIamPolicyRequest); - - /** GetIamPolicyRequest resource. */ - public resource: string; - - /** GetIamPolicyRequest options. */ - public options?: (google.iam.v1.IGetPolicyOptions|null); - - /** - * Creates a new GetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; - - /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; - - /** - * Verifies a GetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; - - /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. - * @param message GetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a TestIamPermissionsRequest. */ - interface ITestIamPermissionsRequest { - - /** TestIamPermissionsRequest resource */ - resource?: (string|null); - - /** TestIamPermissionsRequest permissions */ - permissions?: (string[]|null); - } - - /** Represents a TestIamPermissionsRequest. */ - class TestIamPermissionsRequest implements ITestIamPermissionsRequest { - - /** - * Constructs a new TestIamPermissionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); - - /** TestIamPermissionsRequest resource. */ - public resource: string; - - /** TestIamPermissionsRequest permissions. */ - public permissions: string[]; - - /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsRequest instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; - - /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; - - /** - * Verifies a TestIamPermissionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; - - /** - * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. - * @param message TestIamPermissionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestIamPermissionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a TestIamPermissionsResponse. */ - interface ITestIamPermissionsResponse { - - /** TestIamPermissionsResponse permissions */ - permissions?: (string[]|null); - } - - /** Represents a TestIamPermissionsResponse. */ - class TestIamPermissionsResponse implements ITestIamPermissionsResponse { - - /** - * Constructs a new TestIamPermissionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); - - /** TestIamPermissionsResponse permissions. */ - public permissions: string[]; - - /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsResponse instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; - - /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; - - /** - * Verifies a TestIamPermissionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; - - /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. - * @param message TestIamPermissionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestIamPermissionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GetPolicyOptions. */ - interface IGetPolicyOptions { - - /** GetPolicyOptions requestedPolicyVersion */ - requestedPolicyVersion?: (number|null); - } - - /** Represents a GetPolicyOptions. */ - class GetPolicyOptions implements IGetPolicyOptions { - - /** - * Constructs a new GetPolicyOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IGetPolicyOptions); - - /** GetPolicyOptions requestedPolicyVersion. */ - public requestedPolicyVersion: number; - - /** - * Creates a new GetPolicyOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns GetPolicyOptions instance - */ - public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; - - /** - * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; - - /** - * Verifies a GetPolicyOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetPolicyOptions - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; - - /** - * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. - * @param message GetPolicyOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetPolicyOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Policy. */ - interface IPolicy { - - /** Policy version */ - version?: (number|null); - - /** Policy bindings */ - bindings?: (google.iam.v1.IBinding[]|null); - - /** Policy etag */ - etag?: (Uint8Array|null); - } - - /** Represents a Policy. */ - class Policy implements IPolicy { - - /** - * Constructs a new Policy. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicy); - - /** Policy version. */ - public version: number; - - /** Policy bindings. */ - public bindings: google.iam.v1.IBinding[]; - - /** Policy etag. */ - public etag: Uint8Array; - - /** - * Creates a new Policy instance using the specified properties. - * @param [properties] Properties to set - * @returns Policy instance - */ - public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; - - /** - * Verifies a Policy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Policy - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @param message Policy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Policy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Binding. */ - interface IBinding { - - /** Binding role */ - role?: (string|null); - - /** Binding members */ - members?: (string[]|null); - - /** Binding condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a Binding. */ - class Binding implements IBinding { - - /** - * Constructs a new Binding. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBinding); - - /** Binding role. */ - public role: string; - - /** Binding members. */ - public members: string[]; - - /** Binding condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new Binding instance using the specified properties. - * @param [properties] Properties to set - * @returns Binding instance - */ - public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Binding message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; - - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; - - /** - * Verifies a Binding message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Binding - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; - - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @param message Binding - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Binding to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PolicyDelta. */ - interface IPolicyDelta { - - /** PolicyDelta bindingDeltas */ - bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); - - /** PolicyDelta auditConfigDeltas */ - auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); - } - - /** Represents a PolicyDelta. */ - class PolicyDelta implements IPolicyDelta { - - /** - * Constructs a new PolicyDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicyDelta); - - /** PolicyDelta bindingDeltas. */ - public bindingDeltas: google.iam.v1.IBindingDelta[]; - - /** PolicyDelta auditConfigDeltas. */ - public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; - - /** - * Creates a new PolicyDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns PolicyDelta instance - */ - public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; - - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; - - /** - * Verifies a PolicyDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PolicyDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; - - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @param message PolicyDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PolicyDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BindingDelta. */ - interface IBindingDelta { - - /** BindingDelta action */ - action?: (google.iam.v1.BindingDelta.Action|null); - - /** BindingDelta role */ - role?: (string|null); - - /** BindingDelta member */ - member?: (string|null); - - /** BindingDelta condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a BindingDelta. */ - class BindingDelta implements IBindingDelta { - - /** - * Constructs a new BindingDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBindingDelta); - - /** BindingDelta action. */ - public action: google.iam.v1.BindingDelta.Action; - - /** BindingDelta role. */ - public role: string; - - /** BindingDelta member. */ - public member: string; - - /** BindingDelta condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new BindingDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns BindingDelta instance - */ - public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; - - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; - - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; - - /** - * Verifies a BindingDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BindingDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; - - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @param message BindingDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BindingDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace BindingDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - - /** Properties of an AuditConfigDelta. */ - interface IAuditConfigDelta { - - /** AuditConfigDelta action */ - action?: (google.iam.v1.AuditConfigDelta.Action|null); - - /** AuditConfigDelta service */ - service?: (string|null); - - /** AuditConfigDelta exemptedMember */ - exemptedMember?: (string|null); - - /** AuditConfigDelta logType */ - logType?: (string|null); - } - - /** Represents an AuditConfigDelta. */ - class AuditConfigDelta implements IAuditConfigDelta { - - /** - * Constructs a new AuditConfigDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditConfigDelta); - - /** AuditConfigDelta action. */ - public action: google.iam.v1.AuditConfigDelta.Action; - - /** AuditConfigDelta service. */ - public service: string; - - /** AuditConfigDelta exemptedMember. */ - public exemptedMember: string; - - /** AuditConfigDelta logType. */ - public logType: string; - - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditConfigDelta instance - */ - public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; - - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; - - /** - * Verifies an AuditConfigDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditConfigDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; - - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @param message AuditConfigDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditConfigDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace AuditConfigDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - } - } - - /** 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 }; - } - } -} diff --git a/protos/google/cloud/common_resources.proto b/protos/google/cloud/common_resources.proto new file mode 100644 index 000000000..56c9f800d --- /dev/null +++ b/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/protos/google/iam/admin/v1/iam.proto b/protos/google/iam/admin/v1/iam.proto deleted file mode 100644 index 2e2fe2b72..000000000 --- a/protos/google/iam/admin/v1/iam.proto +++ /dev/null @@ -1,469 +0,0 @@ -// Copyright 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.iam.admin.v1; - -import "google/api/annotations.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/iam/admin/v1;admin"; -option java_multiple_files = true; -option java_outer_classname = "IamProto"; -option java_package = "com.google.iam.admin.v1"; - - -// Creates and manages service account objects. -// -// Service account is an account that belongs to your project instead -// of to an individual end user. It is used to authenticate calls -// to a Google API. -// -// To create a service account, specify the `project_id` and `account_id` -// for the account. The `account_id` is unique within the project, and used -// to generate the service account email address and a stable -// `unique_id`. -// -// All other methods can identify accounts using the format -// `projects/{project}/serviceAccounts/{account}`. -// Using `-` as a wildcard for the project will infer the project from -// the account. The `account` value can be the `email` address or the -// `unique_id` of the service account. -service IAM { - // Lists [ServiceAccounts][google.iam.admin.v1.ServiceAccount] for a project. - rpc ListServiceAccounts(ListServiceAccountsRequest) returns (ListServiceAccountsResponse) { - option (google.api.http) = { get: "/v1/{name=projects/*}/serviceAccounts" }; - } - - // Gets a [ServiceAccount][google.iam.admin.v1.ServiceAccount]. - rpc GetServiceAccount(GetServiceAccountRequest) returns (ServiceAccount) { - option (google.api.http) = { get: "/v1/{name=projects/*/serviceAccounts/*}" }; - } - - // Creates a [ServiceAccount][google.iam.admin.v1.ServiceAccount] - // and returns it. - rpc CreateServiceAccount(CreateServiceAccountRequest) returns (ServiceAccount) { - option (google.api.http) = { post: "/v1/{name=projects/*}/serviceAccounts" body: "*" }; - } - - // Updates a [ServiceAccount][google.iam.admin.v1.ServiceAccount]. - // - // Currently, only the following fields are updatable: - // `display_name` . - // The `etag` is mandatory. - rpc UpdateServiceAccount(ServiceAccount) returns (ServiceAccount) { - option (google.api.http) = { put: "/v1/{name=projects/*/serviceAccounts/*}" body: "*" }; - } - - // Deletes a [ServiceAccount][google.iam.admin.v1.ServiceAccount]. - rpc DeleteServiceAccount(DeleteServiceAccountRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { delete: "/v1/{name=projects/*/serviceAccounts/*}" }; - } - - // Lists [ServiceAccountKeys][google.iam.admin.v1.ServiceAccountKey]. - rpc ListServiceAccountKeys(ListServiceAccountKeysRequest) returns (ListServiceAccountKeysResponse) { - option (google.api.http) = { get: "/v1/{name=projects/*/serviceAccounts/*}/keys" }; - } - - // Gets the [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey] - // by key id. - rpc GetServiceAccountKey(GetServiceAccountKeyRequest) returns (ServiceAccountKey) { - option (google.api.http) = { get: "/v1/{name=projects/*/serviceAccounts/*/keys/*}" }; - } - - // Creates a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey] - // and returns it. - rpc CreateServiceAccountKey(CreateServiceAccountKeyRequest) returns (ServiceAccountKey) { - option (google.api.http) = { post: "/v1/{name=projects/*/serviceAccounts/*}/keys" body: "*" }; - } - - // Deletes a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey]. - rpc DeleteServiceAccountKey(DeleteServiceAccountKeyRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { delete: "/v1/{name=projects/*/serviceAccounts/*/keys/*}" }; - } - - // Signs a blob using a service account's system-managed private key. - rpc SignBlob(SignBlobRequest) returns (SignBlobResponse) { - option (google.api.http) = { post: "/v1/{name=projects/*/serviceAccounts/*}:signBlob" body: "*" }; - } - - // Returns the IAM access control policy for a - // [ServiceAccount][google.iam.admin.v1.ServiceAccount]. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.http) = { post: "/v1/{resource=projects/*/serviceAccounts/*}:getIamPolicy" body: "" }; - } - - // Sets the IAM access control policy for a - // [ServiceAccount][google.iam.admin.v1.ServiceAccount]. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.http) = { post: "/v1/{resource=projects/*/serviceAccounts/*}:setIamPolicy" body: "*" }; - } - - // Tests the specified permissions against the IAM access control policy - // for a [ServiceAccount][google.iam.admin.v1.ServiceAccount]. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { post: "/v1/{resource=projects/*/serviceAccounts/*}:testIamPermissions" body: "*" }; - } - - // Queries roles that can be granted on a particular resource. - // A role is grantable if it can be used as the role in a binding for a policy - // for that resource. - rpc QueryGrantableRoles(QueryGrantableRolesRequest) returns (QueryGrantableRolesResponse) { - option (google.api.http) = { post: "/v1/roles:queryGrantableRoles" body: "*" }; - } -} - -// A service account in the Identity and Access Management API. -// -// To create a service account, specify the `project_id` and the `account_id` -// for the account. The `account_id` is unique within the project, and is used -// to generate the service account email address and a stable -// `unique_id`. -// -// If the account already exists, the account's resource name is returned -// in util::Status's ResourceInfo.resource_name in the format of -// projects/{project}/serviceAccounts/{email}. The caller can use the name in -// other methods to access the account. -// -// All other methods can identify the service account using the format -// `projects/{project}/serviceAccounts/{account}`. -// Using `-` as a wildcard for the project will infer the project from -// the account. The `account` value can be the `email` address or the -// `unique_id` of the service account. -message ServiceAccount { - // The resource name of the service account in the following format: - // `projects/{project}/serviceAccounts/{account}`. - // - // Requests using `-` as a wildcard for the project will infer the project - // from the `account` and the `account` value can be the `email` address or - // the `unique_id` of the service account. - // - // In responses the resource name will always be in the format - // `projects/{project}/serviceAccounts/{email}`. - string name = 1; - - // @OutputOnly The id of the project that owns the service account. - string project_id = 2; - - // @OutputOnly The unique and stable id of the service account. - string unique_id = 4; - - // @OutputOnly The email address of the service account. - string email = 5; - - // Optional. A user-specified description of the service account. Must be - // fewer than 100 UTF-8 bytes. - string display_name = 6; - - // Used to perform a consistent read-modify-write. - bytes etag = 7; - - // @OutputOnly. The OAuth2 client id for the service account. - // This is used in conjunction with the OAuth2 clientconfig API to make - // three legged OAuth2 (3LO) flows to access the data of Google users. - string oauth2_client_id = 9; -} - -// The service account create request. -message CreateServiceAccountRequest { - // Required. The resource name of the project associated with the service - // accounts, such as `projects/my-project-123`. - string name = 1; - - // Required. The account id that is used to generate the service account - // email address and a stable unique id. It is unique within a project, - // must be 6-30 characters long, and match the regular expression - // `[a-z]([-a-z0-9]*[a-z0-9])` to comply with RFC1035. - string account_id = 2; - - // The [ServiceAccount][google.iam.admin.v1.ServiceAccount] resource to create. - // Currently, only the following values are user assignable: - // `display_name` . - ServiceAccount service_account = 3; -} - -// The service account list request. -message ListServiceAccountsRequest { - // Required. The resource name of the project associated with the service - // accounts, such as `projects/my-project-123`. - string name = 1; - - // Optional limit on the number of service accounts to include in the - // response. Further accounts can subsequently be obtained by including the - // [ListServiceAccountsResponse.next_page_token][google.iam.admin.v1.ListServiceAccountsResponse.next_page_token] - // in a subsequent request. - int32 page_size = 2; - - // Optional pagination token returned in an earlier - // [ListServiceAccountsResponse.next_page_token][google.iam.admin.v1.ListServiceAccountsResponse.next_page_token]. - string page_token = 3; -} - -// The service account list response. -message ListServiceAccountsResponse { - // The list of matching service accounts. - repeated ServiceAccount accounts = 1; - - // To retrieve the next page of results, set - // [ListServiceAccountsRequest.page_token][google.iam.admin.v1.ListServiceAccountsRequest.page_token] - // to this value. - string next_page_token = 2; -} - -// The service account get request. -message GetServiceAccountRequest { - // The resource name of the service account in the following format: - // `projects/{project}/serviceAccounts/{account}`. - // Using `-` as a wildcard for the project will infer the project from - // the account. The `account` value can be the `email` address or the - // `unique_id` of the service account. - string name = 1; -} - -// The service account delete request. -message DeleteServiceAccountRequest { - // The resource name of the service account in the following format: - // `projects/{project}/serviceAccounts/{account}`. - // Using `-` as a wildcard for the project will infer the project from - // the account. The `account` value can be the `email` address or the - // `unique_id` of the service account. - string name = 1; -} - -// The service account keys list request. -message ListServiceAccountKeysRequest { - // `KeyType` filters to selectively retrieve certain varieties - // of keys. - enum KeyType { - // Unspecified key type. The presence of this in the - // message will immediately result in an error. - KEY_TYPE_UNSPECIFIED = 0; - - // User-managed keys (managed and rotated by the user). - USER_MANAGED = 1; - - // System-managed keys (managed and rotated by Google). - SYSTEM_MANAGED = 2; - } - - // The resource name of the service account in the following format: - // `projects/{project}/serviceAccounts/{account}`. - // - // Using `-` as a wildcard for the project, will infer the project from - // the account. The `account` value can be the `email` address or the - // `unique_id` of the service account. - string name = 1; - - // Filters the types of keys the user wants to include in the list - // response. Duplicate key types are not allowed. If no key type - // is provided, all keys are returned. - repeated KeyType key_types = 2; -} - -// The service account keys list response. -message ListServiceAccountKeysResponse { - // The public keys for the service account. - repeated ServiceAccountKey keys = 1; -} - -// The service account key get by id request. -message GetServiceAccountKeyRequest { - // The resource name of the service account key in the following format: - // `projects/{project}/serviceAccounts/{account}/keys/{key}`. - // - // Using `-` as a wildcard for the project will infer the project from - // the account. The `account` value can be the `email` address or the - // `unique_id` of the service account. - string name = 1; - - // The output format of the public key requested. - // X509_PEM is the default output format. - ServiceAccountPublicKeyType public_key_type = 2; -} - -// Represents a service account key. -// -// A service account has two sets of key-pairs: user-managed, and -// system-managed. -// -// User-managed key-pairs can be created and deleted by users. Users are -// responsible for rotating these keys periodically to ensure security of -// their service accounts. Users retain the private key of these key-pairs, -// and Google retains ONLY the public key. -// -// System-managed key-pairs are managed automatically by Google, and rotated -// daily without user intervention. The private key never leaves Google's -// servers to maximize security. -// -// Public keys for all service accounts are also published at the OAuth2 -// Service Account API. -message ServiceAccountKey { - // The resource name of the service account key in the following format - // `projects/{project}/serviceAccounts/{account}/keys/{key}`. - string name = 1; - - // The output format for the private key. - // Only provided in `CreateServiceAccountKey` responses, not - // in `GetServiceAccountKey` or `ListServiceAccountKey` responses. - // - // Google never exposes system-managed private keys, and never retains - // user-managed private keys. - ServiceAccountPrivateKeyType private_key_type = 2; - - // Specifies the algorithm (and possibly key size) for the key. - ServiceAccountKeyAlgorithm key_algorithm = 8; - - // The private key data. Only provided in `CreateServiceAccountKey` - // responses. - bytes private_key_data = 3; - - // The public key data. Only provided in `GetServiceAccountKey` responses. - bytes public_key_data = 7; - - // The key can be used after this timestamp. - google.protobuf.Timestamp valid_after_time = 4; - - // The key can be used before this timestamp. - google.protobuf.Timestamp valid_before_time = 5; -} - -// The service account key create request. -message CreateServiceAccountKeyRequest { - // The resource name of the service account in the following format: - // `projects/{project}/serviceAccounts/{account}`. - // Using `-` as a wildcard for the project will infer the project from - // the account. The `account` value can be the `email` address or the - // `unique_id` of the service account. - string name = 1; - - // The output format of the private key. `GOOGLE_CREDENTIALS_FILE` is the - // default output format. - ServiceAccountPrivateKeyType private_key_type = 2; - - // Which type of key and algorithm to use for the key. - // The default is currently a 4K RSA key. However this may change in the - // future. - ServiceAccountKeyAlgorithm key_algorithm = 3; -} - -// The service account key delete request. -message DeleteServiceAccountKeyRequest { - // The resource name of the service account key in the following format: - // `projects/{project}/serviceAccounts/{account}/keys/{key}`. - // Using `-` as a wildcard for the project will infer the project from - // the account. The `account` value can be the `email` address or the - // `unique_id` of the service account. - string name = 1; -} - -// The service account sign blob request. -message SignBlobRequest { - // The resource name of the service account in the following format: - // `projects/{project}/serviceAccounts/{account}`. - // Using `-` as a wildcard for the project will infer the project from - // the account. The `account` value can be the `email` address or the - // `unique_id` of the service account. - string name = 1; - - // The bytes to sign. - bytes bytes_to_sign = 2; -} - -// The service account sign blob response. -message SignBlobResponse { - // The id of the key used to sign the blob. - string key_id = 1; - - // The signed blob. - bytes signature = 2; -} - -// A role in the Identity and Access Management API. -message Role { - // The name of the role. - // - // When Role is used in CreateRole, the role name must not be set. - // - // When Role is used in output and other input such as UpdateRole, the role - // name is the complete path, e.g., roles/logging.viewer for curated roles - // and organizations/{organization-id}/roles/logging.viewer for custom roles. - string name = 1; - - // Optional. A human-readable title for the role. Typically this - // is limited to 100 UTF-8 bytes. - string title = 2; - - // Optional. A human-readable description for the role. - string description = 3; -} - -// The grantable role query request. -message QueryGrantableRolesRequest { - // Required. The full resource name to query from the list of grantable roles. - // - // The name follows the Google Cloud Platform resource format. - // For example, a Cloud Platform project with id `my-project` will be named - // `//cloudresourcemanager.googleapis.com/projects/my-project`. - string full_resource_name = 1; -} - -// The grantable role query response. -message QueryGrantableRolesResponse { - // The list of matching roles. - repeated Role roles = 1; -} - -// Supported key algorithms. -enum ServiceAccountKeyAlgorithm { - // An unspecified key algorithm. - KEY_ALG_UNSPECIFIED = 0; - - // 1k RSA Key. - KEY_ALG_RSA_1024 = 1; - - // 2k RSA Key. - KEY_ALG_RSA_2048 = 2; -} - -// Supported private key output formats. -enum ServiceAccountPrivateKeyType { - // Unspecified. Equivalent to `TYPE_GOOGLE_CREDENTIALS_FILE`. - TYPE_UNSPECIFIED = 0; - - // PKCS12 format. - // The password for the PKCS12 file is `notasecret`. - // For more information, see https://tools.ietf.org/html/rfc7292. - TYPE_PKCS12_FILE = 1; - - // Google Credentials File format. - TYPE_GOOGLE_CREDENTIALS_FILE = 2; -} - -// Supported public key output formats. -enum ServiceAccountPublicKeyType { - // Unspecified. Returns nothing here. - TYPE_NONE = 0; - - // X509 PEM format. - TYPE_X509_PEM_FILE = 1; - - // Raw public key. - TYPE_RAW_PUBLIC_KEY = 2; -} diff --git a/protos/google/iam/v1/iam_policy.proto b/protos/google/iam/v1/iam_policy.proto index 8825cdc7f..7072854e4 100644 --- a/protos/google/iam/v1/iam_policy.proto +++ b/protos/google/iam/v1/iam_policy.proto @@ -21,6 +21,8 @@ import "google/iam/v1/options.proto"; import "google/iam/v1/policy.proto"; import "google/api/annotations.proto"; import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Iam.V1"; @@ -96,37 +98,43 @@ service IAMPolicy { message SetIamPolicyRequest { // REQUIRED: The resource for which the policy is being specified. // See the operation documentation for the appropriate value for this field. - string resource = 1; + string resource = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "*"]; // REQUIRED: The complete policy to be applied to the `resource`. The size of // the policy is limited to a few 10s of KB. An empty policy is a // valid policy but certain Cloud Platform services (such as Projects) // might reject them. - Policy policy = 2; + Policy policy = 2 [(google.api.field_behavior) = REQUIRED]; } // Request message for `GetIamPolicy` method. message GetIamPolicyRequest { // REQUIRED: The resource for which the policy is being requested. // See the operation documentation for the appropriate value for this field. - string resource = 1; + string resource = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "*"]; // OPTIONAL: A `GetPolicyOptions` object for specifying options to // `GetIamPolicy`. This field is only used by Cloud IAM. - google.iam.v1.GetPolicyOptions options = 2; + GetPolicyOptions options = 2; } // Request message for `TestIamPermissions` method. message TestIamPermissionsRequest { // REQUIRED: The resource for which the policy detail is being requested. // See the operation documentation for the appropriate value for this field. - string resource = 1; + string resource = 1[ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "*"]; // The set of permissions to check for the `resource`. Permissions with // wildcards (such as '*' or 'storage.*') are not allowed. For more // information see // [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - repeated string permissions = 2; + repeated string permissions = 2 [(google.api.field_behavior) = REQUIRED]; } // Response message for `TestIamPermissions` method. diff --git a/protos/google/iam/v1/logging/audit_data.proto b/protos/google/iam/v1/logging/audit_data.proto new file mode 100644 index 000000000..dfe441ba6 --- /dev/null +++ b/protos/google/iam/v1/logging/audit_data.proto @@ -0,0 +1,34 @@ +// Copyright 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.iam.v1.logging; + +import "google/api/annotations.proto"; +import "google/iam/v1/policy.proto"; + +option csharp_namespace = "Google.Cloud.Iam.V1.Logging"; +option go_package = "google.golang.org/genproto/googleapis/iam/v1/logging;logging"; +option java_multiple_files = true; +option java_outer_classname = "AuditDataProto"; +option java_package = "com.google.iam.v1.logging"; + +// Audit log information specific to Cloud IAM. This message is serialized +// as an `Any` type in the `ServiceData` message of an +// `AuditLog` message. +message AuditData { + // Policy delta between the original policy and the newly set policy. + google.iam.v1.PolicyDelta policy_delta = 2; +} diff --git a/protos/google/iam/v1/options.proto b/protos/google/iam/v1/options.proto index 24e886366..a4e17e588 100644 --- a/protos/google/iam/v1/options.proto +++ b/protos/google/iam/v1/options.proto @@ -30,8 +30,12 @@ option php_namespace = "Google\\Cloud\\Iam\\V1"; // Encapsulates settings provided to GetIamPolicy. message GetPolicyOptions { // Optional. The policy format version to be returned. - // Acceptable values are 0 and 1. - // If the value is 0, or the field is omitted, policy format version 1 will be - // returned. + // + // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + // rejected. + // + // Requests for policies with any conditional bindings must specify version 3. + // Policies without any conditional bindings may specify any valid value or + // leave the field unset. int32 requested_policy_version = 1; } diff --git a/protos/google/iam/v1/policy.proto b/protos/google/iam/v1/policy.proto index 4aef8aec4..e3aba47e8 100644 --- a/protos/google/iam/v1/policy.proto +++ b/protos/google/iam/v1/policy.proto @@ -32,27 +32,36 @@ option php_namespace = "Google\\Cloud\\Iam\\V1"; // specify access control policies for Cloud Platform resources. // // -// A `Policy` consists of a list of `bindings`. A `binding` binds a list of -// `members` to a `role`, where the members can be user accounts, Google groups, -// Google domains, and service accounts. A `role` is a named list of permissions -// defined by IAM. +// A `Policy` is a collection of `bindings`. A `binding` binds one or more +// `members` to a single `role`. Members can be user accounts, service accounts, +// Google groups, and domains (such as G Suite). A `role` is a named list of +// permissions (defined by IAM or configured by users). A `binding` can +// optionally specify a `condition`, which is a logic expression that further +// constrains the role binding based on attributes about the request and/or +// target resource. // // **JSON Example** // // { // "bindings": [ // { -// "role": "roles/owner", +// "role": "roles/resourcemanager.organizationAdmin", // "members": [ // "user:mike@example.com", // "group:admins@example.com", // "domain:google.com", -// "serviceAccount:my-other-app@appspot.gserviceaccount.com" +// "serviceAccount:my-project-id@appspot.gserviceaccount.com" // ] // }, // { -// "role": "roles/viewer", -// "members": ["user:sean@example.com"] +// "role": "roles/resourcemanager.organizationViewer", +// "members": ["user:eve@example.com"], +// "condition": { +// "title": "expirable access", +// "description": "Does not grant access after Sep 2020", +// "expression": "request.time < +// timestamp('2020-10-01T00:00:00.000Z')", +// } // } // ] // } @@ -64,20 +73,37 @@ option php_namespace = "Google\\Cloud\\Iam\\V1"; // - user:mike@example.com // - group:admins@example.com // - domain:google.com -// - serviceAccount:my-other-app@appspot.gserviceaccount.com -// role: roles/owner +// - serviceAccount:my-project-id@appspot.gserviceaccount.com +// role: roles/resourcemanager.organizationAdmin // - members: -// - user:sean@example.com -// role: roles/viewer -// +// - user:eve@example.com +// role: roles/resourcemanager.organizationViewer +// condition: +// title: expirable access +// description: Does not grant access after Sep 2020 +// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') // // For a description of IAM and its features, see the // [IAM developer's guide](https://cloud.google.com/iam/docs). message Policy { - // Deprecated. + // Specifies the format of the policy. + // + // Valid values are 0, 1, and 3. Requests specifying an invalid value will be + // rejected. + // + // Operations affecting conditional bindings must specify version 3. This can + // be either setting a conditional policy, modifying a conditional binding, + // or removing a binding (conditional or unconditional) from the stored + // conditional policy. + // Operations on non-conditional policies may specify any valid value or + // leave the field unset. + // + // If no etag is provided in the call to `setIamPolicy`, version compliance + // checks against the stored policy is skipped. int32 version = 1; - // Associates a list of `members` to a `role`. + // Associates a list of `members` to a `role`. Optionally may specify a + // `condition` that determines when binding is in effect. // `bindings` with no members will result in an error. repeated Binding bindings = 4; @@ -90,7 +116,9 @@ message Policy { // ensure that their change will be applied to the same version of the policy. // // If no `etag` is provided in the call to `setIamPolicy`, then the existing - // policy is overwritten. + // policy is overwritten. Due to blind-set semantics of an etag-less policy, + // 'setIamPolicy' will not fail even if the incoming policy version does not + // meet the requirements for modifying the stored policy. bytes etag = 3; } @@ -171,8 +199,7 @@ message BindingDelta { // Required string member = 3; - // The condition that is associated with this binding. This field is logged - // only for Cloud Audit Logging. + // The condition that is associated with this binding. google.type.Expr condition = 4; } diff --git a/protos/google/pubsub/v1/pubsub.proto b/protos/google/pubsub/v1/pubsub.proto index 55cfa531f..abcbcacc5 100644 --- a/protos/google/pubsub/v1/pubsub.proto +++ b/protos/google/pubsub/v1/pubsub.proto @@ -672,6 +672,15 @@ message Subscription { // value for `expiration_policy.ttl` is 1 day. ExpirationPolicy expiration_policy = 11; + // An expression written in the Cloud Pub/Sub filter language. If non-empty, + // then only `PubsubMessage`s whose `attributes` field matches the filter are + // delivered on this subscription. If empty, then no messages are filtered + // out. + // EXPERIMENTAL: This feature is part of a closed alpha release. This + // API might be changed in backward-incompatible ways and is not recommended + // for production use. It is not subject to any SLA or deprecation policy. + string filter = 12; + // A policy that specifies the conditions for dead lettering messages in // this subscription. If dead_letter_policy is not set, dead lettering // is disabled. @@ -684,6 +693,39 @@ message Subscription { // API might be changed in backward-incompatible ways and is not recommended // for production use. It is not subject to any SLA or deprecation policy. DeadLetterPolicy dead_letter_policy = 13; + + // A policy that specifies how Cloud Pub/Sub retries message delivery for this + // subscription. + // + // If not set, the default retry policy is applied. This generally implies + // that messages will be retried as soon as possible for healthy subscribers. + // RetryPolicy will be triggered on NACKs or acknowledgement deadline + // exceeded events for a given message. + // EXPERIMENTAL: This API might be changed in backward-incompatible + // ways and is not recommended for production use. It is not subject to any + // SLA or deprecation policy. + RetryPolicy retry_policy = 14; +} + +// A policy that specifies how Cloud Pub/Sub retries message delivery. +// +// Retry delay will be exponential based on provided minimum and maximum +// backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. +// +// RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded +// events for a given message. +// +// Retry Policy is implemented on a best effort basis. At times, the delay +// between consecutive deliveries may not match the configuration. That is, +// delay can be more or less than configured backoff. +message RetryPolicy { + // The minimum delay between consecutive deliveries of a given message. + // Value should be between 0 and 600 seconds. Defaults to 10 seconds. + google.protobuf.Duration minimum_backoff = 1; + + // The maximum delay between consecutive deliveries of a given message. + // Value should be between 0 and 600 seconds. Defaults to 600 seconds. + google.protobuf.Duration maximum_backoff = 2; } // Dead lettering is done on a best effort basis. The same message might be @@ -754,7 +796,7 @@ message PushConfig { } // A URL locating the endpoint to which messages should be pushed. - // For example, a Webhook endpoint might use "https://example.com/push". + // For example, a Webhook endpoint might use `https://example.com/push`. string push_endpoint = 1; // Endpoint configuration attributes that can be used to control different diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 374eae811..64b625903 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -17,9890 +17,9998 @@ import * as $protobuf from "protobufjs"; /** Namespace google. */ export namespace google { - /** Namespace pubsub. */ - namespace pubsub { + /** Namespace iam. */ + namespace iam { /** Namespace v1. */ namespace v1 { - /** Represents a Publisher */ - class Publisher extends $protobuf.rpc.Service { + /** Properties of a Policy. */ + interface IPolicy { - /** - * Constructs a new Publisher service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + /** Policy version */ + version?: (number|null); - /** - * Creates new Publisher 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): Publisher; + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); - /** - * Calls CreateTopic. - * @param request Topic message or plain object - * @param callback Node-style callback called with the error, if any, and Topic - */ - public createTopic(request: google.pubsub.v1.ITopic, callback: google.pubsub.v1.Publisher.CreateTopicCallback): void; + /** Policy etag */ + etag?: (Uint8Array|string|null); + } - /** - * Calls CreateTopic. - * @param request Topic message or plain object - * @returns Promise - */ - public createTopic(request: google.pubsub.v1.ITopic): Promise; + /** Represents a Policy. */ + class Policy implements IPolicy { /** - * Calls UpdateTopic. - * @param request UpdateTopicRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Topic + * Constructs a new Policy. + * @param [properties] Properties to set */ - public updateTopic(request: google.pubsub.v1.IUpdateTopicRequest, callback: google.pubsub.v1.Publisher.UpdateTopicCallback): void; + constructor(properties?: google.iam.v1.IPolicy); - /** - * Calls UpdateTopic. - * @param request UpdateTopicRequest message or plain object - * @returns Promise - */ - public updateTopic(request: google.pubsub.v1.IUpdateTopicRequest): Promise; + /** Policy version. */ + public version: number; - /** - * Calls Publish. - * @param request PublishRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PublishResponse - */ - public publish(request: google.pubsub.v1.IPublishRequest, callback: google.pubsub.v1.Publisher.PublishCallback): void; + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; - /** - * Calls Publish. - * @param request PublishRequest message or plain object - * @returns Promise - */ - public publish(request: google.pubsub.v1.IPublishRequest): Promise; + /** Policy etag. */ + public etag: (Uint8Array|string); /** - * Calls GetTopic. - * @param request GetTopicRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Topic + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance */ - public getTopic(request: google.pubsub.v1.IGetTopicRequest, callback: google.pubsub.v1.Publisher.GetTopicCallback): void; + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; /** - * Calls GetTopic. - * @param request GetTopicRequest message or plain object - * @returns Promise + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getTopic(request: google.pubsub.v1.IGetTopicRequest): Promise; + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListTopics. - * @param request ListTopicsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTopicsResponse + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listTopics(request: google.pubsub.v1.IListTopicsRequest, callback: google.pubsub.v1.Publisher.ListTopicsCallback): void; + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListTopics. - * @param request ListTopicsRequest message or plain object - * @returns Promise + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listTopics(request: google.pubsub.v1.IListTopicsRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; /** - * Calls ListTopicSubscriptions. - * @param request ListTopicSubscriptionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTopicSubscriptionsResponse + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listTopicSubscriptions(request: google.pubsub.v1.IListTopicSubscriptionsRequest, callback: google.pubsub.v1.Publisher.ListTopicSubscriptionsCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; /** - * Calls ListTopicSubscriptions. - * @param request ListTopicSubscriptionsRequest message or plain object - * @returns Promise + * Verifies a Policy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public listTopicSubscriptions(request: google.pubsub.v1.IListTopicSubscriptionsRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls ListTopicSnapshots. - * @param request ListTopicSnapshotsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTopicSnapshotsResponse + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy */ - public listTopicSnapshots(request: google.pubsub.v1.IListTopicSnapshotsRequest, callback: google.pubsub.v1.Publisher.ListTopicSnapshotsCallback): void; + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; /** - * Calls ListTopicSnapshots. - * @param request ListTopicSnapshotsRequest message or plain object - * @returns Promise + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object */ - public listTopicSnapshots(request: google.pubsub.v1.IListTopicSnapshotsRequest): Promise; + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls DeleteTopic. - * @param request DeleteTopicRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Converts this Policy to JSON. + * @returns JSON object */ - public deleteTopic(request: google.pubsub.v1.IDeleteTopicRequest, callback: google.pubsub.v1.Publisher.DeleteTopicCallback): void; + public toJSON(): { [k: string]: any }; + } - /** - * Calls DeleteTopic. - * @param request DeleteTopicRequest message or plain object - * @returns Promise - */ - public deleteTopic(request: google.pubsub.v1.IDeleteTopicRequest): Promise; + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); } - namespace Publisher { + /** Represents a Binding. */ + class Binding implements IBinding { /** - * Callback as used by {@link google.pubsub.v1.Publisher#createTopic}. - * @param error Error, if any - * @param [response] Topic + * Constructs a new Binding. + * @param [properties] Properties to set */ - type CreateTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); /** - * Callback as used by {@link google.pubsub.v1.Publisher#updateTopic}. - * @param error Error, if any - * @param [response] Topic + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance */ - type UpdateTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; /** - * Callback as used by {@link google.pubsub.v1.Publisher#publish}. - * @param error Error, if any - * @param [response] PublishResponse + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type PublishCallback = (error: (Error|null), response?: google.pubsub.v1.PublishResponse) => void; + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.pubsub.v1.Publisher#getTopic}. - * @param error Error, if any - * @param [response] Topic + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.pubsub.v1.Publisher#listTopics}. - * @param error Error, if any - * @param [response] ListTopicsResponse + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type ListTopicsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicsResponse) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; /** - * Callback as used by {@link google.pubsub.v1.Publisher#listTopicSubscriptions}. - * @param error Error, if any - * @param [response] ListTopicSubscriptionsResponse + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type ListTopicSubscriptionsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicSubscriptionsResponse) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; /** - * Callback as used by {@link google.pubsub.v1.Publisher#listTopicSnapshots}. - * @param error Error, if any - * @param [response] ListTopicSnapshotsResponse + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type ListTopicSnapshotsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicSnapshotsResponse) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.pubsub.v1.Publisher#deleteTopic}. - * @param error Error, if any - * @param [response] Empty + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding */ - type DeleteTopicCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - } + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; - /** Properties of a MessageStoragePolicy. */ - interface IMessageStoragePolicy { + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** MessageStoragePolicy allowedPersistenceRegions */ - allowedPersistenceRegions?: (string[]|null); + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } - /** Represents a MessageStoragePolicy. */ - class MessageStoragePolicy implements IMessageStoragePolicy { + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { /** - * Constructs a new MessageStoragePolicy. + * Constructs a new PolicyDelta. * @param [properties] Properties to set */ - constructor(properties?: google.pubsub.v1.IMessageStoragePolicy); + constructor(properties?: google.iam.v1.IPolicyDelta); - /** MessageStoragePolicy allowedPersistenceRegions. */ - public allowedPersistenceRegions: string[]; + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; /** - * Creates a new MessageStoragePolicy instance using the specified properties. + * Creates a new PolicyDelta instance using the specified properties. * @param [properties] Properties to set - * @returns MessageStoragePolicy instance + * @returns PolicyDelta instance */ - public static create(properties?: google.pubsub.v1.IMessageStoragePolicy): google.pubsub.v1.MessageStoragePolicy; + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; /** - * Encodes the specified MessageStoragePolicy message. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. - * @param message MessageStoragePolicy message or plain object to encode + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.pubsub.v1.IMessageStoragePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MessageStoragePolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. - * @param message MessageStoragePolicy message or plain object to encode + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.pubsub.v1.IMessageStoragePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MessageStoragePolicy message from the specified reader or buffer. + * Decodes a PolicyDelta message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MessageStoragePolicy + * @returns PolicyDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.MessageStoragePolicy; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; /** - * Decodes a MessageStoragePolicy message from the specified reader or buffer, length delimited. + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MessageStoragePolicy + * @returns PolicyDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.MessageStoragePolicy; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; /** - * Verifies a MessageStoragePolicy message. + * Verifies a PolicyDelta message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MessageStoragePolicy message from a plain object. Also converts values to their respective internal types. + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MessageStoragePolicy + * @returns PolicyDelta */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.MessageStoragePolicy; + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; /** - * Creates a plain object from a MessageStoragePolicy message. Also converts values to other types if specified. - * @param message MessageStoragePolicy + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.pubsub.v1.MessageStoragePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MessageStoragePolicy to JSON. + * Converts this PolicyDelta to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Topic. */ - interface ITopic { + /** Properties of a BindingDelta. */ + interface IBindingDelta { - /** Topic name */ - name?: (string|null); + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); - /** Topic labels */ - labels?: ({ [k: string]: string }|null); + /** BindingDelta role */ + role?: (string|null); - /** Topic messageStoragePolicy */ - messageStoragePolicy?: (google.pubsub.v1.IMessageStoragePolicy|null); + /** BindingDelta member */ + member?: (string|null); - /** Topic kmsKeyName */ - kmsKeyName?: (string|null); + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); } - /** Represents a Topic. */ - class Topic implements ITopic { + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { /** - * Constructs a new Topic. + * Constructs a new BindingDelta. * @param [properties] Properties to set */ - constructor(properties?: google.pubsub.v1.ITopic); + constructor(properties?: google.iam.v1.IBindingDelta); - /** Topic name. */ - public name: string; + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); - /** Topic labels. */ - public labels: { [k: string]: string }; + /** BindingDelta role. */ + public role: string; - /** Topic messageStoragePolicy. */ - public messageStoragePolicy?: (google.pubsub.v1.IMessageStoragePolicy|null); + /** BindingDelta member. */ + public member: string; - /** Topic kmsKeyName. */ - public kmsKeyName: string; + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); /** - * Creates a new Topic instance using the specified properties. + * Creates a new BindingDelta instance using the specified properties. * @param [properties] Properties to set - * @returns Topic instance + * @returns BindingDelta instance */ - public static create(properties?: google.pubsub.v1.ITopic): google.pubsub.v1.Topic; + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; /** - * Encodes the specified Topic message. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. - * @param message Topic message or plain object to encode + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.pubsub.v1.ITopic, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Topic message, length delimited. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. - * @param message Topic message or plain object to encode + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.pubsub.v1.ITopic, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Topic message from the specified reader or buffer. + * Decodes a BindingDelta message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Topic + * @returns BindingDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.Topic; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; /** - * Decodes a Topic message from the specified reader or buffer, length delimited. + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Topic + * @returns BindingDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.Topic; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; /** - * Verifies a Topic message. + * Verifies a BindingDelta message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Topic message from a plain object. Also converts values to their respective internal types. + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Topic + * @returns BindingDelta */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Topic; + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; /** - * Creates a plain object from a Topic message. Also converts values to other types if specified. - * @param message Topic + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.pubsub.v1.Topic, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Topic to JSON. + * Converts this BindingDelta to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PubsubMessage. */ - interface IPubsubMessage { + namespace BindingDelta { - /** PubsubMessage data */ - data?: (Uint8Array|string|null); + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } - /** PubsubMessage attributes */ - attributes?: ({ [k: string]: string }|null); + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { - /** PubsubMessage messageId */ - messageId?: (string|null); + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); - /** PubsubMessage publishTime */ - publishTime?: (google.protobuf.ITimestamp|null); + /** AuditConfigDelta service */ + service?: (string|null); - /** PubsubMessage orderingKey */ - orderingKey?: (string|null); + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); } - /** Represents a PubsubMessage. */ - class PubsubMessage implements IPubsubMessage { + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { /** - * Constructs a new PubsubMessage. + * Constructs a new AuditConfigDelta. * @param [properties] Properties to set */ - constructor(properties?: google.pubsub.v1.IPubsubMessage); - - /** PubsubMessage data. */ - public data: (Uint8Array|string); + constructor(properties?: google.iam.v1.IAuditConfigDelta); - /** PubsubMessage attributes. */ - public attributes: { [k: string]: string }; + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); - /** PubsubMessage messageId. */ - public messageId: string; + /** AuditConfigDelta service. */ + public service: string; - /** PubsubMessage publishTime. */ - public publishTime?: (google.protobuf.ITimestamp|null); + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; - /** PubsubMessage orderingKey. */ - public orderingKey: string; + /** AuditConfigDelta logType. */ + public logType: string; /** - * Creates a new PubsubMessage instance using the specified properties. + * Creates a new AuditConfigDelta instance using the specified properties. * @param [properties] Properties to set - * @returns PubsubMessage instance + * @returns AuditConfigDelta instance */ - public static create(properties?: google.pubsub.v1.IPubsubMessage): google.pubsub.v1.PubsubMessage; + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; /** - * Encodes the specified PubsubMessage message. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. - * @param message PubsubMessage message or plain object to encode + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.pubsub.v1.IPubsubMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PubsubMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. - * @param message PubsubMessage message or plain object to encode + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.pubsub.v1.IPubsubMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PubsubMessage message from the specified reader or buffer. + * Decodes an AuditConfigDelta message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PubsubMessage + * @returns AuditConfigDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PubsubMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; /** - * Decodes a PubsubMessage message from the specified reader or buffer, length delimited. + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PubsubMessage + * @returns AuditConfigDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PubsubMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; /** - * Verifies a PubsubMessage message. + * Verifies an AuditConfigDelta message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PubsubMessage message from a plain object. Also converts values to their respective internal types. + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PubsubMessage + * @returns AuditConfigDelta */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PubsubMessage; + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; /** - * Creates a plain object from a PubsubMessage message. Also converts values to other types if specified. - * @param message PubsubMessage + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.pubsub.v1.PubsubMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PubsubMessage to JSON. + * Converts this AuditConfigDelta to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetTopicRequest. */ - interface IGetTopicRequest { + namespace AuditConfigDelta { - /** GetTopicRequest topic */ - topic?: (string|null); + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } } - /** Represents a GetTopicRequest. */ - class GetTopicRequest implements IGetTopicRequest { + /** Properties of a GetPolicyOptions. */ + interface IGetPolicyOptions { + + /** GetPolicyOptions requestedPolicyVersion */ + requestedPolicyVersion?: (number|null); + } + + /** Represents a GetPolicyOptions. */ + class GetPolicyOptions implements IGetPolicyOptions { /** - * Constructs a new GetTopicRequest. + * Constructs a new GetPolicyOptions. * @param [properties] Properties to set */ - constructor(properties?: google.pubsub.v1.IGetTopicRequest); + constructor(properties?: google.iam.v1.IGetPolicyOptions); - /** GetTopicRequest topic. */ - public topic: string; + /** GetPolicyOptions requestedPolicyVersion. */ + public requestedPolicyVersion: number; /** - * Creates a new GetTopicRequest instance using the specified properties. + * Creates a new GetPolicyOptions instance using the specified properties. * @param [properties] Properties to set - * @returns GetTopicRequest instance + * @returns GetPolicyOptions instance */ - public static create(properties?: google.pubsub.v1.IGetTopicRequest): google.pubsub.v1.GetTopicRequest; + public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; /** - * Encodes the specified GetTopicRequest message. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. - * @param message GetTopicRequest message or plain object to encode + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.pubsub.v1.IGetTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. - * @param message GetTopicRequest message or plain object to encode + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.pubsub.v1.IGetTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetTopicRequest message from the specified reader or buffer. + * Decodes a GetPolicyOptions message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetTopicRequest + * @returns GetPolicyOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.GetTopicRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; /** - * Decodes a GetTopicRequest message from the specified reader or buffer, length delimited. + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetTopicRequest + * @returns GetPolicyOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.GetTopicRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; /** - * Verifies a GetTopicRequest message. + * Verifies a GetPolicyOptions message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetTopicRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetTopicRequest + * @returns GetPolicyOptions */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetTopicRequest; + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; /** - * Creates a plain object from a GetTopicRequest message. Also converts values to other types if specified. - * @param message GetTopicRequest + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @param message GetPolicyOptions * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.pubsub.v1.GetTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetTopicRequest to JSON. + * Converts this GetPolicyOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateTopicRequest. */ - interface IUpdateTopicRequest { - - /** UpdateTopicRequest topic */ - topic?: (google.pubsub.v1.ITopic|null); - - /** UpdateTopicRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateTopicRequest. */ - class UpdateTopicRequest implements IUpdateTopicRequest { + /** Represents a IAMPolicy */ + class IAMPolicy extends $protobuf.rpc.Service { /** - * Constructs a new UpdateTopicRequest. - * @param [properties] Properties to set + * Constructs a new IAMPolicy service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - constructor(properties?: google.pubsub.v1.IUpdateTopicRequest); - - /** UpdateTopicRequest topic. */ - public topic?: (google.pubsub.v1.ITopic|null); + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** UpdateTopicRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): IAMPolicy; /** - * Creates a new UpdateTopicRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateTopicRequest instance + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy */ - public static create(properties?: google.pubsub.v1.IUpdateTopicRequest): google.pubsub.v1.UpdateTopicRequest; + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; /** - * Encodes the specified UpdateTopicRequest message. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. - * @param message UpdateTopicRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise */ - public static encode(message: google.pubsub.v1.IUpdateTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; /** - * Encodes the specified UpdateTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. - * @param message UpdateTopicRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy */ - public static encodeDelimited(message: google.pubsub.v1.IUpdateTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; /** - * Decodes an UpdateTopicRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.UpdateTopicRequest; + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; /** - * Decodes an UpdateTopicRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.UpdateTopicRequest; + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; /** - * Verifies an UpdateTopicRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace IAMPolicy { /** - * Creates an UpdateTopicRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateTopicRequest + * Callback as used by {@link google.iam.v1.IAMPolicy#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateTopicRequest; + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; /** - * Creates a plain object from an UpdateTopicRequest message. Also converts values to other types if specified. - * @param message UpdateTopicRequest - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.iam.v1.IAMPolicy#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy */ - public static toObject(message: google.pubsub.v1.UpdateTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; /** - * Converts this UpdateTopicRequest to JSON. - * @returns JSON object + * Callback as used by {@link google.iam.v1.IAMPolicy#testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse */ - public toJSON(): { [k: string]: any }; + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; } - /** Properties of a PublishRequest. */ - interface IPublishRequest { + /** Properties of a SetIamPolicyRequest. */ + interface ISetIamPolicyRequest { - /** PublishRequest topic */ - topic?: (string|null); + /** SetIamPolicyRequest resource */ + resource?: (string|null); - /** PublishRequest messages */ - messages?: (google.pubsub.v1.IPubsubMessage[]|null); + /** SetIamPolicyRequest policy */ + policy?: (google.iam.v1.IPolicy|null); } - /** Represents a PublishRequest. */ - class PublishRequest implements IPublishRequest { + /** Represents a SetIamPolicyRequest. */ + class SetIamPolicyRequest implements ISetIamPolicyRequest { /** - * Constructs a new PublishRequest. + * Constructs a new SetIamPolicyRequest. * @param [properties] Properties to set */ - constructor(properties?: google.pubsub.v1.IPublishRequest); + constructor(properties?: google.iam.v1.ISetIamPolicyRequest); - /** PublishRequest topic. */ - public topic: string; + /** SetIamPolicyRequest resource. */ + public resource: string; - /** PublishRequest messages. */ - public messages: google.pubsub.v1.IPubsubMessage[]; + /** SetIamPolicyRequest policy. */ + public policy?: (google.iam.v1.IPolicy|null); /** - * Creates a new PublishRequest instance using the specified properties. + * Creates a new SetIamPolicyRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PublishRequest instance + * @returns SetIamPolicyRequest instance */ - public static create(properties?: google.pubsub.v1.IPublishRequest): google.pubsub.v1.PublishRequest; + public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; /** - * Encodes the specified PublishRequest message. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. - * @param message PublishRequest message or plain object to encode + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.pubsub.v1.IPublishRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PublishRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. - * @param message PublishRequest message or plain object to encode + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.pubsub.v1.IPublishRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PublishRequest message from the specified reader or buffer. + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PublishRequest + * @returns SetIamPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PublishRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; /** - * Decodes a PublishRequest message from the specified reader or buffer, length delimited. + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PublishRequest + * @returns SetIamPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PublishRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; /** - * Verifies a PublishRequest message. + * Verifies a SetIamPolicyRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PublishRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PublishRequest + * @returns SetIamPolicyRequest */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PublishRequest; + public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; /** - * Creates a plain object from a PublishRequest message. Also converts values to other types if specified. - * @param message PublishRequest + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.pubsub.v1.PublishRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PublishRequest to JSON. + * Converts this SetIamPolicyRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PublishResponse. */ - interface IPublishResponse { + /** Properties of a GetIamPolicyRequest. */ + interface IGetIamPolicyRequest { - /** PublishResponse messageIds */ - messageIds?: (string[]|null); + /** GetIamPolicyRequest resource */ + resource?: (string|null); + + /** GetIamPolicyRequest options */ + options?: (google.iam.v1.IGetPolicyOptions|null); } - /** Represents a PublishResponse. */ - class PublishResponse implements IPublishResponse { + /** Represents a GetIamPolicyRequest. */ + class GetIamPolicyRequest implements IGetIamPolicyRequest { /** - * Constructs a new PublishResponse. + * Constructs a new GetIamPolicyRequest. * @param [properties] Properties to set */ - constructor(properties?: google.pubsub.v1.IPublishResponse); + constructor(properties?: google.iam.v1.IGetIamPolicyRequest); - /** PublishResponse messageIds. */ - public messageIds: string[]; + /** GetIamPolicyRequest resource. */ + public resource: string; + + /** GetIamPolicyRequest options. */ + public options?: (google.iam.v1.IGetPolicyOptions|null); /** - * Creates a new PublishResponse instance using the specified properties. + * Creates a new GetIamPolicyRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PublishResponse instance + * @returns GetIamPolicyRequest instance */ - public static create(properties?: google.pubsub.v1.IPublishResponse): google.pubsub.v1.PublishResponse; + public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; /** - * Encodes the specified PublishResponse message. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. - * @param message PublishResponse message or plain object to encode + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.pubsub.v1.IPublishResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PublishResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. - * @param message PublishResponse message or plain object to encode + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.pubsub.v1.IPublishResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PublishResponse message from the specified reader or buffer. + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PublishResponse + * @returns GetIamPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PublishResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; /** - * Decodes a PublishResponse message from the specified reader or buffer, length delimited. + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PublishResponse + * @returns GetIamPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PublishResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; /** - * Verifies a PublishResponse message. + * Verifies a GetIamPolicyRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PublishResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PublishResponse + * @returns GetIamPolicyRequest */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PublishResponse; + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; /** - * Creates a plain object from a PublishResponse message. Also converts values to other types if specified. - * @param message PublishResponse + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.pubsub.v1.PublishResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PublishResponse to JSON. + * Converts this GetIamPolicyRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListTopicsRequest. */ - interface IListTopicsRequest { - - /** ListTopicsRequest project */ - project?: (string|null); + /** Properties of a TestIamPermissionsRequest. */ + interface ITestIamPermissionsRequest { - /** ListTopicsRequest pageSize */ - pageSize?: (number|null); + /** TestIamPermissionsRequest resource */ + resource?: (string|null); - /** ListTopicsRequest pageToken */ - pageToken?: (string|null); + /** TestIamPermissionsRequest permissions */ + permissions?: (string[]|null); } - /** Represents a ListTopicsRequest. */ - class ListTopicsRequest implements IListTopicsRequest { + /** Represents a TestIamPermissionsRequest. */ + class TestIamPermissionsRequest implements ITestIamPermissionsRequest { /** - * Constructs a new ListTopicsRequest. + * Constructs a new TestIamPermissionsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.pubsub.v1.IListTopicsRequest); - - /** ListTopicsRequest project. */ - public project: string; + constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); - /** ListTopicsRequest pageSize. */ - public pageSize: number; + /** TestIamPermissionsRequest resource. */ + public resource: string; - /** ListTopicsRequest pageToken. */ - public pageToken: string; + /** TestIamPermissionsRequest permissions. */ + public permissions: string[]; /** - * Creates a new ListTopicsRequest instance using the specified properties. + * Creates a new TestIamPermissionsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListTopicsRequest instance + * @returns TestIamPermissionsRequest instance */ - public static create(properties?: google.pubsub.v1.IListTopicsRequest): google.pubsub.v1.ListTopicsRequest; + public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; /** - * Encodes the specified ListTopicsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. - * @param message ListTopicsRequest message or plain object to encode + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.pubsub.v1.IListTopicsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListTopicsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. - * @param message ListTopicsRequest message or plain object to encode + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListTopicsRequest message from the specified reader or buffer. + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListTopicsRequest + * @returns TestIamPermissionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; /** - * Decodes a ListTopicsRequest message from the specified reader or buffer, length delimited. + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListTopicsRequest + * @returns TestIamPermissionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; /** - * Verifies a ListTopicsRequest message. + * Verifies a TestIamPermissionsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListTopicsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListTopicsRequest + * @returns TestIamPermissionsRequest */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicsRequest; + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; /** - * Creates a plain object from a ListTopicsRequest message. Also converts values to other types if specified. - * @param message ListTopicsRequest + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.pubsub.v1.ListTopicsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListTopicsRequest to JSON. + * Converts this TestIamPermissionsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListTopicsResponse. */ - interface IListTopicsResponse { - - /** ListTopicsResponse topics */ - topics?: (google.pubsub.v1.ITopic[]|null); + /** Properties of a TestIamPermissionsResponse. */ + interface ITestIamPermissionsResponse { - /** ListTopicsResponse nextPageToken */ - nextPageToken?: (string|null); + /** TestIamPermissionsResponse permissions */ + permissions?: (string[]|null); } - /** Represents a ListTopicsResponse. */ - class ListTopicsResponse implements IListTopicsResponse { + /** Represents a TestIamPermissionsResponse. */ + class TestIamPermissionsResponse implements ITestIamPermissionsResponse { /** - * Constructs a new ListTopicsResponse. + * Constructs a new TestIamPermissionsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.pubsub.v1.IListTopicsResponse); - - /** ListTopicsResponse topics. */ - public topics: google.pubsub.v1.ITopic[]; + constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); - /** ListTopicsResponse nextPageToken. */ - public nextPageToken: string; + /** TestIamPermissionsResponse permissions. */ + public permissions: string[]; /** - * Creates a new ListTopicsResponse instance using the specified properties. + * Creates a new TestIamPermissionsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListTopicsResponse instance + * @returns TestIamPermissionsResponse instance */ - public static create(properties?: google.pubsub.v1.IListTopicsResponse): google.pubsub.v1.ListTopicsResponse; + public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; /** - * Encodes the specified ListTopicsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. - * @param message ListTopicsResponse message or plain object to encode + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.pubsub.v1.IListTopicsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListTopicsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. - * @param message ListTopicsResponse message or plain object to encode + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListTopicsResponse message from the specified reader or buffer. + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListTopicsResponse + * @returns TestIamPermissionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; /** - * Decodes a ListTopicsResponse message from the specified reader or buffer, length delimited. + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListTopicsResponse + * @returns TestIamPermissionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; /** - * Verifies a ListTopicsResponse message. + * Verifies a TestIamPermissionsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListTopicsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListTopicsResponse + * @returns TestIamPermissionsResponse */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicsResponse; + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; /** - * Creates a plain object from a ListTopicsResponse message. Also converts values to other types if specified. - * @param message ListTopicsResponse + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @param message TestIamPermissionsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.pubsub.v1.ListTopicsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListTopicsResponse to JSON. + * Converts this TestIamPermissionsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } + } - /** Properties of a ListTopicSubscriptionsRequest. */ - interface IListTopicSubscriptionsRequest { - - /** ListTopicSubscriptionsRequest topic */ - topic?: (string|null); + /** Namespace type. */ + namespace type { - /** ListTopicSubscriptionsRequest pageSize */ - pageSize?: (number|null); + /** Properties of an Expr. */ + interface IExpr { - /** ListTopicSubscriptionsRequest pageToken */ - pageToken?: (string|null); - } + /** Expr expression */ + expression?: (string|null); - /** Represents a ListTopicSubscriptionsRequest. */ - class ListTopicSubscriptionsRequest implements IListTopicSubscriptionsRequest { + /** Expr title */ + title?: (string|null); - /** - * Constructs a new ListTopicSubscriptionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListTopicSubscriptionsRequest); + /** Expr description */ + description?: (string|null); - /** ListTopicSubscriptionsRequest topic. */ - public topic: string; + /** Expr location */ + location?: (string|null); + } - /** ListTopicSubscriptionsRequest pageSize. */ - public pageSize: number; + /** Represents an Expr. */ + class Expr implements IExpr { - /** ListTopicSubscriptionsRequest pageToken. */ - public pageToken: string; + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); - /** - * Creates a new ListTopicSubscriptionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTopicSubscriptionsRequest instance - */ - public static create(properties?: google.pubsub.v1.IListTopicSubscriptionsRequest): google.pubsub.v1.ListTopicSubscriptionsRequest; + /** Expr expression. */ + public expression: string; - /** - * Encodes the specified ListTopicSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. - * @param message ListTopicSubscriptionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListTopicSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Expr title. */ + public title: string; - /** - * Encodes the specified ListTopicSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. - * @param message ListTopicSubscriptionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Expr description. */ + public description: string; - /** - * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTopicSubscriptionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicSubscriptionsRequest; + /** Expr location. */ + public location: string; - /** - * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTopicSubscriptionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicSubscriptionsRequest; + /** + * 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; - /** - * Verifies a ListTopicSubscriptionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified 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; - /** - * Creates a ListTopicSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTopicSubscriptionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSubscriptionsRequest; + /** + * 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; - /** - * Creates a plain object from a ListTopicSubscriptionsRequest message. Also converts values to other types if specified. - * @param message ListTopicSubscriptionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListTopicSubscriptionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this ListTopicSubscriptionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** Properties of a ListTopicSubscriptionsResponse. */ - interface IListTopicSubscriptionsResponse { + /** + * 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); - /** ListTopicSubscriptionsResponse subscriptions */ - subscriptions?: (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; - /** ListTopicSubscriptionsResponse nextPageToken */ - nextPageToken?: (string|null); - } + /** + * 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 }; - /** Represents a ListTopicSubscriptionsResponse. */ - class ListTopicSubscriptionsResponse implements IListTopicSubscriptionsResponse { + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * Constructs a new ListTopicSubscriptionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListTopicSubscriptionsResponse); + /** Namespace api. */ + namespace api { - /** ListTopicSubscriptionsResponse subscriptions. */ - public subscriptions: string[]; + /** Properties of a Http. */ + interface IHttp { - /** ListTopicSubscriptionsResponse nextPageToken. */ - public nextPageToken: string; + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); - /** - * Creates a new ListTopicSubscriptionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTopicSubscriptionsResponse instance - */ - public static create(properties?: google.pubsub.v1.IListTopicSubscriptionsResponse): google.pubsub.v1.ListTopicSubscriptionsResponse; + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } - /** - * Encodes the specified ListTopicSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. - * @param message ListTopicSubscriptionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListTopicSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a Http. */ + class Http implements IHttp { - /** - * Encodes the specified ListTopicSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. - * @param message ListTopicSubscriptionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); - /** - * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTopicSubscriptionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicSubscriptionsResponse; + /** Http rules. */ + public rules: google.api.IHttpRule[]; - /** - * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTopicSubscriptionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicSubscriptionsResponse; + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; - /** - * Verifies a ListTopicSubscriptionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; - /** - * Creates a ListTopicSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTopicSubscriptionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSubscriptionsResponse; + /** + * 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; - /** - * Creates a plain object from a ListTopicSubscriptionsResponse message. Also converts values to other types if specified. - * @param message ListTopicSubscriptionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListTopicSubscriptionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this ListTopicSubscriptionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** Properties of a ListTopicSnapshotsRequest. */ - interface IListTopicSnapshotsRequest { + /** + * 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; - /** ListTopicSnapshotsRequest topic */ - topic?: (string|null); + /** + * 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); - /** ListTopicSnapshotsRequest pageSize */ - pageSize?: (number|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; - /** ListTopicSnapshotsRequest pageToken */ - pageToken?: (string|null); - } + /** + * 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 }; - /** Represents a ListTopicSnapshotsRequest. */ - class ListTopicSnapshotsRequest implements IListTopicSnapshotsRequest { + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new ListTopicSnapshotsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListTopicSnapshotsRequest); + /** Properties of a HttpRule. */ + interface IHttpRule { - /** ListTopicSnapshotsRequest topic. */ - public topic: string; + /** HttpRule selector */ + selector?: (string|null); - /** ListTopicSnapshotsRequest pageSize. */ - public pageSize: number; + /** HttpRule get */ + get?: (string|null); - /** ListTopicSnapshotsRequest pageToken. */ - public pageToken: string; + /** HttpRule put */ + put?: (string|null); - /** - * Creates a new ListTopicSnapshotsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTopicSnapshotsRequest instance - */ - public static create(properties?: google.pubsub.v1.IListTopicSnapshotsRequest): google.pubsub.v1.ListTopicSnapshotsRequest; + /** HttpRule post */ + post?: (string|null); - /** - * Encodes the specified ListTopicSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. - * @param message ListTopicSnapshotsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListTopicSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** HttpRule delete */ + "delete"?: (string|null); - /** - * Encodes the specified ListTopicSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. - * @param message ListTopicSnapshotsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** HttpRule patch */ + patch?: (string|null); - /** - * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTopicSnapshotsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicSnapshotsRequest; + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); - /** - * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTopicSnapshotsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicSnapshotsRequest; + /** HttpRule body */ + body?: (string|null); - /** - * Verifies a ListTopicSnapshotsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** HttpRule responseBody */ + responseBody?: (string|null); - /** - * Creates a ListTopicSnapshotsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTopicSnapshotsRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSnapshotsRequest; + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } - /** - * Creates a plain object from a ListTopicSnapshotsRequest message. Also converts values to other types if specified. - * @param message ListTopicSnapshotsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListTopicSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { - /** - * Converts this ListTopicSnapshotsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); - /** Properties of a ListTopicSnapshotsResponse. */ - interface IListTopicSnapshotsResponse { + /** HttpRule selector. */ + public selector: string; - /** ListTopicSnapshotsResponse snapshots */ - snapshots?: (string[]|null); + /** HttpRule get. */ + public get: string; - /** ListTopicSnapshotsResponse nextPageToken */ - nextPageToken?: (string|null); - } + /** HttpRule put. */ + public put: string; - /** Represents a ListTopicSnapshotsResponse. */ - class ListTopicSnapshotsResponse implements IListTopicSnapshotsResponse { + /** HttpRule post. */ + public post: string; - /** - * Constructs a new ListTopicSnapshotsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListTopicSnapshotsResponse); + /** HttpRule delete. */ + public delete: string; - /** ListTopicSnapshotsResponse snapshots. */ - public snapshots: string[]; + /** HttpRule patch. */ + public patch: string; - /** ListTopicSnapshotsResponse nextPageToken. */ - public nextPageToken: string; + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); - /** - * Creates a new ListTopicSnapshotsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTopicSnapshotsResponse instance - */ - public static create(properties?: google.pubsub.v1.IListTopicSnapshotsResponse): google.pubsub.v1.ListTopicSnapshotsResponse; + /** HttpRule body. */ + public body: string; - /** - * Encodes the specified ListTopicSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. - * @param message ListTopicSnapshotsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListTopicSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** HttpRule responseBody. */ + public responseBody: string; - /** - * Encodes the specified ListTopicSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. - * @param message ListTopicSnapshotsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListTopicSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; - /** - * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTopicSnapshotsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicSnapshotsResponse; + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - /** - * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTopicSnapshotsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicSnapshotsResponse; + /** + * 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; - /** - * Verifies a ListTopicSnapshotsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified 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; - /** - * Creates a ListTopicSnapshotsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTopicSnapshotsResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSnapshotsResponse; + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a ListTopicSnapshotsResponse message. Also converts values to other types if specified. - * @param message ListTopicSnapshotsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListTopicSnapshotsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this ListTopicSnapshotsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** Properties of a DeleteTopicRequest. */ - interface IDeleteTopicRequest { + /** + * 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); - /** DeleteTopicRequest topic */ - topic?: (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; - /** Represents a DeleteTopicRequest. */ - class DeleteTopicRequest implements IDeleteTopicRequest { + /** + * 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 }; - /** - * Constructs a new DeleteTopicRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IDeleteTopicRequest); + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** DeleteTopicRequest topic. */ - public topic: string; + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { - /** - * Creates a new DeleteTopicRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteTopicRequest instance - */ - public static create(properties?: google.pubsub.v1.IDeleteTopicRequest): google.pubsub.v1.DeleteTopicRequest; + /** CustomHttpPattern kind */ + kind?: (string|null); - /** - * Encodes the specified DeleteTopicRequest message. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. - * @param message DeleteTopicRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IDeleteTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** CustomHttpPattern path */ + path?: (string|null); + } - /** - * Encodes the specified DeleteTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. - * @param message DeleteTopicRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IDeleteTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { - /** - * Decodes a DeleteTopicRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DeleteTopicRequest; + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); - /** - * Decodes a DeleteTopicRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DeleteTopicRequest; + /** CustomHttpPattern kind. */ + public kind: string; - /** - * Verifies a DeleteTopicRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** CustomHttpPattern path. */ + public path: string; - /** - * Creates a DeleteTopicRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteTopicRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteTopicRequest; + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; - /** - * Creates a plain object from a DeleteTopicRequest message. Also converts values to other types if specified. - * @param message DeleteTopicRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.DeleteTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this DeleteTopicRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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 }; + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5 + } + + /** 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); + } + + /** 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; + + /** + * 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 }; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 } + } + + /** 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 }; + } + } + + /** Namespace protobuf. */ + namespace protobuf { - /** Represents a Subscriber */ - class Subscriber extends $protobuf.rpc.Service { + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { - /** - * Constructs a new Subscriber 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); + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } - /** - * Creates new Subscriber 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): Subscriber; + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { - /** - * Calls CreateSubscription. - * @param request Subscription message or plain object - * @param callback Node-style callback called with the error, if any, and Subscription - */ - public createSubscription(request: google.pubsub.v1.ISubscription, callback: google.pubsub.v1.Subscriber.CreateSubscriptionCallback): void; + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); - /** - * Calls CreateSubscription. - * @param request Subscription message or plain object - * @returns Promise - */ - public createSubscription(request: google.pubsub.v1.ISubscription): Promise; + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; - /** - * Calls GetSubscription. - * @param request GetSubscriptionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Subscription - */ - public getSubscription(request: google.pubsub.v1.IGetSubscriptionRequest, callback: google.pubsub.v1.Subscriber.GetSubscriptionCallback): void; + /** + * 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; - /** - * Calls GetSubscription. - * @param request GetSubscriptionRequest message or plain object - * @returns Promise - */ - public getSubscription(request: google.pubsub.v1.IGetSubscriptionRequest): Promise; + /** + * 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; - /** - * Calls UpdateSubscription. - * @param request UpdateSubscriptionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Subscription - */ - public updateSubscription(request: google.pubsub.v1.IUpdateSubscriptionRequest, callback: google.pubsub.v1.Subscriber.UpdateSubscriptionCallback): void; + /** + * 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; - /** - * Calls UpdateSubscription. - * @param request UpdateSubscriptionRequest message or plain object - * @returns Promise - */ - public updateSubscription(request: google.pubsub.v1.IUpdateSubscriptionRequest): Promise; + /** + * 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; - /** - * Calls ListSubscriptions. - * @param request ListSubscriptionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSubscriptionsResponse - */ - public listSubscriptions(request: google.pubsub.v1.IListSubscriptionsRequest, callback: google.pubsub.v1.Subscriber.ListSubscriptionsCallback): void; + /** + * 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; - /** - * Calls ListSubscriptions. - * @param request ListSubscriptionsRequest message or plain object - * @returns Promise - */ - public listSubscriptions(request: google.pubsub.v1.IListSubscriptionsRequest): Promise; + /** + * 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); - /** - * Calls DeleteSubscription. - * @param request DeleteSubscriptionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteSubscription(request: google.pubsub.v1.IDeleteSubscriptionRequest, callback: google.pubsub.v1.Subscriber.DeleteSubscriptionCallback): void; + /** + * 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; - /** - * Calls DeleteSubscription. - * @param request DeleteSubscriptionRequest message or plain object - * @returns Promise - */ - public deleteSubscription(request: google.pubsub.v1.IDeleteSubscriptionRequest): Promise; + /** + * 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 }; - /** - * Calls ModifyAckDeadline. - * @param request ModifyAckDeadlineRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public modifyAckDeadline(request: google.pubsub.v1.IModifyAckDeadlineRequest, callback: google.pubsub.v1.Subscriber.ModifyAckDeadlineCallback): void; + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Calls ModifyAckDeadline. - * @param request ModifyAckDeadlineRequest message or plain object - * @returns Promise - */ - public modifyAckDeadline(request: google.pubsub.v1.IModifyAckDeadlineRequest): Promise; + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { - /** - * Calls Acknowledge. - * @param request AcknowledgeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public acknowledge(request: google.pubsub.v1.IAcknowledgeRequest, callback: google.pubsub.v1.Subscriber.AcknowledgeCallback): void; + /** FileDescriptorProto name */ + name?: (string|null); - /** - * Calls Acknowledge. - * @param request AcknowledgeRequest message or plain object - * @returns Promise - */ - public acknowledge(request: google.pubsub.v1.IAcknowledgeRequest): Promise; + /** FileDescriptorProto package */ + "package"?: (string|null); - /** - * Calls Pull. - * @param request PullRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PullResponse - */ - public pull(request: google.pubsub.v1.IPullRequest, callback: google.pubsub.v1.Subscriber.PullCallback): void; + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); - /** - * Calls Pull. - * @param request PullRequest message or plain object - * @returns Promise - */ - public pull(request: google.pubsub.v1.IPullRequest): Promise; + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); - /** - * Calls StreamingPull. - * @param request StreamingPullRequest message or plain object - * @param callback Node-style callback called with the error, if any, and StreamingPullResponse - */ - public streamingPull(request: google.pubsub.v1.IStreamingPullRequest, callback: google.pubsub.v1.Subscriber.StreamingPullCallback): void; + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); - /** - * Calls StreamingPull. - * @param request StreamingPullRequest message or plain object - * @returns Promise - */ - public streamingPull(request: google.pubsub.v1.IStreamingPullRequest): Promise; + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); - /** - * Calls ModifyPushConfig. - * @param request ModifyPushConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public modifyPushConfig(request: google.pubsub.v1.IModifyPushConfigRequest, callback: google.pubsub.v1.Subscriber.ModifyPushConfigCallback): void; + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - /** - * Calls ModifyPushConfig. - * @param request ModifyPushConfigRequest message or plain object - * @returns Promise - */ - public modifyPushConfig(request: google.pubsub.v1.IModifyPushConfigRequest): Promise; + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); - /** - * Calls GetSnapshot. - * @param request GetSnapshotRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Snapshot - */ - public getSnapshot(request: google.pubsub.v1.IGetSnapshotRequest, callback: google.pubsub.v1.Subscriber.GetSnapshotCallback): void; + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); - /** - * Calls GetSnapshot. - * @param request GetSnapshotRequest message or plain object - * @returns Promise - */ - public getSnapshot(request: google.pubsub.v1.IGetSnapshotRequest): Promise; + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); - /** - * Calls ListSnapshots. - * @param request ListSnapshotsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSnapshotsResponse - */ - public listSnapshots(request: google.pubsub.v1.IListSnapshotsRequest, callback: google.pubsub.v1.Subscriber.ListSnapshotsCallback): void; + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - /** - * Calls ListSnapshots. - * @param request ListSnapshotsRequest message or plain object - * @returns Promise - */ - public listSnapshots(request: google.pubsub.v1.IListSnapshotsRequest): Promise; + /** FileDescriptorProto syntax */ + syntax?: (string|null); + } - /** - * Calls CreateSnapshot. - * @param request CreateSnapshotRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Snapshot - */ - public createSnapshot(request: google.pubsub.v1.ICreateSnapshotRequest, callback: google.pubsub.v1.Subscriber.CreateSnapshotCallback): void; + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { - /** - * Calls CreateSnapshot. - * @param request CreateSnapshotRequest message or plain object - * @returns Promise - */ - public createSnapshot(request: google.pubsub.v1.ICreateSnapshotRequest): Promise; + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); - /** - * Calls UpdateSnapshot. - * @param request UpdateSnapshotRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Snapshot - */ - public updateSnapshot(request: google.pubsub.v1.IUpdateSnapshotRequest, callback: google.pubsub.v1.Subscriber.UpdateSnapshotCallback): void; + /** FileDescriptorProto name. */ + public name: string; - /** - * Calls UpdateSnapshot. - * @param request UpdateSnapshotRequest message or plain object - * @returns Promise - */ - public updateSnapshot(request: google.pubsub.v1.IUpdateSnapshotRequest): Promise; + /** FileDescriptorProto package. */ + public package: string; - /** - * Calls DeleteSnapshot. - * @param request DeleteSnapshotRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteSnapshot(request: google.pubsub.v1.IDeleteSnapshotRequest, callback: google.pubsub.v1.Subscriber.DeleteSnapshotCallback): void; + /** FileDescriptorProto dependency. */ + public dependency: string[]; - /** - * Calls DeleteSnapshot. - * @param request DeleteSnapshotRequest message or plain object - * @returns Promise - */ - public deleteSnapshot(request: google.pubsub.v1.IDeleteSnapshotRequest): Promise; + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; - /** - * Calls Seek. - * @param request SeekRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SeekResponse - */ - public seek(request: google.pubsub.v1.ISeekRequest, callback: google.pubsub.v1.Subscriber.SeekCallback): void; + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; - /** - * Calls Seek. - * @param request SeekRequest message or plain object - * @returns Promise - */ - public seek(request: google.pubsub.v1.ISeekRequest): Promise; - } + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; - namespace Subscriber { + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#createSubscription}. - * @param error Error, if any - * @param [response] Subscription - */ - type CreateSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#getSubscription}. - * @param error Error, if any - * @param [response] Subscription - */ - type GetSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#updateSubscription}. - * @param error Error, if any - * @param [response] Subscription - */ - type UpdateSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#listSubscriptions}. - * @param error Error, if any - * @param [response] ListSubscriptionsResponse - */ - type ListSubscriptionsCallback = (error: (Error|null), response?: google.pubsub.v1.ListSubscriptionsResponse) => void; + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#deleteSubscription}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteSubscriptionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + /** FileDescriptorProto syntax. */ + public syntax: string; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#modifyAckDeadline}. - * @param error Error, if any - * @param [response] Empty - */ - type ModifyAckDeadlineCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + /** + * 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; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#acknowledge}. - * @param error Error, if any - * @param [response] Empty - */ - type AcknowledgeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + /** + * 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; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#pull}. - * @param error Error, if any - * @param [response] PullResponse - */ - type PullCallback = (error: (Error|null), response?: google.pubsub.v1.PullResponse) => void; + /** + * 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; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#streamingPull}. - * @param error Error, if any - * @param [response] StreamingPullResponse - */ - type StreamingPullCallback = (error: (Error|null), response?: google.pubsub.v1.StreamingPullResponse) => void; + /** + * 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; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#modifyPushConfig}. - * @param error Error, if any - * @param [response] Empty - */ - type ModifyPushConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + /** + * 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; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#getSnapshot}. - * @param error Error, if any - * @param [response] Snapshot - */ - type GetSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; + /** + * 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); - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#listSnapshots}. - * @param error Error, if any - * @param [response] ListSnapshotsResponse - */ - type ListSnapshotsCallback = (error: (Error|null), response?: google.pubsub.v1.ListSnapshotsResponse) => void; + /** + * 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; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#createSnapshot}. - * @param error Error, if any - * @param [response] Snapshot - */ - type CreateSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; + /** + * 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 }; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#updateSnapshot}. - * @param error Error, if any - * @param [response] Snapshot - */ - type UpdateSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#deleteSnapshot}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteSnapshotCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#seek}. - * @param error Error, if any - * @param [response] SeekResponse - */ - type SeekCallback = (error: (Error|null), response?: google.pubsub.v1.SeekResponse) => void; - } + /** DescriptorProto name */ + name?: (string|null); - /** Properties of a Subscription. */ - interface ISubscription { + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); - /** Subscription name */ - name?: (string|null); + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); - /** Subscription topic */ - topic?: (string|null); + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); - /** Subscription pushConfig */ - pushConfig?: (google.pubsub.v1.IPushConfig|null); + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - /** Subscription ackDeadlineSeconds */ - ackDeadlineSeconds?: (number|null); + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - /** Subscription retainAckedMessages */ - retainAckedMessages?: (boolean|null); + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - /** Subscription messageRetentionDuration */ - messageRetentionDuration?: (google.protobuf.IDuration|null); + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); - /** Subscription labels */ - labels?: ({ [k: string]: string }|null); + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - /** Subscription enableMessageOrdering */ - enableMessageOrdering?: (boolean|null); + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } - /** Subscription expirationPolicy */ - expirationPolicy?: (google.pubsub.v1.IExpirationPolicy|null); + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { - /** Subscription deadLetterPolicy */ - deadLetterPolicy?: (google.pubsub.v1.IDeadLetterPolicy|null); - } + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); - /** Represents a Subscription. */ - class Subscription implements ISubscription { + /** DescriptorProto name. */ + public name: string; - /** - * Constructs a new Subscription. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ISubscription); + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; - /** Subscription name. */ - public name: string; + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; - /** Subscription topic. */ - public topic: string; + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; - /** Subscription pushConfig. */ - public pushConfig?: (google.pubsub.v1.IPushConfig|null); + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; - /** Subscription ackDeadlineSeconds. */ - public ackDeadlineSeconds: number; + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - /** Subscription retainAckedMessages. */ - public retainAckedMessages: boolean; + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - /** Subscription messageRetentionDuration. */ - public messageRetentionDuration?: (google.protobuf.IDuration|null); + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); - /** Subscription labels. */ - public labels: { [k: string]: string }; + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - /** Subscription enableMessageOrdering. */ - public enableMessageOrdering: boolean; + /** DescriptorProto reservedName. */ + public reservedName: string[]; - /** Subscription expirationPolicy. */ - public expirationPolicy?: (google.pubsub.v1.IExpirationPolicy|null); + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - /** Subscription deadLetterPolicy. */ - public deadLetterPolicy?: (google.pubsub.v1.IDeadLetterPolicy|null); + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new Subscription instance using the specified properties. - * @param [properties] Properties to set - * @returns Subscription instance - */ - public static create(properties?: google.pubsub.v1.ISubscription): google.pubsub.v1.Subscription; + /** + * 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; - /** - * Encodes the specified Subscription message. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. - * @param message Subscription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ISubscription, 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; - /** - * Encodes the specified Subscription message, length delimited. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. - * @param message Subscription message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ISubscription, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * Decodes a Subscription message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Subscription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.Subscription; + /** + * 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); - /** - * Decodes a Subscription message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Subscription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.Subscription; + /** + * 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; - /** - * Verifies a Subscription message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a plain object from a 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 }; - /** - * Creates a Subscription message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Subscription - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Subscription; + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a plain object from a Subscription message. Also converts values to other types if specified. - * @param message Subscription - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.Subscription, options?: $protobuf.IConversionOptions): { [k: string]: any }; + namespace DescriptorProto { - /** - * Converts this Subscription to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of an ExtensionRange. */ + interface IExtensionRange { - /** Properties of a DeadLetterPolicy. */ - interface IDeadLetterPolicy { + /** ExtensionRange start */ + start?: (number|null); - /** DeadLetterPolicy deadLetterTopic */ - deadLetterTopic?: (string|null); + /** ExtensionRange end */ + end?: (number|null); - /** DeadLetterPolicy maxDeliveryAttempts */ - maxDeliveryAttempts?: (number|null); + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); } - /** Represents a DeadLetterPolicy. */ - class DeadLetterPolicy implements IDeadLetterPolicy { + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { /** - * Constructs a new DeadLetterPolicy. + * Constructs a new ExtensionRange. * @param [properties] Properties to set */ - constructor(properties?: google.pubsub.v1.IDeadLetterPolicy); + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - /** DeadLetterPolicy deadLetterTopic. */ - public deadLetterTopic: string; + /** ExtensionRange start. */ + public start: number; - /** DeadLetterPolicy maxDeliveryAttempts. */ - public maxDeliveryAttempts: number; + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); /** - * Creates a new DeadLetterPolicy instance using the specified properties. + * Creates a new ExtensionRange instance using the specified properties. * @param [properties] Properties to set - * @returns DeadLetterPolicy instance + * @returns ExtensionRange instance */ - public static create(properties?: google.pubsub.v1.IDeadLetterPolicy): google.pubsub.v1.DeadLetterPolicy; + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; /** - * Encodes the specified DeadLetterPolicy message. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. - * @param message DeadLetterPolicy message or plain object to encode + * 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.pubsub.v1.IDeadLetterPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeadLetterPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. - * @param message DeadLetterPolicy message or plain object to encode + * 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.pubsub.v1.IDeadLetterPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeadLetterPolicy message from the specified reader or buffer. + * 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 DeadLetterPolicy + * @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.pubsub.v1.DeadLetterPolicy; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; /** - * Decodes a DeadLetterPolicy message from the specified reader or buffer, length delimited. + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeadLetterPolicy + * @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.pubsub.v1.DeadLetterPolicy; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; /** - * Verifies a DeadLetterPolicy message. + * 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 a DeadLetterPolicy message from a plain object. Also converts values to their respective internal types. + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeadLetterPolicy + * @returns ExtensionRange */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeadLetterPolicy; + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; /** - * Creates a plain object from a DeadLetterPolicy message. Also converts values to other types if specified. - * @param message DeadLetterPolicy + * 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.pubsub.v1.DeadLetterPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeadLetterPolicy to JSON. + * Converts this ExtensionRange to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ExpirationPolicy. */ - interface IExpirationPolicy { + /** Properties of a ReservedRange. */ + interface IReservedRange { - /** ExpirationPolicy ttl */ - ttl?: (google.protobuf.IDuration|null); + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); } - /** Represents an ExpirationPolicy. */ - class ExpirationPolicy implements IExpirationPolicy { + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { /** - * Constructs a new ExpirationPolicy. + * Constructs a new ReservedRange. * @param [properties] Properties to set */ - constructor(properties?: google.pubsub.v1.IExpirationPolicy); + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - /** ExpirationPolicy ttl. */ - public ttl?: (google.protobuf.IDuration|null); + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; /** - * Creates a new ExpirationPolicy instance using the specified properties. + * Creates a new ReservedRange instance using the specified properties. * @param [properties] Properties to set - * @returns ExpirationPolicy instance + * @returns ReservedRange instance */ - public static create(properties?: google.pubsub.v1.IExpirationPolicy): google.pubsub.v1.ExpirationPolicy; + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; /** - * Encodes the specified ExpirationPolicy message. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. - * @param message ExpirationPolicy message or plain object to encode + * 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.pubsub.v1.IExpirationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExpirationPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. - * @param message ExpirationPolicy message or plain object to encode + * 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.pubsub.v1.IExpirationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExpirationPolicy message from the specified reader or buffer. + * 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 ExpirationPolicy + * @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.pubsub.v1.ExpirationPolicy; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; /** - * Decodes an ExpirationPolicy message from the specified reader or buffer, length delimited. + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExpirationPolicy + * @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.pubsub.v1.ExpirationPolicy; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; /** - * Verifies an ExpirationPolicy message. + * 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 an ExpirationPolicy message from a plain object. Also converts values to their respective internal types. + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExpirationPolicy + * @returns ReservedRange */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ExpirationPolicy; + 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 }; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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[]; + + /** + * 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 }; + } + + /** 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); + } + + /** 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; - /** - * Creates a plain object from an ExpirationPolicy message. Also converts values to other types if specified. - * @param message ExpirationPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ExpirationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FieldDescriptorProto number. */ + public number: number; - /** - * Converts this ExpirationPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - /** Properties of a PushConfig. */ - interface IPushConfig { + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - /** PushConfig pushEndpoint */ - pushEndpoint?: (string|null); + /** FieldDescriptorProto typeName. */ + public typeName: string; - /** PushConfig attributes */ - attributes?: ({ [k: string]: string }|null); + /** FieldDescriptorProto extendee. */ + public extendee: string; - /** PushConfig oidcToken */ - oidcToken?: (google.pubsub.v1.PushConfig.IOidcToken|null); - } + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; - /** Represents a PushConfig. */ - class PushConfig implements IPushConfig { + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; - /** - * Constructs a new PushConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IPushConfig); + /** FieldDescriptorProto jsonName. */ + public jsonName: string; - /** PushConfig pushEndpoint. */ - public pushEndpoint: string; + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); - /** PushConfig attributes. */ - public attributes: { [k: string]: string }; + /** + * 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; - /** PushConfig oidcToken. */ - public oidcToken?: (google.pubsub.v1.PushConfig.IOidcToken|null); + /** + * 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; - /** PushConfig authenticationMethod. */ - public authenticationMethod?: "oidcToken"; + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new PushConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PushConfig instance - */ - public static create(properties?: google.pubsub.v1.IPushConfig): google.pubsub.v1.PushConfig; + /** + * 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; - /** - * Encodes the specified PushConfig message. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. - * @param message PushConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IPushConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * Encodes the specified PushConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. - * @param message PushConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IPushConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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); - /** - * Decodes a PushConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PushConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PushConfig; + /** + * 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; - /** - * Decodes a PushConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PushConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PushConfig; + /** + * 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 }; - /** - * Verifies a PushConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a PushConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PushConfig - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig; + namespace FieldDescriptorProto { - /** - * Creates a plain object from a PushConfig message. Also converts values to other types if specified. - * @param message PushConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PushConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** 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 + } - /** - * Converts this PushConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 } + } - namespace PushConfig { + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { - /** Properties of an OidcToken. */ - interface IOidcToken { + /** OneofDescriptorProto name */ + name?: (string|null); - /** OidcToken serviceAccountEmail */ - serviceAccountEmail?: (string|null); + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } - /** OidcToken audience */ - audience?: (string|null); - } + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { - /** Represents an OidcToken. */ - class OidcToken implements IOidcToken { + /** + * 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; - /** - * Constructs a new OidcToken. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.PushConfig.IOidcToken); + /** + * 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; - /** OidcToken serviceAccountEmail. */ - public serviceAccountEmail: string; + /** + * 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; - /** OidcToken audience. */ - public audience: string; + /** + * 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 a new OidcToken instance using the specified properties. - * @param [properties] Properties to set - * @returns OidcToken instance - */ - public static create(properties?: google.pubsub.v1.PushConfig.IOidcToken): google.pubsub.v1.PushConfig.OidcToken; + /** + * 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; - /** - * Encodes the specified OidcToken message. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. - * @param message OidcToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.PushConfig.IOidcToken, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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 }; - /** - * Encodes the specified OidcToken message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. - * @param message OidcToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.PushConfig.IOidcToken, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes an OidcToken message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OidcToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PushConfig.OidcToken; + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { - /** - * Decodes an OidcToken message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OidcToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PushConfig.OidcToken; + /** EnumDescriptorProto name */ + name?: (string|null); - /** - * Verifies an OidcToken message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - /** - * Creates an OidcToken message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OidcToken - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig.OidcToken; + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); - /** - * Creates a plain object from an OidcToken message. Also converts values to other types if specified. - * @param message OidcToken - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PushConfig.OidcToken, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - /** - * Converts this OidcToken to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } - /** Properties of a ReceivedMessage. */ - interface IReceivedMessage { + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { - /** ReceivedMessage ackId */ - ackId?: (string|null); + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); - /** ReceivedMessage message */ - message?: (google.pubsub.v1.IPubsubMessage|null); + /** EnumDescriptorProto name. */ + public name: string; - /** ReceivedMessage deliveryAttempt */ - deliveryAttempt?: (number|null); - } + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; - /** Represents a ReceivedMessage. */ - class ReceivedMessage implements IReceivedMessage { + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); - /** - * Constructs a new ReceivedMessage. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IReceivedMessage); + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - /** ReceivedMessage ackId. */ - public ackId: string; + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; - /** ReceivedMessage message. */ - public message?: (google.pubsub.v1.IPubsubMessage|null); + /** + * 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; - /** ReceivedMessage deliveryAttempt. */ - public deliveryAttempt: number; + /** + * 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; - /** - * Creates a new ReceivedMessage instance using the specified properties. - * @param [properties] Properties to set - * @returns ReceivedMessage instance - */ - public static create(properties?: google.pubsub.v1.IReceivedMessage): google.pubsub.v1.ReceivedMessage; + /** + * 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; - /** - * Encodes the specified ReceivedMessage message. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. - * @param message ReceivedMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IReceivedMessage, 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; - /** - * Encodes the specified ReceivedMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. - * @param message ReceivedMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IReceivedMessage, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - /** - * Decodes a ReceivedMessage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReceivedMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ReceivedMessage; + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a ReceivedMessage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReceivedMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ReceivedMessage; + /** + * 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; - /** - * Verifies a ReceivedMessage message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a plain object from an 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 }; - /** - * Creates a ReceivedMessage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReceivedMessage - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ReceivedMessage; + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a plain object from a ReceivedMessage message. Also converts values to other types if specified. - * @param message ReceivedMessage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ReceivedMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + namespace EnumDescriptorProto { - /** - * Converts this ReceivedMessage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { - /** Properties of a GetSubscriptionRequest. */ - interface IGetSubscriptionRequest { + /** EnumReservedRange start */ + start?: (number|null); - /** GetSubscriptionRequest subscription */ - subscription?: (string|null); + /** EnumReservedRange end */ + end?: (number|null); } - /** Represents a GetSubscriptionRequest. */ - class GetSubscriptionRequest implements IGetSubscriptionRequest { + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { /** - * Constructs a new GetSubscriptionRequest. + * Constructs a new EnumReservedRange. * @param [properties] Properties to set */ - constructor(properties?: google.pubsub.v1.IGetSubscriptionRequest); + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - /** GetSubscriptionRequest subscription. */ - public subscription: string; + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; /** - * Creates a new GetSubscriptionRequest instance using the specified properties. + * Creates a new EnumReservedRange instance using the specified properties. * @param [properties] Properties to set - * @returns GetSubscriptionRequest instance + * @returns EnumReservedRange instance */ - public static create(properties?: google.pubsub.v1.IGetSubscriptionRequest): google.pubsub.v1.GetSubscriptionRequest; + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; /** - * Encodes the specified GetSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. - * @param message GetSubscriptionRequest message or plain object to encode + * 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.pubsub.v1.IGetSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. - * @param message GetSubscriptionRequest message or plain object to encode + * 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.pubsub.v1.IGetSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetSubscriptionRequest message from the specified reader or buffer. + * 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 GetSubscriptionRequest + * @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.pubsub.v1.GetSubscriptionRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; /** - * Decodes a GetSubscriptionRequest message from the specified reader or buffer, length delimited. + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetSubscriptionRequest + * @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.pubsub.v1.GetSubscriptionRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; /** - * Verifies a GetSubscriptionRequest message. + * 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 a GetSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetSubscriptionRequest + * @returns EnumReservedRange */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetSubscriptionRequest; + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; /** - * Creates a plain object from a GetSubscriptionRequest message. Also converts values to other types if specified. - * @param message GetSubscriptionRequest + * 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.pubsub.v1.GetSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetSubscriptionRequest to JSON. + * Converts this EnumReservedRange to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of an UpdateSubscriptionRequest. */ - interface IUpdateSubscriptionRequest { + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { - /** UpdateSubscriptionRequest subscription */ - subscription?: (google.pubsub.v1.ISubscription|null); + /** EnumValueDescriptorProto name */ + name?: (string|null); - /** UpdateSubscriptionRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } + /** EnumValueDescriptorProto number */ + number?: (number|null); - /** Represents an UpdateSubscriptionRequest. */ - class UpdateSubscriptionRequest implements IUpdateSubscriptionRequest { + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } - /** - * Constructs a new UpdateSubscriptionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IUpdateSubscriptionRequest); + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - /** UpdateSubscriptionRequest subscription. */ - public subscription?: (google.pubsub.v1.ISubscription|null); + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - /** UpdateSubscriptionRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** EnumValueDescriptorProto name. */ + public name: string; - /** - * Creates a new UpdateSubscriptionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateSubscriptionRequest instance - */ - public static create(properties?: google.pubsub.v1.IUpdateSubscriptionRequest): google.pubsub.v1.UpdateSubscriptionRequest; + /** EnumValueDescriptorProto number. */ + public number: number; - /** - * Encodes the specified UpdateSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. - * @param message UpdateSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IUpdateSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); - /** - * Encodes the specified UpdateSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. - * @param message UpdateSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IUpdateSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.UpdateSubscriptionRequest; + /** + * 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 }; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); - /** - * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.UpdateSubscriptionRequest; + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); - /** - * Verifies an UpdateSubscriptionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } - /** - * Creates an UpdateSubscriptionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateSubscriptionRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateSubscriptionRequest; + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { - /** - * Creates a plain object from an UpdateSubscriptionRequest message. Also converts values to other types if specified. - * @param message UpdateSubscriptionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.UpdateSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); - /** - * Converts this UpdateSubscriptionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ServiceDescriptorProto name. */ + public name: string; - /** Properties of a ListSubscriptionsRequest. */ - interface IListSubscriptionsRequest { + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; - /** ListSubscriptionsRequest project */ - project?: (string|null); + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); - /** ListSubscriptionsRequest pageSize */ - pageSize?: (number|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; - /** ListSubscriptionsRequest pageToken */ - pageToken?: (string|null); - } + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a ListSubscriptionsRequest. */ - class ListSubscriptionsRequest implements IListSubscriptionsRequest { + /** + * 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; - /** - * Constructs a new ListSubscriptionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListSubscriptionsRequest); + /** + * 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; - /** ListSubscriptionsRequest project. */ - public project: string; + /** + * 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; - /** ListSubscriptionsRequest pageSize. */ - public pageSize: number; + /** + * 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); - /** ListSubscriptionsRequest pageToken. */ - public pageToken: string; + /** + * 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 new ListSubscriptionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSubscriptionsRequest instance - */ - public static create(properties?: google.pubsub.v1.IListSubscriptionsRequest): google.pubsub.v1.ListSubscriptionsRequest; + /** + * 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 }; - /** - * Encodes the specified ListSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. - * @param message ListSubscriptionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified ListSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. - * @param message ListSubscriptionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { - /** - * Decodes a ListSubscriptionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSubscriptionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSubscriptionsRequest; + /** MethodDescriptorProto name */ + name?: (string|null); - /** - * Decodes a ListSubscriptionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSubscriptionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSubscriptionsRequest; + /** MethodDescriptorProto inputType */ + inputType?: (string|null); - /** - * Verifies a ListSubscriptionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** MethodDescriptorProto outputType */ + outputType?: (string|null); - /** - * Creates a ListSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSubscriptionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSubscriptionsRequest; + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); - /** - * Creates a plain object from a ListSubscriptionsRequest message. Also converts values to other types if specified. - * @param message ListSubscriptionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListSubscriptionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); - /** - * Converts this ListSubscriptionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } - /** Properties of a ListSubscriptionsResponse. */ - interface IListSubscriptionsResponse { + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { - /** ListSubscriptionsResponse subscriptions */ - subscriptions?: (google.pubsub.v1.ISubscription[]|null); + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); - /** ListSubscriptionsResponse nextPageToken */ - nextPageToken?: (string|null); - } + /** MethodDescriptorProto name. */ + public name: string; - /** Represents a ListSubscriptionsResponse. */ - class ListSubscriptionsResponse implements IListSubscriptionsResponse { + /** MethodDescriptorProto inputType. */ + public inputType: string; - /** - * Constructs a new ListSubscriptionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListSubscriptionsResponse); + /** MethodDescriptorProto outputType. */ + public outputType: string; - /** ListSubscriptionsResponse subscriptions. */ - public subscriptions: google.pubsub.v1.ISubscription[]; + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); - /** ListSubscriptionsResponse nextPageToken. */ - public nextPageToken: string; + /** 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; - /** - * Creates a new ListSubscriptionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSubscriptionsResponse instance - */ - public static create(properties?: google.pubsub.v1.IListSubscriptionsResponse): google.pubsub.v1.ListSubscriptionsResponse; + /** + * 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 ListSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. - * @param message ListSubscriptionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListSubscriptionsResponse, 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; - /** - * Encodes the specified ListSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. - * @param message ListSubscriptionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListSubscriptionsResponse, 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 ListSubscriptionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSubscriptionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSubscriptionsResponse; + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - /** - * Decodes a ListSubscriptionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSubscriptionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSubscriptionsResponse; + /** + * 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); - /** - * Verifies a ListSubscriptionsResponse message. - * @param message Plain object 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 ListSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSubscriptionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSubscriptionsResponse; + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a ListSubscriptionsResponse message. Also converts values to other types if specified. - * @param message ListSubscriptionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListSubscriptionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this ListSubscriptionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of a FileOptions. */ + interface IFileOptions { - /** Properties of a DeleteSubscriptionRequest. */ - interface IDeleteSubscriptionRequest { + /** FileOptions javaPackage */ + javaPackage?: (string|null); - /** DeleteSubscriptionRequest subscription */ - subscription?: (string|null); - } + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); - /** Represents a DeleteSubscriptionRequest. */ - class DeleteSubscriptionRequest implements IDeleteSubscriptionRequest { + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); - /** - * Constructs a new DeleteSubscriptionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IDeleteSubscriptionRequest); + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); - /** DeleteSubscriptionRequest subscription. */ - public subscription: string; + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); - /** - * Creates a new DeleteSubscriptionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteSubscriptionRequest instance - */ - public static create(properties?: google.pubsub.v1.IDeleteSubscriptionRequest): google.pubsub.v1.DeleteSubscriptionRequest; + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - /** - * Encodes the specified DeleteSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. - * @param message DeleteSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IDeleteSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileOptions goPackage */ + goPackage?: (string|null); - /** - * Encodes the specified DeleteSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. - * @param message DeleteSubscriptionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IDeleteSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); - /** - * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DeleteSubscriptionRequest; + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); - /** - * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DeleteSubscriptionRequest; + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); - /** - * Verifies a DeleteSubscriptionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); - /** - * Creates a DeleteSubscriptionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteSubscriptionRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSubscriptionRequest; + /** FileOptions deprecated */ + deprecated?: (boolean|null); - /** - * Creates a plain object from a DeleteSubscriptionRequest message. Also converts values to other types if specified. - * @param message DeleteSubscriptionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.DeleteSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); - /** - * Converts this DeleteSubscriptionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); - /** Properties of a ModifyPushConfigRequest. */ - interface IModifyPushConfigRequest { + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); - /** ModifyPushConfigRequest subscription */ - subscription?: (string|null); + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); - /** ModifyPushConfigRequest pushConfig */ - pushConfig?: (google.pubsub.v1.IPushConfig|null); - } + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); - /** Represents a ModifyPushConfigRequest. */ - class ModifyPushConfigRequest implements IModifyPushConfigRequest { + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); - /** - * Constructs a new ModifyPushConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IModifyPushConfigRequest); + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); - /** ModifyPushConfigRequest subscription. */ - public subscription: string; + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); - /** ModifyPushConfigRequest pushConfig. */ - public pushConfig?: (google.pubsub.v1.IPushConfig|null); + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** - * Creates a new ModifyPushConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ModifyPushConfigRequest instance - */ - public static create(properties?: google.pubsub.v1.IModifyPushConfigRequest): google.pubsub.v1.ModifyPushConfigRequest; + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } - /** - * Encodes the specified ModifyPushConfigRequest message. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. - * @param message ModifyPushConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IModifyPushConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { - /** - * Encodes the specified ModifyPushConfigRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. - * @param message ModifyPushConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IModifyPushConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); - /** - * Decodes a ModifyPushConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ModifyPushConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ModifyPushConfigRequest; + /** FileOptions javaPackage. */ + public javaPackage: string; - /** - * Decodes a ModifyPushConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ModifyPushConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ModifyPushConfigRequest; + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; - /** - * Verifies a ModifyPushConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; - /** - * Creates a ModifyPushConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ModifyPushConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ModifyPushConfigRequest; + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; - /** - * Creates a plain object from a ModifyPushConfigRequest message. Also converts values to other types if specified. - * @param message ModifyPushConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ModifyPushConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; - /** - * Converts this ModifyPushConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - /** Properties of a PullRequest. */ - interface IPullRequest { + /** FileOptions goPackage. */ + public goPackage: string; - /** PullRequest subscription */ - subscription?: (string|null); + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; - /** PullRequest returnImmediately */ - returnImmediately?: (boolean|null); + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; - /** PullRequest maxMessages */ - maxMessages?: (number|null); - } + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; - /** Represents a PullRequest. */ - class PullRequest implements IPullRequest { + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; - /** - * Constructs a new PullRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IPullRequest); + /** FileOptions deprecated. */ + public deprecated: boolean; - /** PullRequest subscription. */ - public subscription: string; + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; - /** PullRequest returnImmediately. */ - public returnImmediately: boolean; + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; - /** PullRequest maxMessages. */ - public maxMessages: number; + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; - /** - * Creates a new PullRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PullRequest instance - */ - public static create(properties?: google.pubsub.v1.IPullRequest): google.pubsub.v1.PullRequest; + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; - /** - * Encodes the specified PullRequest message. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. - * @param message PullRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; - /** - * Encodes the specified PullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. - * @param message PullRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileOptions phpNamespace. */ + public phpNamespace: string; - /** - * Decodes a PullRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PullRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PullRequest; + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; - /** - * Decodes a PullRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PullRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PullRequest; + /** FileOptions rubyPackage. */ + public rubyPackage: string; - /** - * Verifies a PullRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * Creates a PullRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PullRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PullRequest; + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - /** - * Creates a plain object from a PullRequest message. Also converts values to other types if specified. - * @param message PullRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PullRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this PullRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** Properties of a PullResponse. */ - interface IPullResponse { + /** + * 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; - /** PullResponse receivedMessages */ - receivedMessages?: (google.pubsub.v1.IReceivedMessage[]|null); - } + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - /** Represents a PullResponse. */ - class PullResponse implements IPullResponse { + /** + * 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); - /** - * Constructs a new PullResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IPullResponse); + /** + * 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; - /** PullResponse receivedMessages. */ - public receivedMessages: google.pubsub.v1.IReceivedMessage[]; + /** + * 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 }; - /** - * Creates a new PullResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns PullResponse instance - */ - public static create(properties?: google.pubsub.v1.IPullResponse): google.pubsub.v1.PullResponse; + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified PullResponse message. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. - * @param message PullResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; + namespace FileOptions { - /** - * Encodes the specified PullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. - * @param message PullResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } - /** - * Decodes a PullResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PullResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PullResponse; + /** Properties of a MessageOptions. */ + interface IMessageOptions { - /** - * Decodes a PullResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PullResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PullResponse; + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); - /** - * Verifies a PullResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); - /** - * Creates a PullResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PullResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PullResponse; + /** MessageOptions deprecated */ + deprecated?: (boolean|null); - /** - * Creates a plain object from a PullResponse message. Also converts values to other types if specified. - * @param message PullResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.PullResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); - /** - * Converts this PullResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** Properties of a ModifyAckDeadlineRequest. */ - interface IModifyAckDeadlineRequest { + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } - /** ModifyAckDeadlineRequest subscription */ - subscription?: (string|null); + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { - /** ModifyAckDeadlineRequest ackIds */ - ackIds?: (string[]|null); + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); - /** ModifyAckDeadlineRequest ackDeadlineSeconds */ - ackDeadlineSeconds?: (number|null); - } + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; - /** Represents a ModifyAckDeadlineRequest. */ - class ModifyAckDeadlineRequest implements IModifyAckDeadlineRequest { + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; - /** - * Constructs a new ModifyAckDeadlineRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IModifyAckDeadlineRequest); + /** MessageOptions deprecated. */ + public deprecated: boolean; - /** ModifyAckDeadlineRequest subscription. */ - public subscription: string; + /** MessageOptions mapEntry. */ + public mapEntry: boolean; - /** ModifyAckDeadlineRequest ackIds. */ - public ackIds: string[]; + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** ModifyAckDeadlineRequest ackDeadlineSeconds. */ - public ackDeadlineSeconds: number; + /** + * 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; - /** - * Creates a new ModifyAckDeadlineRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ModifyAckDeadlineRequest instance - */ - public static create(properties?: google.pubsub.v1.IModifyAckDeadlineRequest): google.pubsub.v1.ModifyAckDeadlineRequest; + /** + * 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 ModifyAckDeadlineRequest message. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. - * @param message ModifyAckDeadlineRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IModifyAckDeadlineRequest, 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; - /** - * Encodes the specified ModifyAckDeadlineRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. - * @param message ModifyAckDeadlineRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IModifyAckDeadlineRequest, 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 ModifyAckDeadlineRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ModifyAckDeadlineRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ModifyAckDeadlineRequest; + /** + * 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; - /** - * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ModifyAckDeadlineRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ModifyAckDeadlineRequest; + /** + * 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); - /** - * Verifies a ModifyAckDeadlineRequest message. - * @param message Plain object 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 ModifyAckDeadlineRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ModifyAckDeadlineRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ModifyAckDeadlineRequest; + /** + * 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 }; - /** - * Creates a plain object from a ModifyAckDeadlineRequest message. Also converts values to other types if specified. - * @param message ModifyAckDeadlineRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ModifyAckDeadlineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this ModifyAckDeadlineRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of a FieldOptions. */ + interface IFieldOptions { - /** Properties of an AcknowledgeRequest. */ - interface IAcknowledgeRequest { + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - /** AcknowledgeRequest subscription */ - subscription?: (string|null); + /** FieldOptions packed */ + packed?: (boolean|null); - /** AcknowledgeRequest ackIds */ - ackIds?: (string[]|null); - } + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - /** Represents an AcknowledgeRequest. */ - class AcknowledgeRequest implements IAcknowledgeRequest { + /** FieldOptions lazy */ + lazy?: (boolean|null); - /** - * Constructs a new AcknowledgeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IAcknowledgeRequest); + /** FieldOptions deprecated */ + deprecated?: (boolean|null); - /** AcknowledgeRequest subscription. */ - public subscription: string; + /** FieldOptions weak */ + weak?: (boolean|null); - /** AcknowledgeRequest ackIds. */ - public ackIds: string[]; + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** - * Creates a new AcknowledgeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns AcknowledgeRequest instance - */ - public static create(properties?: google.pubsub.v1.IAcknowledgeRequest): google.pubsub.v1.AcknowledgeRequest; + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - /** - * Encodes the specified AcknowledgeRequest message. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. - * @param message AcknowledgeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IAcknowledgeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } - /** - * Encodes the specified AcknowledgeRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. - * @param message AcknowledgeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IAcknowledgeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { - /** - * Decodes an AcknowledgeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AcknowledgeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.AcknowledgeRequest; + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); - /** - * Decodes an AcknowledgeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AcknowledgeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.AcknowledgeRequest; + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - /** - * Verifies an AcknowledgeRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FieldOptions packed. */ + public packed: boolean; - /** - * Creates an AcknowledgeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AcknowledgeRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.AcknowledgeRequest; + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - /** - * Creates a plain object from an AcknowledgeRequest message. Also converts values to other types if specified. - * @param message AcknowledgeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.AcknowledgeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FieldOptions lazy. */ + public lazy: boolean; - /** - * Converts this AcknowledgeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FieldOptions deprecated. */ + public deprecated: boolean; - /** Properties of a StreamingPullRequest. */ - interface IStreamingPullRequest { + /** FieldOptions weak. */ + public weak: boolean; - /** StreamingPullRequest subscription */ - subscription?: (string|null); + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** StreamingPullRequest ackIds */ - ackIds?: (string[]|null); + /** + * 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; - /** StreamingPullRequest modifyDeadlineSeconds */ - modifyDeadlineSeconds?: (number[]|null); + /** + * 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; - /** StreamingPullRequest modifyDeadlineAckIds */ - modifyDeadlineAckIds?: (string[]|null); + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** StreamingPullRequest streamAckDeadlineSeconds */ - streamAckDeadlineSeconds?: (number|null); + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - /** StreamingPullRequest clientId */ - clientId?: (string|null); - } + /** + * 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; - /** Represents a StreamingPullRequest. */ - class StreamingPullRequest implements IStreamingPullRequest { + /** + * 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); - /** - * Constructs a new StreamingPullRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IStreamingPullRequest); + /** + * 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; - /** StreamingPullRequest subscription. */ - public subscription: string; + /** + * 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 }; - /** StreamingPullRequest ackIds. */ - public ackIds: string[]; + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** StreamingPullRequest modifyDeadlineSeconds. */ - public modifyDeadlineSeconds: number[]; + namespace FieldOptions { - /** StreamingPullRequest modifyDeadlineAckIds. */ - public modifyDeadlineAckIds: string[]; + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } - /** StreamingPullRequest streamAckDeadlineSeconds. */ - public streamAckDeadlineSeconds: number; + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } - /** StreamingPullRequest clientId. */ - public clientId: string; + /** Properties of an OneofOptions. */ + interface IOneofOptions { - /** - * Creates a new StreamingPullRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns StreamingPullRequest instance - */ - public static create(properties?: google.pubsub.v1.IStreamingPullRequest): google.pubsub.v1.StreamingPullRequest; + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { - /** - * Encodes the specified StreamingPullRequest message. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. - * @param message StreamingPullRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IStreamingPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); - /** - * Encodes the specified StreamingPullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. - * @param message StreamingPullRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IStreamingPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * Decodes a StreamingPullRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StreamingPullRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.StreamingPullRequest; + /** + * 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; - /** - * Decodes a StreamingPullRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StreamingPullRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.StreamingPullRequest; + /** + * 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; - /** - * Verifies a StreamingPullRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified 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; - /** - * Creates a StreamingPullRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StreamingPullRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullRequest; + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - /** - * Creates a plain object from a StreamingPullRequest message. Also converts values to other types if specified. - * @param message StreamingPullRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.StreamingPullRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this StreamingPullRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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); - /** Properties of a StreamingPullResponse. */ - interface IStreamingPullResponse { + /** + * 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; - /** StreamingPullResponse receivedMessages */ - receivedMessages?: (google.pubsub.v1.IReceivedMessage[]|null); - } + /** + * 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 }; - /** Represents a StreamingPullResponse. */ - class StreamingPullResponse implements IStreamingPullResponse { + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new StreamingPullResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IStreamingPullResponse); + /** Properties of an EnumOptions. */ + interface IEnumOptions { - /** StreamingPullResponse receivedMessages. */ - public receivedMessages: google.pubsub.v1.IReceivedMessage[]; + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); - /** - * Creates a new StreamingPullResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns StreamingPullResponse instance - */ - public static create(properties?: google.pubsub.v1.IStreamingPullResponse): google.pubsub.v1.StreamingPullResponse; + /** EnumOptions deprecated */ + deprecated?: (boolean|null); - /** - * Encodes the specified StreamingPullResponse message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. - * @param message StreamingPullResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IStreamingPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } - /** - * Encodes the specified StreamingPullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. - * @param message StreamingPullResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IStreamingPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { - /** - * Decodes a StreamingPullResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StreamingPullResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.StreamingPullResponse; + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); - /** - * Decodes a StreamingPullResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StreamingPullResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.StreamingPullResponse; + /** EnumOptions allowAlias. */ + public allowAlias: boolean; - /** - * Verifies a StreamingPullResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** EnumOptions deprecated. */ + public deprecated: boolean; - /** - * Creates a StreamingPullResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StreamingPullResponse - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullResponse; + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * Creates a plain object from a StreamingPullResponse message. Also converts values to other types if specified. - * @param message StreamingPullResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.StreamingPullResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this StreamingPullResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** Properties of a CreateSnapshotRequest. */ - interface ICreateSnapshotRequest { + /** + * 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; - /** CreateSnapshotRequest name */ - name?: (string|null); + /** + * 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; - /** CreateSnapshotRequest subscription */ - subscription?: (string|null); + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** CreateSnapshotRequest labels */ - labels?: ({ [k: string]: 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; - /** Represents a CreateSnapshotRequest. */ - class CreateSnapshotRequest implements ICreateSnapshotRequest { + /** + * 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 }; - /** - * Constructs a new CreateSnapshotRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ICreateSnapshotRequest); + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** CreateSnapshotRequest name. */ - public name: string; + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { - /** CreateSnapshotRequest subscription. */ - public subscription: string; + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); - /** CreateSnapshotRequest labels. */ - public labels: { [k: string]: string }; + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } - /** - * Creates a new CreateSnapshotRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSnapshotRequest instance - */ - public static create(properties?: google.pubsub.v1.ICreateSnapshotRequest): google.pubsub.v1.CreateSnapshotRequest; + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { - /** - * Encodes the specified CreateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. - * @param message CreateSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ICreateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); - /** - * Encodes the specified CreateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. - * @param message CreateSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ICreateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** EnumValueOptions deprecated. */ + public deprecated: boolean; - /** - * Decodes a CreateSnapshotRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.CreateSnapshotRequest; + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * Decodes a CreateSnapshotRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.CreateSnapshotRequest; + /** + * 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; - /** - * Verifies a CreateSnapshotRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified 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; - /** - * Creates a CreateSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSnapshotRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CreateSnapshotRequest; + /** + * 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; - /** - * Creates a plain object from a CreateSnapshotRequest message. Also converts values to other types if specified. - * @param message CreateSnapshotRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.CreateSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this CreateSnapshotRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** Properties of an UpdateSnapshotRequest. */ - interface IUpdateSnapshotRequest { + /** + * 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); - /** UpdateSnapshotRequest snapshot */ - snapshot?: (google.pubsub.v1.ISnapshot|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; - /** UpdateSnapshotRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents an UpdateSnapshotRequest. */ - class UpdateSnapshotRequest implements IUpdateSnapshotRequest { + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new UpdateSnapshotRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IUpdateSnapshotRequest); + /** Properties of a ServiceOptions. */ + interface IServiceOptions { - /** UpdateSnapshotRequest snapshot. */ - public snapshot?: (google.pubsub.v1.ISnapshot|null); + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); - /** UpdateSnapshotRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** - * Creates a new UpdateSnapshotRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateSnapshotRequest instance - */ - public static create(properties?: google.pubsub.v1.IUpdateSnapshotRequest): google.pubsub.v1.UpdateSnapshotRequest; + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); - /** - * Encodes the specified UpdateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. - * @param message UpdateSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IUpdateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } - /** - * Encodes the specified UpdateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. - * @param message UpdateSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IUpdateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { - /** - * Decodes an UpdateSnapshotRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.UpdateSnapshotRequest; + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); - /** - * Decodes an UpdateSnapshotRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.UpdateSnapshotRequest; + /** ServiceOptions deprecated. */ + public deprecated: boolean; - /** - * Verifies an UpdateSnapshotRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * Creates an UpdateSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateSnapshotRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateSnapshotRequest; + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - /** - * Creates a plain object from an UpdateSnapshotRequest message. Also converts values to other types if specified. - * @param message UpdateSnapshotRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.UpdateSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this UpdateSnapshotRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a Snapshot. */ - interface ISnapshot { + /** + * 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; - /** Snapshot name */ - name?: (string|null); + /** + * 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; - /** Snapshot topic */ - topic?: (string|null); + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Snapshot expireTime */ - expireTime?: (google.protobuf.ITimestamp|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; - /** Snapshot labels */ - labels?: ({ [k: string]: string }|null); - } + /** + * 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 }; - /** Represents a Snapshot. */ - class Snapshot implements ISnapshot { + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new Snapshot. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.ISnapshot); + /** Properties of a MethodOptions. */ + interface IMethodOptions { - /** Snapshot name. */ - public name: string; + /** MethodOptions deprecated */ + deprecated?: (boolean|null); - /** Snapshot topic. */ - public topic: string; + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - /** Snapshot expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** Snapshot labels. */ - public labels: { [k: string]: string }; + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); - /** - * Creates a new Snapshot instance using the specified properties. - * @param [properties] Properties to set - * @returns Snapshot instance - */ - public static create(properties?: google.pubsub.v1.ISnapshot): google.pubsub.v1.Snapshot; + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } - /** - * Encodes the specified Snapshot message. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. - * @param message Snapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { - /** - * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. - * @param message Snapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); - /** - * Decodes a Snapshot message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Snapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.Snapshot; + /** MethodOptions deprecated. */ + public deprecated: boolean; - /** - * Decodes a Snapshot message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Snapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.Snapshot; + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - /** - * Verifies a Snapshot message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Snapshot - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Snapshot; + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - /** - * Creates a plain object from a Snapshot message. Also converts values to other types if specified. - * @param message Snapshot - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.Snapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this Snapshot to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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; - /** Properties of a GetSnapshotRequest. */ - interface IGetSnapshotRequest { + /** + * 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); - /** GetSnapshotRequest snapshot */ - snapshot?: (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; - /** Represents a GetSnapshotRequest. */ - class GetSnapshotRequest implements IGetSnapshotRequest { + /** + * 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 }; - /** - * Constructs a new GetSnapshotRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IGetSnapshotRequest); + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** GetSnapshotRequest snapshot. */ - public snapshot: string; + namespace MethodOptions { - /** - * Creates a new GetSnapshotRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetSnapshotRequest instance - */ - public static create(properties?: google.pubsub.v1.IGetSnapshotRequest): google.pubsub.v1.GetSnapshotRequest; + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } - /** - * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. - * @param message GetSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { - /** - * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. - * @param message GetSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - /** - * Decodes a GetSnapshotRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.GetSnapshotRequest; + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); - /** - * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.GetSnapshotRequest; + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); - /** - * Verifies a GetSnapshotRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); - /** - * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetSnapshotRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetSnapshotRequest; + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); - /** - * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. - * @param message GetSnapshotRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.GetSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); - /** - * Converts this GetSnapshotRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } - /** Properties of a ListSnapshotsRequest. */ - interface IListSnapshotsRequest { + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { - /** ListSnapshotsRequest project */ - project?: (string|null); + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); - /** ListSnapshotsRequest pageSize */ - pageSize?: (number|null); + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; - /** ListSnapshotsRequest pageToken */ - pageToken?: (string|null); - } + /** UninterpretedOption identifierValue. */ + public identifierValue: string; - /** Represents a ListSnapshotsRequest. */ - class ListSnapshotsRequest implements IListSnapshotsRequest { + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); - /** - * Constructs a new ListSnapshotsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IListSnapshotsRequest); + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); - /** ListSnapshotsRequest project. */ - public project: string; + /** UninterpretedOption doubleValue. */ + public doubleValue: number; - /** ListSnapshotsRequest pageSize. */ - public pageSize: number; + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); - /** ListSnapshotsRequest pageToken. */ - public pageToken: string; + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; - /** - * Creates a new ListSnapshotsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSnapshotsRequest instance - */ - public static create(properties?: google.pubsub.v1.IListSnapshotsRequest): google.pubsub.v1.ListSnapshotsRequest; + /** + * 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 ListSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. - * @param message ListSnapshotsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. - * @param message ListSnapshotsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IListSnapshotsRequest, 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 a ListSnapshotsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSnapshotsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSnapshotsRequest; + /** + * 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 a ListSnapshotsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSnapshotsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSnapshotsRequest; + /** + * 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 a ListSnapshotsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies an 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 ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSnapshotsRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSnapshotsRequest; + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. - * @param message ListSnapshotsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.ListSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this ListSnapshotsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + namespace UninterpretedOption { - /** Properties of a ListSnapshotsResponse. */ - interface IListSnapshotsResponse { + /** Properties of a NamePart. */ + interface INamePart { - /** ListSnapshotsResponse snapshots */ - snapshots?: (google.pubsub.v1.ISnapshot[]|null); + /** NamePart namePart */ + namePart: string; - /** ListSnapshotsResponse nextPageToken */ - nextPageToken?: (string|null); + /** NamePart isExtension */ + isExtension: boolean; } - /** Represents a ListSnapshotsResponse. */ - class ListSnapshotsResponse implements IListSnapshotsResponse { + /** Represents a NamePart. */ + class NamePart implements INamePart { /** - * Constructs a new ListSnapshotsResponse. + * Constructs a new NamePart. * @param [properties] Properties to set */ - constructor(properties?: google.pubsub.v1.IListSnapshotsResponse); + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - /** ListSnapshotsResponse snapshots. */ - public snapshots: google.pubsub.v1.ISnapshot[]; + /** NamePart namePart. */ + public namePart: string; - /** ListSnapshotsResponse nextPageToken. */ - public nextPageToken: string; + /** NamePart isExtension. */ + public isExtension: boolean; /** - * Creates a new ListSnapshotsResponse instance using the specified properties. + * Creates a new NamePart instance using the specified properties. * @param [properties] Properties to set - * @returns ListSnapshotsResponse instance + * @returns NamePart instance */ - public static create(properties?: google.pubsub.v1.IListSnapshotsResponse): google.pubsub.v1.ListSnapshotsResponse; + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; /** - * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. - * @param message ListSnapshotsResponse message or plain object to encode + * 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.pubsub.v1.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. - * @param message ListSnapshotsResponse message or plain object to encode + * 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.pubsub.v1.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListSnapshotsResponse message from the specified reader or buffer. + * 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 ListSnapshotsResponse + * @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.pubsub.v1.ListSnapshotsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; /** - * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. + * Decodes a NamePart message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListSnapshotsResponse + * @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.pubsub.v1.ListSnapshotsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; /** - * Verifies a ListSnapshotsResponse message. + * 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 ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListSnapshotsResponse + * @returns NamePart */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSnapshotsResponse; + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; /** - * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. - * @param message ListSnapshotsResponse + * 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.pubsub.v1.ListSnapshotsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListSnapshotsResponse to JSON. + * Converts this NamePart to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of a DeleteSnapshotRequest. */ - interface IDeleteSnapshotRequest { + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { - /** DeleteSnapshotRequest snapshot */ - snapshot?: (string|null); - } + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } - /** Represents a DeleteSnapshotRequest. */ - class DeleteSnapshotRequest implements IDeleteSnapshotRequest { + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { - /** - * Constructs a new DeleteSnapshotRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.pubsub.v1.IDeleteSnapshotRequest); + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); - /** DeleteSnapshotRequest snapshot. */ - public snapshot: string; + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; - /** - * Creates a new DeleteSnapshotRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteSnapshotRequest instance - */ - public static create(properties?: google.pubsub.v1.IDeleteSnapshotRequest): google.pubsub.v1.DeleteSnapshotRequest; + /** + * 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 DeleteSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. - * @param message DeleteSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.pubsub.v1.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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 DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. - * @param message DeleteSnapshotRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.pubsub.v1.IDeleteSnapshotRequest, 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 DeleteSnapshotRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DeleteSnapshotRequest; + /** + * 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 DeleteSnapshotRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DeleteSnapshotRequest; + /** + * 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 DeleteSnapshotRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies a 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 DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteSnapshotRequest - */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSnapshotRequest; + /** + * 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 }; + } + + namespace SourceCodeInfo { - /** - * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. - * @param message DeleteSnapshotRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.pubsub.v1.DeleteSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of a Location. */ + interface ILocation { - /** - * Converts this DeleteSnapshotRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Location path */ + path?: (number[]|null); - /** Properties of a SeekRequest. */ - interface ISeekRequest { + /** Location span */ + span?: (number[]|null); - /** SeekRequest subscription */ - subscription?: (string|null); + /** Location leadingComments */ + leadingComments?: (string|null); - /** SeekRequest time */ - time?: (google.protobuf.ITimestamp|null); + /** Location trailingComments */ + trailingComments?: (string|null); - /** SeekRequest snapshot */ - snapshot?: (string|null); + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); } - /** Represents a SeekRequest. */ - class SeekRequest implements ISeekRequest { + /** Represents a Location. */ + class Location implements ILocation { /** - * Constructs a new SeekRequest. + * Constructs a new Location. * @param [properties] Properties to set */ - constructor(properties?: google.pubsub.v1.ISeekRequest); + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - /** SeekRequest subscription. */ - public subscription: string; + /** Location path. */ + public path: number[]; - /** SeekRequest time. */ - public time?: (google.protobuf.ITimestamp|null); + /** Location span. */ + public span: number[]; - /** SeekRequest snapshot. */ - public snapshot: string; + /** Location leadingComments. */ + public leadingComments: string; - /** SeekRequest target. */ - public target?: ("time"|"snapshot"); + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; /** - * Creates a new SeekRequest instance using the specified properties. + * Creates a new Location instance using the specified properties. * @param [properties] Properties to set - * @returns SeekRequest instance + * @returns Location instance */ - public static create(properties?: google.pubsub.v1.ISeekRequest): google.pubsub.v1.SeekRequest; + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; /** - * Encodes the specified SeekRequest message. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. - * @param message SeekRequest message or plain object to encode + * 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.pubsub.v1.ISeekRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SeekRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. - * @param message SeekRequest message or plain object to encode + * 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.pubsub.v1.ISeekRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SeekRequest message from the specified reader or buffer. + * 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 SeekRequest + * @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.pubsub.v1.SeekRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; /** - * Decodes a SeekRequest message from the specified reader or buffer, length delimited. + * Decodes a Location message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SeekRequest + * @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.pubsub.v1.SeekRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; /** - * Verifies a SeekRequest message. + * 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 SeekRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Location message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SeekRequest + * @returns Location */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.SeekRequest; + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; /** - * Creates a plain object from a SeekRequest message. Also converts values to other types if specified. - * @param message SeekRequest + * 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.pubsub.v1.SeekRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SeekRequest to JSON. + * Converts this Location to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of a SeekResponse. */ - interface ISeekResponse { + /** 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 }; + } + + 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); } - /** Represents a SeekResponse. */ - class SeekResponse implements ISeekResponse { + /** Represents an Annotation. */ + class Annotation implements IAnnotation { /** - * Constructs a new SeekResponse. + * Constructs a new Annotation. * @param [properties] Properties to set */ - constructor(properties?: google.pubsub.v1.ISeekResponse); + 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; /** - * Creates a new SeekResponse instance using the specified properties. + * Creates a new Annotation instance using the specified properties. * @param [properties] Properties to set - * @returns SeekResponse instance + * @returns Annotation instance */ - public static create(properties?: google.pubsub.v1.ISeekResponse): google.pubsub.v1.SeekResponse; + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Encodes the specified SeekResponse message. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. - * @param message SeekResponse message or plain object to encode + * 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.pubsub.v1.ISeekResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SeekResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. - * @param message SeekResponse message or plain object to encode + * 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.pubsub.v1.ISeekResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SeekResponse message from the specified reader or buffer. + * 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 SeekResponse + * @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.pubsub.v1.SeekResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Decodes a SeekResponse message from the specified reader or buffer, length delimited. + * Decodes an Annotation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SeekResponse + * @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.pubsub.v1.SeekResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Verifies a SeekResponse message. + * 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 a SeekResponse message from a plain object. Also converts values to their respective internal types. + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SeekResponse + * @returns Annotation */ - public static fromObject(object: { [k: string]: any }): google.pubsub.v1.SeekResponse; + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Creates a plain object from a SeekResponse message. Also converts values to other types if specified. - * @param message SeekResponse + * 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.pubsub.v1.SeekResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SeekResponse to JSON. + * Converts this Annotation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } } - } - /** Namespace api. */ - namespace api { + /** Properties of a Duration. */ + interface IDuration { - /** Properties of a Http. */ - interface IHttp { + /** Duration seconds */ + seconds?: (number|Long|string|null); - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); + /** Duration nanos */ + nanos?: (number|null); + } - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|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 }; } - /** Represents a Http. */ - class Http implements IHttp { + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { /** - * Constructs a new Http. + * Constructs a new Empty. * @param [properties] Properties to set */ - constructor(properties?: google.api.IHttp); + constructor(properties?: google.protobuf.IEmpty); - /** Http rules. */ - public rules: google.api.IHttpRule[]; + /** + * 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; - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; + /** + * 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; /** - * Creates a new Http instance using the specified properties. + * 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 }; + } + + /** 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 - * @returns Http instance */ - public static create(properties?: google.api.IHttp): google.api.Http; + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode + * 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.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode + * Encodes the specified 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.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a FieldMask message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Http + * @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.api.Http; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a FieldMask message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Http + * @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.api.Http; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; /** - * Verifies a Http message. + * Verifies a FieldMask message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Http + * @returns FieldMask */ - public static fromObject(object: { [k: string]: any }): google.api.Http; + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http + * Creates a plain object from a 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.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Http to JSON. + * Converts this FieldMask to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** 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); + /** Properties of a Timestamp. */ + interface ITimestamp { - /** HttpRule responseBody */ - responseBody?: (string|null); + /** Timestamp seconds */ + seconds?: (number|Long|string|null); - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); + /** Timestamp nanos */ + nanos?: (number|null); } - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { /** - * Constructs a new HttpRule. + * Constructs a new Timestamp. * @param [properties] Properties to set */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get: string; - - /** HttpRule put. */ - public put: string; - - /** HttpRule post. */ - public post: string; - - /** HttpRule delete. */ - public delete: string; - - /** HttpRule patch. */ - public patch: string; - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule responseBody. */ - public responseBody: string; + constructor(properties?: google.protobuf.ITimestamp); - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; + /** Timestamp seconds. */ + public seconds: (number|Long|string); - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + /** Timestamp nanos. */ + public nanos: number; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new Timestamp instance using the specified properties. * @param [properties] Properties to set - * @returns HttpRule instance + * @returns Timestamp instance */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a Timestamp message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HttpRule + * @returns Timestamp * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HttpRule + * @returns Timestamp * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; /** - * Verifies a HttpRule message. + * Verifies a Timestamp message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HttpRule + * @returns Timestamp */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HttpRule to JSON. + * Converts this Timestamp to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { + /** Namespace pubsub. */ + namespace pubsub { - /** CustomHttpPattern kind */ - kind?: (string|null); + /** Namespace v1. */ + namespace v1 { - /** CustomHttpPattern path */ - path?: (string|null); - } + /** Represents a Publisher */ + class Publisher extends $protobuf.rpc.Service { - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { + /** + * Constructs a new Publisher 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); - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); + /** + * Creates new Publisher 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): Publisher; - /** CustomHttpPattern kind. */ - public kind: string; + /** + * Calls CreateTopic. + * @param request Topic message or plain object + * @param callback Node-style callback called with the error, if any, and Topic + */ + public createTopic(request: google.pubsub.v1.ITopic, callback: google.pubsub.v1.Publisher.CreateTopicCallback): void; - /** CustomHttpPattern path. */ - public path: string; + /** + * Calls CreateTopic. + * @param request Topic message or plain object + * @returns Promise + */ + public createTopic(request: google.pubsub.v1.ITopic): Promise; - /** - * 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; + /** + * Calls UpdateTopic. + * @param request UpdateTopicRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Topic + */ + public updateTopic(request: google.pubsub.v1.IUpdateTopicRequest, callback: google.pubsub.v1.Publisher.UpdateTopicCallback): void; - /** - * 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; + /** + * Calls UpdateTopic. + * @param request UpdateTopicRequest message or plain object + * @returns Promise + */ + public updateTopic(request: google.pubsub.v1.IUpdateTopicRequest): Promise; - /** - * 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; + /** + * Calls Publish. + * @param request PublishRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PublishResponse + */ + public publish(request: google.pubsub.v1.IPublishRequest, callback: google.pubsub.v1.Publisher.PublishCallback): void; + + /** + * Calls Publish. + * @param request PublishRequest message or plain object + * @returns Promise + */ + public publish(request: google.pubsub.v1.IPublishRequest): Promise; + + /** + * Calls GetTopic. + * @param request GetTopicRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Topic + */ + public getTopic(request: google.pubsub.v1.IGetTopicRequest, callback: google.pubsub.v1.Publisher.GetTopicCallback): void; + + /** + * Calls GetTopic. + * @param request GetTopicRequest message or plain object + * @returns Promise + */ + public getTopic(request: google.pubsub.v1.IGetTopicRequest): Promise; - /** - * 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; + /** + * Calls ListTopics. + * @param request ListTopicsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTopicsResponse + */ + public listTopics(request: google.pubsub.v1.IListTopicsRequest, callback: google.pubsub.v1.Publisher.ListTopicsCallback): void; - /** - * 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; + /** + * Calls ListTopics. + * @param request ListTopicsRequest message or plain object + * @returns Promise + */ + public listTopics(request: google.pubsub.v1.IListTopicsRequest): Promise; - /** - * 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); + /** + * Calls ListTopicSubscriptions. + * @param request ListTopicSubscriptionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTopicSubscriptionsResponse + */ + public listTopicSubscriptions(request: google.pubsub.v1.IListTopicSubscriptionsRequest, callback: google.pubsub.v1.Publisher.ListTopicSubscriptionsCallback): void; - /** - * 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; + /** + * Calls ListTopicSubscriptions. + * @param request ListTopicSubscriptionsRequest message or plain object + * @returns Promise + */ + public listTopicSubscriptions(request: google.pubsub.v1.IListTopicSubscriptionsRequest): Promise; - /** - * 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 }; + /** + * Calls ListTopicSnapshots. + * @param request ListTopicSnapshotsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTopicSnapshotsResponse + */ + public listTopicSnapshots(request: google.pubsub.v1.IListTopicSnapshotsRequest, callback: google.pubsub.v1.Publisher.ListTopicSnapshotsCallback): void; - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Calls ListTopicSnapshots. + * @param request ListTopicSnapshotsRequest message or plain object + * @returns Promise + */ + public listTopicSnapshots(request: google.pubsub.v1.IListTopicSnapshotsRequest): Promise; - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5 - } + /** + * Calls DeleteTopic. + * @param request DeleteTopicRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTopic(request: google.pubsub.v1.IDeleteTopicRequest, callback: google.pubsub.v1.Publisher.DeleteTopicCallback): void; - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { + /** + * Calls DeleteTopic. + * @param request DeleteTopicRequest message or plain object + * @returns Promise + */ + public deleteTopic(request: google.pubsub.v1.IDeleteTopicRequest): Promise; + } - /** ResourceDescriptor type */ - type?: (string|null); + namespace Publisher { - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); + /** + * Callback as used by {@link google.pubsub.v1.Publisher#createTopic}. + * @param error Error, if any + * @param [response] Topic + */ + type CreateTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; - /** ResourceDescriptor nameField */ - nameField?: (string|null); + /** + * Callback as used by {@link google.pubsub.v1.Publisher#updateTopic}. + * @param error Error, if any + * @param [response] Topic + */ + type UpdateTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + /** + * Callback as used by {@link google.pubsub.v1.Publisher#publish}. + * @param error Error, if any + * @param [response] PublishResponse + */ + type PublishCallback = (error: (Error|null), response?: google.pubsub.v1.PublishResponse) => void; - /** ResourceDescriptor plural */ - plural?: (string|null); + /** + * Callback as used by {@link google.pubsub.v1.Publisher#getTopic}. + * @param error Error, if any + * @param [response] Topic + */ + type GetTopicCallback = (error: (Error|null), response?: google.pubsub.v1.Topic) => void; - /** ResourceDescriptor singular */ - singular?: (string|null); - } + /** + * Callback as used by {@link google.pubsub.v1.Publisher#listTopics}. + * @param error Error, if any + * @param [response] ListTopicsResponse + */ + type ListTopicsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicsResponse) => void; - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { + /** + * Callback as used by {@link google.pubsub.v1.Publisher#listTopicSubscriptions}. + * @param error Error, if any + * @param [response] ListTopicSubscriptionsResponse + */ + type ListTopicSubscriptionsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicSubscriptionsResponse) => void; - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); + /** + * Callback as used by {@link google.pubsub.v1.Publisher#listTopicSnapshots}. + * @param error Error, if any + * @param [response] ListTopicSnapshotsResponse + */ + type ListTopicSnapshotsCallback = (error: (Error|null), response?: google.pubsub.v1.ListTopicSnapshotsResponse) => void; - /** ResourceDescriptor type. */ - public type: string; + /** + * Callback as used by {@link google.pubsub.v1.Publisher#deleteTopic}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTopicCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } - /** ResourceDescriptor pattern. */ - public pattern: string[]; + /** Properties of a MessageStoragePolicy. */ + interface IMessageStoragePolicy { - /** ResourceDescriptor nameField. */ - public nameField: string; + /** MessageStoragePolicy allowedPersistenceRegions */ + allowedPersistenceRegions?: (string[]|null); + } - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + /** Represents a MessageStoragePolicy. */ + class MessageStoragePolicy implements IMessageStoragePolicy { - /** ResourceDescriptor plural. */ - public plural: string; + /** + * Constructs a new MessageStoragePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IMessageStoragePolicy); - /** ResourceDescriptor singular. */ - public singular: string; + /** MessageStoragePolicy allowedPersistenceRegions. */ + public allowedPersistenceRegions: string[]; - /** - * 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; + /** + * Creates a new MessageStoragePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageStoragePolicy instance + */ + public static create(properties?: google.pubsub.v1.IMessageStoragePolicy): google.pubsub.v1.MessageStoragePolicy; - /** - * 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 MessageStoragePolicy message. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. + * @param message MessageStoragePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IMessageStoragePolicy, 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; + /** + * Encodes the specified MessageStoragePolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. + * @param message MessageStoragePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IMessageStoragePolicy, 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 MessageStoragePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageStoragePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.MessageStoragePolicy; - /** - * 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; + /** + * Decodes a MessageStoragePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageStoragePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.MessageStoragePolicy; - /** - * 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); + /** + * Verifies a MessageStoragePolicy message. + * @param message Plain object 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 MessageStoragePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageStoragePolicy + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.MessageStoragePolicy; - /** - * 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 }; + /** + * Creates a plain object from a MessageStoragePolicy message. Also converts values to other types if specified. + * @param message MessageStoragePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.MessageStoragePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this MessageStoragePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - namespace ResourceDescriptor { + /** Properties of a Topic. */ + interface ITopic { - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - } + /** Topic name */ + name?: (string|null); - /** Properties of a ResourceReference. */ - interface IResourceReference { + /** Topic labels */ + labels?: ({ [k: string]: string }|null); - /** ResourceReference type */ - type?: (string|null); + /** Topic messageStoragePolicy */ + messageStoragePolicy?: (google.pubsub.v1.IMessageStoragePolicy|null); - /** ResourceReference childType */ - childType?: (string|null); - } + /** Topic kmsKeyName */ + kmsKeyName?: (string|null); + } - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { + /** Represents a Topic. */ + class Topic implements ITopic { - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); + /** + * Constructs a new Topic. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ITopic); - /** ResourceReference type. */ - public type: string; + /** Topic name. */ + public name: string; - /** ResourceReference childType. */ - public childType: string; + /** Topic labels. */ + public labels: { [k: string]: 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; + /** Topic messageStoragePolicy. */ + public messageStoragePolicy?: (google.pubsub.v1.IMessageStoragePolicy|null); - /** - * 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; + /** Topic kmsKeyName. */ + public kmsKeyName: string; - /** - * 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; + /** + * Creates a new Topic instance using the specified properties. + * @param [properties] Properties to set + * @returns Topic instance + */ + public static create(properties?: google.pubsub.v1.ITopic): google.pubsub.v1.Topic; - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + /** + * Encodes the specified Topic message. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. + * @param message Topic message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ITopic, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + /** + * Encodes the specified Topic message, length delimited. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. + * @param message Topic message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ITopic, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a ResourceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a Topic message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Topic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.Topic; - /** - * 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; + /** + * Decodes a Topic message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Topic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.Topic; - /** - * 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 }; + /** + * Verifies a Topic message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Creates a Topic message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Topic + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Topic; - /** Namespace protobuf. */ - namespace protobuf { + /** + * Creates a plain object from a Topic message. Also converts values to other types if specified. + * @param message Topic + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.Topic, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { + /** + * Converts this Topic to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } + /** Properties of a PubsubMessage. */ + interface IPubsubMessage { - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { + /** PubsubMessage data */ + data?: (Uint8Array|string|null); - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); + /** PubsubMessage attributes */ + attributes?: ({ [k: string]: string }|null); - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; + /** PubsubMessage messageId */ + messageId?: (string|null); - /** - * 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; + /** PubsubMessage publishTime */ + publishTime?: (google.protobuf.ITimestamp|null); - /** - * 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; + /** PubsubMessage orderingKey */ + orderingKey?: (string|null); + } - /** - * 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; + /** Represents a PubsubMessage. */ + class PubsubMessage implements IPubsubMessage { - /** - * 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; + /** + * Constructs a new PubsubMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPubsubMessage); - /** - * 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; + /** PubsubMessage data. */ + public data: (Uint8Array|string); - /** - * 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); + /** PubsubMessage attributes. */ + public attributes: { [k: string]: string }; - /** - * 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; + /** PubsubMessage messageId. */ + public messageId: string; - /** - * 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 }; + /** PubsubMessage publishTime. */ + public publishTime?: (google.protobuf.ITimestamp|null); - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** PubsubMessage orderingKey. */ + public orderingKey: string; - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { + /** + * Creates a new PubsubMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns PubsubMessage instance + */ + public static create(properties?: google.pubsub.v1.IPubsubMessage): google.pubsub.v1.PubsubMessage; - /** FileDescriptorProto name */ - name?: (string|null); + /** + * Encodes the specified PubsubMessage message. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. + * @param message PubsubMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPubsubMessage, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileDescriptorProto package */ - "package"?: (string|null); + /** + * Encodes the specified PubsubMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. + * @param message PubsubMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPubsubMessage, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); + /** + * Decodes a PubsubMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubsubMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PubsubMessage; - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); + /** + * Decodes a PubsubMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubsubMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PubsubMessage; - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); + /** + * Verifies a PubsubMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); + /** + * Creates a PubsubMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubsubMessage + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PubsubMessage; - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + /** + * Creates a plain object from a PubsubMessage message. Also converts values to other types if specified. + * @param message PubsubMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PubsubMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); + /** + * Converts this PubsubMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); + /** Properties of a GetTopicRequest. */ + interface IGetTopicRequest { - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); + /** GetTopicRequest topic */ + topic?: (string|null); + } - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + /** Represents a GetTopicRequest. */ + class GetTopicRequest implements IGetTopicRequest { - /** FileDescriptorProto syntax */ - syntax?: (string|null); - } + /** + * Constructs a new GetTopicRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IGetTopicRequest); - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { + /** GetTopicRequest topic. */ + public topic: string; - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); + /** + * Creates a new GetTopicRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTopicRequest instance + */ + public static create(properties?: google.pubsub.v1.IGetTopicRequest): google.pubsub.v1.GetTopicRequest; - /** FileDescriptorProto name. */ - public name: string; + /** + * Encodes the specified GetTopicRequest message. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. + * @param message GetTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IGetTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileDescriptorProto package. */ - public package: string; + /** + * Encodes the specified GetTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. + * @param message GetTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IGetTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileDescriptorProto dependency. */ - public dependency: string[]; + /** + * Decodes a GetTopicRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.GetTopicRequest; - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; + /** + * Decodes a GetTopicRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.GetTopicRequest; - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; + /** + * Verifies a GetTopicRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; + /** + * Creates a GetTopicRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTopicRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetTopicRequest; - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; + /** + * Creates a plain object from a GetTopicRequest message. Also converts values to other types if specified. + * @param message GetTopicRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.GetTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; + /** + * Converts this GetTopicRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; + /** Properties of an UpdateTopicRequest. */ + interface IUpdateTopicRequest { - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); + /** UpdateTopicRequest topic */ + topic?: (google.pubsub.v1.ITopic|null); - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + /** UpdateTopicRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } - /** FileDescriptorProto syntax. */ - public syntax: string; + /** Represents an UpdateTopicRequest. */ + class UpdateTopicRequest implements IUpdateTopicRequest { - /** - * 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; + /** + * Constructs a new UpdateTopicRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IUpdateTopicRequest); - /** - * 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; + /** UpdateTopicRequest topic. */ + public topic?: (google.pubsub.v1.ITopic|null); - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** UpdateTopicRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + /** + * Creates a new UpdateTopicRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTopicRequest instance + */ + public static create(properties?: google.pubsub.v1.IUpdateTopicRequest): google.pubsub.v1.UpdateTopicRequest; - /** - * 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; + /** + * Encodes the specified UpdateTopicRequest message. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. + * @param message UpdateTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IUpdateTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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); + /** + * Encodes the specified UpdateTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. + * @param message UpdateTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IUpdateTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes an UpdateTopicRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.UpdateTopicRequest; - /** - * 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 }; + /** + * Decodes an UpdateTopicRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.UpdateTopicRequest; - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies an UpdateTopicRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { + /** + * Creates an UpdateTopicRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTopicRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateTopicRequest; - /** DescriptorProto name */ - name?: (string|null); + /** + * Creates a plain object from an UpdateTopicRequest message. Also converts values to other types if specified. + * @param message UpdateTopicRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.UpdateTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); + /** + * Converts this UpdateTopicRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); + /** Properties of a PublishRequest. */ + interface IPublishRequest { - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); + /** PublishRequest topic */ + topic?: (string|null); - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + /** PublishRequest messages */ + messages?: (google.pubsub.v1.IPubsubMessage[]|null); + } - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + /** Represents a PublishRequest. */ + class PublishRequest implements IPublishRequest { - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + /** + * Constructs a new PublishRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPublishRequest); - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); + /** PublishRequest topic. */ + public topic: string; - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + /** PublishRequest messages. */ + public messages: google.pubsub.v1.IPubsubMessage[]; - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } + /** + * Creates a new PublishRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PublishRequest instance + */ + public static create(properties?: google.pubsub.v1.IPublishRequest): google.pubsub.v1.PublishRequest; - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { + /** + * Encodes the specified PublishRequest message. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. + * @param message PublishRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPublishRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); + /** + * Encodes the specified PublishRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. + * @param message PublishRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPublishRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** DescriptorProto name. */ - public name: string; + /** + * Decodes a PublishRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublishRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PublishRequest; - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; + /** + * Decodes a PublishRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublishRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PublishRequest; - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; + /** + * Verifies a PublishRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; + /** + * Creates a PublishRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublishRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PublishRequest; - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; + /** + * Creates a plain object from a PublishRequest message. Also converts values to other types if specified. + * @param message PublishRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PublishRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + /** + * Converts this PublishRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + /** Properties of a PublishResponse. */ + interface IPublishResponse { - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); + /** PublishResponse messageIds */ + messageIds?: (string[]|null); + } - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + /** Represents a PublishResponse. */ + class PublishResponse implements IPublishResponse { - /** DescriptorProto reservedName. */ - public reservedName: string[]; + /** + * Constructs a new PublishResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPublishResponse); - /** - * 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; + /** PublishResponse messageIds. */ + public messageIds: string[]; - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new PublishResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PublishResponse instance + */ + public static create(properties?: google.pubsub.v1.IPublishResponse): google.pubsub.v1.PublishResponse; - /** - * 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; + /** + * Encodes the specified PublishResponse message. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. + * @param message PublishResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPublishResponse, 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; + /** + * Encodes the specified PublishResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. + * @param message PublishResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPublishResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes a PublishResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublishResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PublishResponse; - /** - * 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); + /** + * Decodes a PublishResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublishResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PublishResponse; - /** - * 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; + /** + * Verifies a PublishResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a 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 }; + /** + * Creates a PublishResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublishResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PublishResponse; - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from a PublishResponse message. Also converts values to other types if specified. + * @param message PublishResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PublishResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - namespace DescriptorProto { + /** + * Converts this PublishResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of an ExtensionRange. */ - interface IExtensionRange { + /** Properties of a ListTopicsRequest. */ + interface IListTopicsRequest { - /** ExtensionRange start */ - start?: (number|null); + /** ListTopicsRequest project */ + project?: (string|null); - /** ExtensionRange end */ - end?: (number|null); + /** ListTopicsRequest pageSize */ + pageSize?: (number|null); - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); + /** ListTopicsRequest pageToken */ + pageToken?: (string|null); } - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { + /** Represents a ListTopicsRequest. */ + class ListTopicsRequest implements IListTopicsRequest { /** - * Constructs a new ExtensionRange. + * Constructs a new ListTopicsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + constructor(properties?: google.pubsub.v1.IListTopicsRequest); - /** ExtensionRange start. */ - public start: number; + /** ListTopicsRequest project. */ + public project: string; - /** ExtensionRange end. */ - public end: number; + /** ListTopicsRequest pageSize. */ + public pageSize: number; - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); + /** ListTopicsRequest pageToken. */ + public pageToken: string; /** - * Creates a new ExtensionRange instance using the specified properties. + * Creates a new ListTopicsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ExtensionRange instance + * @returns ListTopicsRequest instance */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + public static create(properties?: google.pubsub.v1.IListTopicsRequest): google.pubsub.v1.ListTopicsRequest; /** - * 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 + * Encodes the specified ListTopicsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. + * @param message ListTopicsRequest 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; + public static encode(message: google.pubsub.v1.IListTopicsRequest, 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 + * Encodes the specified ListTopicsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. + * @param message ListTopicsRequest 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; + public static encodeDelimited(message: google.pubsub.v1.IListTopicsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExtensionRange message from the specified reader or buffer. + * Decodes a ListTopicsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExtensionRange + * @returns ListTopicsRequest * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicsRequest; /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * Decodes a ListTopicsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExtensionRange + * @returns ListTopicsRequest * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicsRequest; /** - * Verifies an ExtensionRange message. + * Verifies a ListTopicsRequest message. * @param message Plain 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. + * Creates a ListTopicsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExtensionRange + * @returns ListTopicsRequest */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicsRequest; /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange + * Creates a plain object from a ListTopicsRequest message. Also converts values to other types if specified. + * @param message ListTopicsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.pubsub.v1.ListTopicsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExtensionRange to JSON. + * Converts this ListTopicsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ReservedRange. */ - interface IReservedRange { + /** Properties of a ListTopicsResponse. */ + interface IListTopicsResponse { - /** ReservedRange start */ - start?: (number|null); + /** ListTopicsResponse topics */ + topics?: (google.pubsub.v1.ITopic[]|null); - /** ReservedRange end */ - end?: (number|null); + /** ListTopicsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { + /** Represents a ListTopicsResponse. */ + class ListTopicsResponse implements IListTopicsResponse { /** - * Constructs a new ReservedRange. + * Constructs a new ListTopicsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + constructor(properties?: google.pubsub.v1.IListTopicsResponse); - /** ReservedRange start. */ - public start: number; + /** ListTopicsResponse topics. */ + public topics: google.pubsub.v1.ITopic[]; - /** ReservedRange end. */ - public end: number; + /** ListTopicsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new ReservedRange instance using the specified properties. + * Creates a new ListTopicsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ReservedRange instance + * @returns ListTopicsResponse instance */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + public static create(properties?: google.pubsub.v1.IListTopicsResponse): google.pubsub.v1.ListTopicsResponse; /** - * 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 + * Encodes the specified ListTopicsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. + * @param message ListTopicsResponse 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; + public static encode(message: google.pubsub.v1.IListTopicsResponse, 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 + * Encodes the specified ListTopicsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. + * @param message ListTopicsResponse 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; + public static encodeDelimited(message: google.pubsub.v1.IListTopicsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReservedRange message from the specified reader or buffer. + * Decodes a ListTopicsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReservedRange + * @returns ListTopicsResponse * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicsResponse; /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * Decodes a ListTopicsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReservedRange + * @returns ListTopicsResponse * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicsResponse; /** - * Verifies a ReservedRange message. + * Verifies a ListTopicsResponse message. * @param message Plain object 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 }; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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[]; - - /** - * 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 }; - } - - /** 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); - } - - /** 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; + /** + * Creates a ListTopicsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTopicsResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicsResponse; - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); + /** + * Creates a plain object from a ListTopicsResponse message. Also converts values to other types if specified. + * @param message ListTopicsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListTopicsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this ListTopicsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of a ListTopicSubscriptionsRequest. */ + interface IListTopicSubscriptionsRequest { - /** - * 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; + /** ListTopicSubscriptionsRequest topic */ + topic?: (string|null); - /** - * 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; + /** ListTopicSubscriptionsRequest pageSize */ + pageSize?: (number|null); - /** - * 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; + /** ListTopicSubscriptionsRequest pageToken */ + pageToken?: (string|null); + } - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a ListTopicSubscriptionsRequest. */ + class ListTopicSubscriptionsRequest implements IListTopicSubscriptionsRequest { - /** - * 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; + /** + * Constructs a new ListTopicSubscriptionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListTopicSubscriptionsRequest); - /** - * 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 }; + /** ListTopicSubscriptionsRequest topic. */ + public topic: string; - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ListTopicSubscriptionsRequest pageSize. */ + public pageSize: number; - namespace FieldDescriptorProto { + /** ListTopicSubscriptionsRequest pageToken. */ + public pageToken: string; - /** 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 - } + /** + * Creates a new ListTopicSubscriptionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTopicSubscriptionsRequest instance + */ + public static create(properties?: google.pubsub.v1.IListTopicSubscriptionsRequest): google.pubsub.v1.ListTopicSubscriptionsRequest; - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3 - } - } + /** + * Encodes the specified ListTopicSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. + * @param message ListTopicSubscriptionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListTopicSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { + /** + * Encodes the specified ListTopicSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. + * @param message ListTopicSubscriptionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListTopicSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** OneofDescriptorProto name */ - name?: (string|null); + /** + * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTopicSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicSubscriptionsRequest; - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } + /** + * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTopicSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicSubscriptionsRequest; - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { + /** + * Verifies a ListTopicSubscriptionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); + /** + * Creates a ListTopicSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTopicSubscriptionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSubscriptionsRequest; - /** OneofDescriptorProto name. */ - public name: string; + /** + * Creates a plain object from a ListTopicSubscriptionsRequest message. Also converts values to other types if specified. + * @param message ListTopicSubscriptionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListTopicSubscriptionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); + /** + * Converts this ListTopicSubscriptionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of a ListTopicSubscriptionsResponse. */ + interface IListTopicSubscriptionsResponse { - /** - * 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; + /** ListTopicSubscriptionsResponse subscriptions */ + subscriptions?: (string[]|null); - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListTopicSubscriptionsResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + /** Represents a ListTopicSubscriptionsResponse. */ + class ListTopicSubscriptionsResponse implements IListTopicSubscriptionsResponse { + + /** + * Constructs a new ListTopicSubscriptionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListTopicSubscriptionsResponse); - /** - * 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; + /** ListTopicSubscriptionsResponse subscriptions. */ + public subscriptions: string[]; - /** - * 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); + /** ListTopicSubscriptionsResponse nextPageToken. */ + public nextPageToken: string; - /** - * 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 new ListTopicSubscriptionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTopicSubscriptionsResponse instance + */ + public static create(properties?: google.pubsub.v1.IListTopicSubscriptionsResponse): google.pubsub.v1.ListTopicSubscriptionsResponse; - /** - * 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 }; + /** + * Encodes the specified ListTopicSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. + * @param message ListTopicSubscriptionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListTopicSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified ListTopicSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. + * @param message ListTopicSubscriptionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListTopicSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { + /** + * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTopicSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicSubscriptionsResponse; - /** EnumDescriptorProto name */ - name?: (string|null); + /** + * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTopicSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicSubscriptionsResponse; - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + /** + * Verifies a ListTopicSubscriptionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); + /** + * Creates a ListTopicSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTopicSubscriptionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSubscriptionsResponse; - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + /** + * Creates a plain object from a ListTopicSubscriptionsResponse message. Also converts values to other types if specified. + * @param message ListTopicSubscriptionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListTopicSubscriptionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } + /** + * Converts this ListTopicSubscriptionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { + /** Properties of a ListTopicSnapshotsRequest. */ + interface IListTopicSnapshotsRequest { - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); + /** ListTopicSnapshotsRequest topic */ + topic?: (string|null); - /** EnumDescriptorProto name. */ - public name: string; + /** ListTopicSnapshotsRequest pageSize */ + pageSize?: (number|null); - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; + /** ListTopicSnapshotsRequest pageToken */ + pageToken?: (string|null); + } - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); + /** Represents a ListTopicSnapshotsRequest. */ + class ListTopicSnapshotsRequest implements IListTopicSnapshotsRequest { - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + /** + * Constructs a new ListTopicSnapshotsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListTopicSnapshotsRequest); - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; + /** ListTopicSnapshotsRequest topic. */ + public topic: string; - /** - * 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; + /** ListTopicSnapshotsRequest pageSize. */ + public pageSize: number; - /** - * 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; + /** ListTopicSnapshotsRequest pageToken. */ + public pageToken: string; - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new ListTopicSnapshotsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTopicSnapshotsRequest instance + */ + public static create(properties?: google.pubsub.v1.IListTopicSnapshotsRequest): google.pubsub.v1.ListTopicSnapshotsRequest; - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + /** + * Encodes the specified ListTopicSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. + * @param message ListTopicSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListTopicSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + /** + * Encodes the specified ListTopicSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. + * @param message ListTopicSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListTopicSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTopicSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicSnapshotsRequest; - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + /** + * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTopicSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicSnapshotsRequest; - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a ListTopicSnapshotsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTopicSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTopicSnapshotsRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSnapshotsRequest; - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from a ListTopicSnapshotsRequest message. Also converts values to other types if specified. + * @param message ListTopicSnapshotsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListTopicSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - namespace EnumDescriptorProto { + /** + * Converts this ListTopicSnapshotsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { + /** Properties of a ListTopicSnapshotsResponse. */ + interface IListTopicSnapshotsResponse { - /** EnumReservedRange start */ - start?: (number|null); + /** ListTopicSnapshotsResponse snapshots */ + snapshots?: (string[]|null); - /** EnumReservedRange end */ - end?: (number|null); + /** ListTopicSnapshotsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { + /** Represents a ListTopicSnapshotsResponse. */ + class ListTopicSnapshotsResponse implements IListTopicSnapshotsResponse { /** - * Constructs a new EnumReservedRange. + * Constructs a new ListTopicSnapshotsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + constructor(properties?: google.pubsub.v1.IListTopicSnapshotsResponse); - /** EnumReservedRange start. */ - public start: number; + /** ListTopicSnapshotsResponse snapshots. */ + public snapshots: string[]; - /** EnumReservedRange end. */ - public end: number; + /** ListTopicSnapshotsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new EnumReservedRange instance using the specified properties. + * Creates a new ListTopicSnapshotsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns EnumReservedRange instance + * @returns ListTopicSnapshotsResponse instance */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + public static create(properties?: google.pubsub.v1.IListTopicSnapshotsResponse): google.pubsub.v1.ListTopicSnapshotsResponse; /** - * 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 + * Encodes the specified ListTopicSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. + * @param message ListTopicSnapshotsResponse 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; + public static encode(message: google.pubsub.v1.IListTopicSnapshotsResponse, 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 + * Encodes the specified ListTopicSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. + * @param message ListTopicSnapshotsResponse 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; + public static encodeDelimited(message: google.pubsub.v1.IListTopicSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumReservedRange message from the specified reader or buffer. + * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EnumReservedRange + * @returns ListTopicSnapshotsResponse * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListTopicSnapshotsResponse; /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumReservedRange + * @returns ListTopicSnapshotsResponse * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListTopicSnapshotsResponse; /** - * Verifies an EnumReservedRange message. + * Verifies a ListTopicSnapshotsResponse message. * @param message Plain 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. + * Creates a ListTopicSnapshotsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumReservedRange + * @returns ListTopicSnapshotsResponse */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListTopicSnapshotsResponse; /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange + * Creates a plain object from a ListTopicSnapshotsResponse message. Also converts values to other types if specified. + * @param message ListTopicSnapshotsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.pubsub.v1.ListTopicSnapshotsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumReservedRange to JSON. + * Converts this ListTopicSnapshotsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - - /** 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 }; - } - - /** 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; + /** Properties of a DeleteTopicRequest. */ + interface IDeleteTopicRequest { - /** - * 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; + /** DeleteTopicRequest topic */ + topic?: (string|null); + } - /** - * 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; + /** Represents a DeleteTopicRequest. */ + class DeleteTopicRequest implements IDeleteTopicRequest { - /** - * 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; + /** + * Constructs a new DeleteTopicRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDeleteTopicRequest); - /** - * 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); + /** DeleteTopicRequest topic. */ + public topic: string; - /** - * 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 new DeleteTopicRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTopicRequest instance + */ + public static create(properties?: google.pubsub.v1.IDeleteTopicRequest): google.pubsub.v1.DeleteTopicRequest; - /** - * 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 }; + /** + * Encodes the specified DeleteTopicRequest message. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. + * @param message DeleteTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDeleteTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified DeleteTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. + * @param message DeleteTopicRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDeleteTopicRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { + /** + * Decodes a DeleteTopicRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DeleteTopicRequest; - /** MethodDescriptorProto name */ - name?: (string|null); + /** + * Decodes a DeleteTopicRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DeleteTopicRequest; - /** MethodDescriptorProto inputType */ - inputType?: (string|null); + /** + * Verifies a DeleteTopicRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** MethodDescriptorProto outputType */ - outputType?: (string|null); + /** + * Creates a DeleteTopicRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTopicRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteTopicRequest; - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); + /** + * Creates a plain object from a DeleteTopicRequest message. Also converts values to other types if specified. + * @param message DeleteTopicRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DeleteTopicRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); + /** + * Converts this DeleteTopicRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } + /** Represents a Subscriber */ + class Subscriber extends $protobuf.rpc.Service { - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { + /** + * Constructs a new Subscriber 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); - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); + /** + * Creates new Subscriber 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): Subscriber; - /** MethodDescriptorProto name. */ - public name: string; + /** + * Calls CreateSubscription. + * @param request Subscription message or plain object + * @param callback Node-style callback called with the error, if any, and Subscription + */ + public createSubscription(request: google.pubsub.v1.ISubscription, callback: google.pubsub.v1.Subscriber.CreateSubscriptionCallback): void; - /** MethodDescriptorProto inputType. */ - public inputType: string; + /** + * Calls CreateSubscription. + * @param request Subscription message or plain object + * @returns Promise + */ + public createSubscription(request: google.pubsub.v1.ISubscription): Promise; - /** MethodDescriptorProto outputType. */ - public outputType: string; + /** + * Calls GetSubscription. + * @param request GetSubscriptionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Subscription + */ + public getSubscription(request: google.pubsub.v1.IGetSubscriptionRequest, callback: google.pubsub.v1.Subscriber.GetSubscriptionCallback): void; - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); + /** + * Calls GetSubscription. + * @param request GetSubscriptionRequest message or plain object + * @returns Promise + */ + public getSubscription(request: google.pubsub.v1.IGetSubscriptionRequest): Promise; - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; + /** + * Calls UpdateSubscription. + * @param request UpdateSubscriptionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Subscription + */ + public updateSubscription(request: google.pubsub.v1.IUpdateSubscriptionRequest, callback: google.pubsub.v1.Subscriber.UpdateSubscriptionCallback): void; - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; + /** + * Calls UpdateSubscription. + * @param request UpdateSubscriptionRequest message or plain object + * @returns Promise + */ + public updateSubscription(request: google.pubsub.v1.IUpdateSubscriptionRequest): Promise; - /** - * 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; + /** + * Calls ListSubscriptions. + * @param request ListSubscriptionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSubscriptionsResponse + */ + public listSubscriptions(request: google.pubsub.v1.IListSubscriptionsRequest, callback: google.pubsub.v1.Subscriber.ListSubscriptionsCallback): void; - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls ListSubscriptions. + * @param request ListSubscriptionsRequest message or plain object + * @returns Promise + */ + public listSubscriptions(request: google.pubsub.v1.IListSubscriptionsRequest): Promise; - /** - * 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; + /** + * Calls DeleteSubscription. + * @param request DeleteSubscriptionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSubscription(request: google.pubsub.v1.IDeleteSubscriptionRequest, callback: google.pubsub.v1.Subscriber.DeleteSubscriptionCallback): void; - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + /** + * Calls DeleteSubscription. + * @param request DeleteSubscriptionRequest message or plain object + * @returns Promise + */ + public deleteSubscription(request: google.pubsub.v1.IDeleteSubscriptionRequest): Promise; - /** - * 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; + /** + * Calls ModifyAckDeadline. + * @param request ModifyAckDeadlineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public modifyAckDeadline(request: google.pubsub.v1.IModifyAckDeadlineRequest, callback: google.pubsub.v1.Subscriber.ModifyAckDeadlineCallback): void; - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Calls ModifyAckDeadline. + * @param request ModifyAckDeadlineRequest message or plain object + * @returns Promise + */ + public modifyAckDeadline(request: google.pubsub.v1.IModifyAckDeadlineRequest): Promise; - /** - * 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; + /** + * Calls Acknowledge. + * @param request AcknowledgeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public acknowledge(request: google.pubsub.v1.IAcknowledgeRequest, callback: google.pubsub.v1.Subscriber.AcknowledgeCallback): void; - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Calls Acknowledge. + * @param request AcknowledgeRequest message or plain object + * @returns Promise + */ + public acknowledge(request: google.pubsub.v1.IAcknowledgeRequest): Promise; - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Calls Pull. + * @param request PullRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PullResponse + */ + public pull(request: google.pubsub.v1.IPullRequest, callback: google.pubsub.v1.Subscriber.PullCallback): void; - /** Properties of a FileOptions. */ - interface IFileOptions { + /** + * Calls Pull. + * @param request PullRequest message or plain object + * @returns Promise + */ + public pull(request: google.pubsub.v1.IPullRequest): Promise; - /** FileOptions javaPackage */ - javaPackage?: (string|null); + /** + * Calls StreamingPull. + * @param request StreamingPullRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StreamingPullResponse + */ + public streamingPull(request: google.pubsub.v1.IStreamingPullRequest, callback: google.pubsub.v1.Subscriber.StreamingPullCallback): void; - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); + /** + * Calls StreamingPull. + * @param request StreamingPullRequest message or plain object + * @returns Promise + */ + public streamingPull(request: google.pubsub.v1.IStreamingPullRequest): Promise; - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); + /** + * Calls ModifyPushConfig. + * @param request ModifyPushConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public modifyPushConfig(request: google.pubsub.v1.IModifyPushConfigRequest, callback: google.pubsub.v1.Subscriber.ModifyPushConfigCallback): void; - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); + /** + * Calls ModifyPushConfig. + * @param request ModifyPushConfigRequest message or plain object + * @returns Promise + */ + public modifyPushConfig(request: google.pubsub.v1.IModifyPushConfigRequest): Promise; - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); + /** + * Calls GetSnapshot. + * @param request GetSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Snapshot + */ + public getSnapshot(request: google.pubsub.v1.IGetSnapshotRequest, callback: google.pubsub.v1.Subscriber.GetSnapshotCallback): void; - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + /** + * Calls GetSnapshot. + * @param request GetSnapshotRequest message or plain object + * @returns Promise + */ + public getSnapshot(request: google.pubsub.v1.IGetSnapshotRequest): Promise; - /** FileOptions goPackage */ - goPackage?: (string|null); + /** + * Calls ListSnapshots. + * @param request ListSnapshotsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSnapshotsResponse + */ + public listSnapshots(request: google.pubsub.v1.IListSnapshotsRequest, callback: google.pubsub.v1.Subscriber.ListSnapshotsCallback): void; - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); + /** + * Calls ListSnapshots. + * @param request ListSnapshotsRequest message or plain object + * @returns Promise + */ + public listSnapshots(request: google.pubsub.v1.IListSnapshotsRequest): Promise; - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); + /** + * Calls CreateSnapshot. + * @param request CreateSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Snapshot + */ + public createSnapshot(request: google.pubsub.v1.ICreateSnapshotRequest, callback: google.pubsub.v1.Subscriber.CreateSnapshotCallback): void; - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); + /** + * Calls CreateSnapshot. + * @param request CreateSnapshotRequest message or plain object + * @returns Promise + */ + public createSnapshot(request: google.pubsub.v1.ICreateSnapshotRequest): Promise; - /** FileOptions phpGenericServices */ - phpGenericServices?: (boolean|null); + /** + * Calls UpdateSnapshot. + * @param request UpdateSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Snapshot + */ + public updateSnapshot(request: google.pubsub.v1.IUpdateSnapshotRequest, callback: google.pubsub.v1.Subscriber.UpdateSnapshotCallback): void; - /** FileOptions deprecated */ - deprecated?: (boolean|null); + /** + * Calls UpdateSnapshot. + * @param request UpdateSnapshotRequest message or plain object + * @returns Promise + */ + public updateSnapshot(request: google.pubsub.v1.IUpdateSnapshotRequest): Promise; - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); + /** + * Calls DeleteSnapshot. + * @param request DeleteSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSnapshot(request: google.pubsub.v1.IDeleteSnapshotRequest, callback: google.pubsub.v1.Subscriber.DeleteSnapshotCallback): void; - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); + /** + * Calls DeleteSnapshot. + * @param request DeleteSnapshotRequest message or plain object + * @returns Promise + */ + public deleteSnapshot(request: google.pubsub.v1.IDeleteSnapshotRequest): Promise; - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); + /** + * Calls Seek. + * @param request SeekRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SeekResponse + */ + public seek(request: google.pubsub.v1.ISeekRequest, callback: google.pubsub.v1.Subscriber.SeekCallback): void; - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); + /** + * Calls Seek. + * @param request SeekRequest message or plain object + * @returns Promise + */ + public seek(request: google.pubsub.v1.ISeekRequest): Promise; + } - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); + namespace Subscriber { - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#createSubscription}. + * @param error Error, if any + * @param [response] Subscription + */ + type CreateSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#getSubscription}. + * @param error Error, if any + * @param [response] Subscription + */ + type GetSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#updateSubscription}. + * @param error Error, if any + * @param [response] Subscription + */ + type UpdateSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.Subscription) => void; - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#listSubscriptions}. + * @param error Error, if any + * @param [response] ListSubscriptionsResponse + */ + type ListSubscriptionsCallback = (error: (Error|null), response?: google.pubsub.v1.ListSubscriptionsResponse) => void; - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#deleteSubscription}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSubscriptionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#modifyAckDeadline}. + * @param error Error, if any + * @param [response] Empty + */ + type ModifyAckDeadlineCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#acknowledge}. + * @param error Error, if any + * @param [response] Empty + */ + type AcknowledgeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#pull}. + * @param error Error, if any + * @param [response] PullResponse + */ + type PullCallback = (error: (Error|null), response?: google.pubsub.v1.PullResponse) => void; - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#streamingPull}. + * @param error Error, if any + * @param [response] StreamingPullResponse + */ + type StreamingPullCallback = (error: (Error|null), response?: google.pubsub.v1.StreamingPullResponse) => void; - /** FileOptions javaPackage. */ - public javaPackage: string; + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#modifyPushConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type ModifyPushConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#getSnapshot}. + * @param error Error, if any + * @param [response] Snapshot + */ + type GetSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#listSnapshots}. + * @param error Error, if any + * @param [response] ListSnapshotsResponse + */ + type ListSnapshotsCallback = (error: (Error|null), response?: google.pubsub.v1.ListSnapshotsResponse) => void; - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#createSnapshot}. + * @param error Error, if any + * @param [response] Snapshot + */ + type CreateSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#updateSnapshot}. + * @param error Error, if any + * @param [response] Snapshot + */ + type UpdateSnapshotCallback = (error: (Error|null), response?: google.pubsub.v1.Snapshot) => void; - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#deleteSnapshot}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSnapshotCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - /** FileOptions goPackage. */ - public goPackage: string; + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#seek}. + * @param error Error, if any + * @param [response] SeekResponse + */ + type SeekCallback = (error: (Error|null), response?: google.pubsub.v1.SeekResponse) => void; + } - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; + /** Properties of a Subscription. */ + interface ISubscription { - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; + /** Subscription name */ + name?: (string|null); - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; + /** Subscription topic */ + topic?: (string|null); - /** FileOptions phpGenericServices. */ - public phpGenericServices: boolean; + /** Subscription pushConfig */ + pushConfig?: (google.pubsub.v1.IPushConfig|null); - /** FileOptions deprecated. */ - public deprecated: boolean; + /** Subscription ackDeadlineSeconds */ + ackDeadlineSeconds?: (number|null); - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; + /** Subscription retainAckedMessages */ + retainAckedMessages?: (boolean|null); - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; + /** Subscription messageRetentionDuration */ + messageRetentionDuration?: (google.protobuf.IDuration|null); - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; + /** Subscription labels */ + labels?: ({ [k: string]: string }|null); - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; + /** Subscription enableMessageOrdering */ + enableMessageOrdering?: (boolean|null); - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; + /** Subscription expirationPolicy */ + expirationPolicy?: (google.pubsub.v1.IExpirationPolicy|null); - /** FileOptions phpNamespace. */ - public phpNamespace: string; + /** Subscription filter */ + filter?: (string|null); - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; + /** Subscription deadLetterPolicy */ + deadLetterPolicy?: (google.pubsub.v1.IDeadLetterPolicy|null); - /** FileOptions rubyPackage. */ - public rubyPackage: string; + /** Subscription retryPolicy */ + retryPolicy?: (google.pubsub.v1.IRetryPolicy|null); + } - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** Represents a Subscription. */ + class Subscription implements ISubscription { - /** - * 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; + /** + * Constructs a new Subscription. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.ISubscription); - /** - * 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; + /** Subscription name. */ + public name: string; - /** - * 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; + /** Subscription topic. */ + public topic: string; - /** - * 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; + /** Subscription pushConfig. */ + public pushConfig?: (google.pubsub.v1.IPushConfig|null); - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + /** Subscription ackDeadlineSeconds. */ + public ackDeadlineSeconds: number; - /** - * 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); + /** Subscription retainAckedMessages. */ + public retainAckedMessages: boolean; - /** - * 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; + /** Subscription messageRetentionDuration. */ + public messageRetentionDuration?: (google.protobuf.IDuration|null); - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Subscription labels. */ + public labels: { [k: string]: string }; - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Subscription enableMessageOrdering. */ + public enableMessageOrdering: boolean; - namespace FileOptions { + /** Subscription expirationPolicy. */ + public expirationPolicy?: (google.pubsub.v1.IExpirationPolicy|null); - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } + /** Subscription filter. */ + public filter: string; - /** Properties of a MessageOptions. */ - interface IMessageOptions { + /** Subscription deadLetterPolicy. */ + public deadLetterPolicy?: (google.pubsub.v1.IDeadLetterPolicy|null); - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); + /** Subscription retryPolicy. */ + public retryPolicy?: (google.pubsub.v1.IRetryPolicy|null); - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); + /** + * Creates a new Subscription instance using the specified properties. + * @param [properties] Properties to set + * @returns Subscription instance + */ + public static create(properties?: google.pubsub.v1.ISubscription): google.pubsub.v1.Subscription; - /** MessageOptions deprecated */ - deprecated?: (boolean|null); + /** + * Encodes the specified Subscription message. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. + * @param message Subscription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.ISubscription, writer?: $protobuf.Writer): $protobuf.Writer; - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); + /** + * Encodes the specified Subscription message, length delimited. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. + * @param message Subscription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.ISubscription, writer?: $protobuf.Writer): $protobuf.Writer; - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** + * Decodes a Subscription message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Subscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.Subscription; - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } + /** + * Decodes a Subscription message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Subscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.Subscription; - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { + /** + * Verifies a Subscription message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); + /** + * Creates a Subscription message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Subscription + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Subscription; - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; + /** + * Creates a plain object from a Subscription message. Also converts values to other types if specified. + * @param message Subscription + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.Subscription, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; + /** + * Converts this Subscription to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** MessageOptions deprecated. */ - public deprecated: boolean; + /** Properties of a RetryPolicy. */ + interface IRetryPolicy { - /** MessageOptions mapEntry. */ - public mapEntry: boolean; + /** RetryPolicy minimumBackoff */ + minimumBackoff?: (google.protobuf.IDuration|null); - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** RetryPolicy maximumBackoff */ + maximumBackoff?: (google.protobuf.IDuration|null); + } - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + /** Represents a RetryPolicy. */ + class RetryPolicy implements IRetryPolicy { - /** - * 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; + /** + * Constructs a new RetryPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IRetryPolicy); - /** - * 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; + /** RetryPolicy minimumBackoff. */ + public minimumBackoff?: (google.protobuf.IDuration|null); - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + /** RetryPolicy maximumBackoff. */ + public maximumBackoff?: (google.protobuf.IDuration|null); - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + /** + * Creates a new RetryPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns RetryPolicy instance + */ + public static create(properties?: google.pubsub.v1.IRetryPolicy): google.pubsub.v1.RetryPolicy; - /** - * 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); + /** + * Encodes the specified RetryPolicy message. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages. + * @param message RetryPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IRetryPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Encodes the specified RetryPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages. + * @param message RetryPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IRetryPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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 }; + /** + * Decodes a RetryPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.RetryPolicy; - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a RetryPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.RetryPolicy; - /** Properties of a FieldOptions. */ - interface IFieldOptions { + /** + * Verifies a RetryPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + /** + * Creates a RetryPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetryPolicy + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.RetryPolicy; - /** FieldOptions packed */ - packed?: (boolean|null); + /** + * Creates a plain object from a RetryPolicy message. Also converts values to other types if specified. + * @param message RetryPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.RetryPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + /** + * Converts this RetryPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FieldOptions lazy */ - lazy?: (boolean|null); + /** Properties of a DeadLetterPolicy. */ + interface IDeadLetterPolicy { - /** FieldOptions deprecated */ - deprecated?: (boolean|null); + /** DeadLetterPolicy deadLetterTopic */ + deadLetterTopic?: (string|null); - /** FieldOptions weak */ - weak?: (boolean|null); + /** DeadLetterPolicy maxDeliveryAttempts */ + maxDeliveryAttempts?: (number|null); + } - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** Represents a DeadLetterPolicy. */ + class DeadLetterPolicy implements IDeadLetterPolicy { - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + /** + * Constructs a new DeadLetterPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IDeadLetterPolicy); - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } + /** DeadLetterPolicy deadLetterTopic. */ + public deadLetterTopic: string; - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { + /** DeadLetterPolicy maxDeliveryAttempts. */ + public maxDeliveryAttempts: number; - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); + /** + * Creates a new DeadLetterPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns DeadLetterPolicy instance + */ + public static create(properties?: google.pubsub.v1.IDeadLetterPolicy): google.pubsub.v1.DeadLetterPolicy; - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + /** + * Encodes the specified DeadLetterPolicy message. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. + * @param message DeadLetterPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IDeadLetterPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldOptions packed. */ - public packed: boolean; + /** + * Encodes the specified DeadLetterPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. + * @param message DeadLetterPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IDeadLetterPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + /** + * Decodes a DeadLetterPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeadLetterPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DeadLetterPolicy; - /** FieldOptions lazy. */ - public lazy: boolean; + /** + * Decodes a DeadLetterPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeadLetterPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DeadLetterPolicy; - /** FieldOptions deprecated. */ - public deprecated: boolean; + /** + * Verifies a DeadLetterPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FieldOptions weak. */ - public weak: boolean; + /** + * Creates a DeadLetterPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeadLetterPolicy + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeadLetterPolicy; - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Creates a plain object from a DeadLetterPolicy message. Also converts values to other types if specified. + * @param message DeadLetterPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.DeadLetterPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this DeadLetterPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of an ExpirationPolicy. */ + interface IExpirationPolicy { - /** - * 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; + /** ExpirationPolicy ttl */ + ttl?: (google.protobuf.IDuration|null); + } - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + /** Represents an ExpirationPolicy. */ + class ExpirationPolicy implements IExpirationPolicy { - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + /** + * Constructs a new ExpirationPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IExpirationPolicy); - /** - * 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); + /** ExpirationPolicy ttl. */ + public ttl?: (google.protobuf.IDuration|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 new ExpirationPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ExpirationPolicy instance + */ + public static create(properties?: google.pubsub.v1.IExpirationPolicy): google.pubsub.v1.ExpirationPolicy; - /** - * 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 }; + /** + * Encodes the specified ExpirationPolicy message. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. + * @param message ExpirationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IExpirationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified ExpirationPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. + * @param message ExpirationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IExpirationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - namespace FieldOptions { + /** + * Decodes an ExpirationPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExpirationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ExpirationPolicy; - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } + /** + * Decodes an ExpirationPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExpirationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ExpirationPolicy; - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - } + /** + * Verifies an ExpirationPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of an OneofOptions. */ - interface IOneofOptions { + /** + * Creates an ExpirationPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExpirationPolicy + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ExpirationPolicy; - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** + * Creates a plain object from an ExpirationPolicy message. Also converts values to other types if specified. + * @param message ExpirationPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ExpirationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { + /** + * Converts this ExpirationPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); + /** Properties of a PushConfig. */ + interface IPushConfig { - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** PushConfig pushEndpoint */ + pushEndpoint?: (string|null); - /** - * 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; + /** PushConfig attributes */ + attributes?: ({ [k: string]: string }|null); - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** PushConfig oidcToken */ + oidcToken?: (google.pubsub.v1.PushConfig.IOidcToken|null); + } - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a PushConfig. */ + class PushConfig implements IPushConfig { - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + /** + * Constructs a new PushConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPushConfig); - /** - * 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; + /** PushConfig pushEndpoint. */ + public pushEndpoint: string; - /** - * 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); + /** PushConfig attributes. */ + public attributes: { [k: string]: string }; - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + /** PushConfig oidcToken. */ + public oidcToken?: (google.pubsub.v1.PushConfig.IOidcToken|null); - /** - * 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 }; + /** PushConfig authenticationMethod. */ + public authenticationMethod?: "oidcToken"; - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new PushConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PushConfig instance + */ + public static create(properties?: google.pubsub.v1.IPushConfig): google.pubsub.v1.PushConfig; - /** Properties of an EnumOptions. */ - interface IEnumOptions { + /** + * Encodes the specified PushConfig message. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. + * @param message PushConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPushConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); + /** + * Encodes the specified PushConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. + * @param message PushConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPushConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** EnumOptions deprecated */ - deprecated?: (boolean|null); + /** + * Decodes a PushConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PushConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PushConfig; - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** + * Decodes a PushConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PushConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PushConfig; - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { + /** + * Verifies a PushConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); + /** + * Creates a PushConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PushConfig + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig; - /** EnumOptions allowAlias. */ - public allowAlias: boolean; + /** + * Creates a plain object from a PushConfig message. Also converts values to other types if specified. + * @param message PushConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PushConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** EnumOptions deprecated. */ - public deprecated: boolean; + /** + * Converts this PushConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + namespace PushConfig { - /** - * 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; + /** Properties of an OidcToken. */ + interface IOidcToken { - /** - * 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; + /** OidcToken serviceAccountEmail */ + serviceAccountEmail?: (string|null); - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** OidcToken audience */ + audience?: (string|null); + } - /** - * 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; + /** Represents an OidcToken. */ + class OidcToken implements IOidcToken { - /** - * 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; + /** + * Constructs a new OidcToken. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.PushConfig.IOidcToken); - /** - * 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); + /** OidcToken serviceAccountEmail. */ + public serviceAccountEmail: string; - /** - * 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; + /** OidcToken audience. */ + public audience: string; - /** - * 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 }; + /** + * Creates a new OidcToken instance using the specified properties. + * @param [properties] Properties to set + * @returns OidcToken instance + */ + public static create(properties?: google.pubsub.v1.PushConfig.IOidcToken): google.pubsub.v1.PushConfig.OidcToken; - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified OidcToken message. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. + * @param message OidcToken message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.PushConfig.IOidcToken, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { + /** + * Encodes the specified OidcToken message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. + * @param message OidcToken message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.PushConfig.IOidcToken, writer?: $protobuf.Writer): $protobuf.Writer; - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); + /** + * Decodes an OidcToken message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OidcToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PushConfig.OidcToken; - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** + * Decodes an OidcToken message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OidcToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PushConfig.OidcToken; + + /** + * Verifies an OidcToken message. + * @param message Plain 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 OidcToken message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OidcToken + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig.OidcToken; + + /** + * Creates a plain object from an OidcToken message. Also converts values to other types if specified. + * @param message OidcToken + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PushConfig.OidcToken, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { + /** + * Converts this OidcToken to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); + /** Properties of a ReceivedMessage. */ + interface IReceivedMessage { - /** EnumValueOptions deprecated. */ - public deprecated: boolean; + /** ReceivedMessage ackId */ + ackId?: (string|null); - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** ReceivedMessage message */ + message?: (google.pubsub.v1.IPubsubMessage|null); - /** - * 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; + /** ReceivedMessage deliveryAttempt */ + deliveryAttempt?: (number|null); + } - /** - * 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; + /** Represents a ReceivedMessage. */ + class ReceivedMessage implements IReceivedMessage { - /** - * 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; + /** + * Constructs a new ReceivedMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IReceivedMessage); - /** - * 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; + /** ReceivedMessage ackId. */ + public ackId: string; - /** - * 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; + /** ReceivedMessage message. */ + public message?: (google.pubsub.v1.IPubsubMessage|null); - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ReceivedMessage deliveryAttempt. */ + public deliveryAttempt: number; - /** - * 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 new ReceivedMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns ReceivedMessage instance + */ + public static create(properties?: google.pubsub.v1.IReceivedMessage): google.pubsub.v1.ReceivedMessage; - /** - * 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 }; + /** + * Encodes the specified ReceivedMessage message. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. + * @param message ReceivedMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IReceivedMessage, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified ReceivedMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. + * @param message ReceivedMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IReceivedMessage, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a ServiceOptions. */ - interface IServiceOptions { + /** + * Decodes a ReceivedMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReceivedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ReceivedMessage; - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); + /** + * Decodes a ReceivedMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReceivedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ReceivedMessage; - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** + * Verifies a ReceivedMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); + /** + * Creates a ReceivedMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReceivedMessage + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ReceivedMessage; - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - } + /** + * Creates a plain object from a ReceivedMessage message. Also converts values to other types if specified. + * @param message ReceivedMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ReceivedMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { + /** + * Converts this ReceivedMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); + /** Properties of a GetSubscriptionRequest. */ + interface IGetSubscriptionRequest { - /** ServiceOptions deprecated. */ - public deprecated: boolean; + /** GetSubscriptionRequest subscription */ + subscription?: (string|null); + } - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** Represents a GetSubscriptionRequest. */ + class GetSubscriptionRequest implements IGetSubscriptionRequest { - /** - * 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; + /** + * Constructs a new GetSubscriptionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IGetSubscriptionRequest); - /** - * 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; + /** GetSubscriptionRequest subscription. */ + public subscription: string; - /** - * 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; + /** + * Creates a new GetSubscriptionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSubscriptionRequest instance + */ + public static create(properties?: google.pubsub.v1.IGetSubscriptionRequest): google.pubsub.v1.GetSubscriptionRequest; - /** - * 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; + /** + * Encodes the specified GetSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. + * @param message GetSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IGetSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Encodes the specified GetSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. + * @param message GetSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IGetSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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); + /** + * Decodes a GetSubscriptionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.GetSubscriptionRequest; - /** - * 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; + /** + * Decodes a GetSubscriptionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.GetSubscriptionRequest; - /** - * 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 }; + /** + * Verifies a GetSubscriptionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a GetSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSubscriptionRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetSubscriptionRequest; - /** Properties of a MethodOptions. */ - interface IMethodOptions { + /** + * Creates a plain object from a GetSubscriptionRequest message. Also converts values to other types if specified. + * @param message GetSubscriptionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.GetSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** MethodOptions deprecated */ - deprecated?: (boolean|null); + /** + * Converts this GetSubscriptionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + /** Properties of an UpdateSubscriptionRequest. */ + interface IUpdateSubscriptionRequest { - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** UpdateSubscriptionRequest subscription */ + subscription?: (google.pubsub.v1.ISubscription|null); - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); + /** UpdateSubscriptionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - } + /** Represents an UpdateSubscriptionRequest. */ + class UpdateSubscriptionRequest implements IUpdateSubscriptionRequest { - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { + /** + * Constructs a new UpdateSubscriptionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IUpdateSubscriptionRequest); - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); + /** UpdateSubscriptionRequest subscription. */ + public subscription?: (google.pubsub.v1.ISubscription|null); - /** MethodOptions deprecated. */ - public deprecated: boolean; + /** UpdateSubscriptionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + /** + * Creates a new UpdateSubscriptionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSubscriptionRequest instance + */ + public static create(properties?: google.pubsub.v1.IUpdateSubscriptionRequest): google.pubsub.v1.UpdateSubscriptionRequest; - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Encodes the specified UpdateSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. + * @param message UpdateSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IUpdateSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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 UpdateSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. + * @param message UpdateSubscriptionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IUpdateSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.UpdateSubscriptionRequest; - /** - * 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 an UpdateSubscriptionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.UpdateSubscriptionRequest; - /** - * 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; + /** + * Verifies an UpdateSubscriptionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a 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; + /** + * Creates an UpdateSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSubscriptionRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateSubscriptionRequest; - /** - * 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 plain object from an UpdateSubscriptionRequest message. Also converts values to other types if specified. + * @param message UpdateSubscriptionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.UpdateSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this UpdateSubscriptionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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 }; + /** Properties of a ListSubscriptionsRequest. */ + interface IListSubscriptionsRequest { - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ListSubscriptionsRequest project */ + project?: (string|null); - namespace MethodOptions { + /** ListSubscriptionsRequest pageSize */ + pageSize?: (number|null); - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 + /** ListSubscriptionsRequest pageToken */ + pageToken?: (string|null); } - } - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { + /** Represents a ListSubscriptionsRequest. */ + class ListSubscriptionsRequest implements IListSubscriptionsRequest { - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + /** + * Constructs a new ListSubscriptionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSubscriptionsRequest); - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); + /** ListSubscriptionsRequest project. */ + public project: string; - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); + /** ListSubscriptionsRequest pageSize. */ + public pageSize: number; - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); + /** ListSubscriptionsRequest pageToken. */ + public pageToken: string; - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); + /** + * Creates a new ListSubscriptionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSubscriptionsRequest instance + */ + public static create(properties?: google.pubsub.v1.IListSubscriptionsRequest): google.pubsub.v1.ListSubscriptionsRequest; - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|string|null); + /** + * Encodes the specified ListSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. + * @param message ListSubscriptionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } + /** + * Encodes the specified ListSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. + * @param message ListSubscriptionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSubscriptionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { + /** + * Decodes a ListSubscriptionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSubscriptionsRequest; - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); + /** + * Decodes a ListSubscriptionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSubscriptionsRequest; - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; + /** + * Verifies a ListSubscriptionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** UninterpretedOption identifierValue. */ - public identifierValue: string; + /** + * Creates a ListSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSubscriptionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSubscriptionsRequest; - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); + /** + * Creates a plain object from a ListSubscriptionsRequest message. Also converts values to other types if specified. + * @param message ListSubscriptionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSubscriptionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); + /** + * Converts this ListSubscriptionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** UninterpretedOption doubleValue. */ - public doubleValue: number; + /** Properties of a ListSubscriptionsResponse. */ + interface IListSubscriptionsResponse { - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|string); + /** ListSubscriptionsResponse subscriptions */ + subscriptions?: (google.pubsub.v1.ISubscription[]|null); - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; + /** ListSubscriptionsResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** - * 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; + /** Represents a ListSubscriptionsResponse. */ + class ListSubscriptionsResponse implements IListSubscriptionsResponse { - /** - * 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; + /** + * Constructs a new ListSubscriptionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IListSubscriptionsResponse); - /** - * 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; + /** ListSubscriptionsResponse subscriptions. */ + public subscriptions: google.pubsub.v1.ISubscription[]; - /** - * 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; + /** ListSubscriptionsResponse nextPageToken. */ + public nextPageToken: string; - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + /** + * Creates a new ListSubscriptionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSubscriptionsResponse instance + */ + public static create(properties?: google.pubsub.v1.IListSubscriptionsResponse): google.pubsub.v1.ListSubscriptionsResponse; - /** - * 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); + /** + * Encodes the specified ListSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. + * @param message ListSubscriptionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IListSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Encodes the specified ListSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. + * @param message ListSubscriptionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IListSubscriptionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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 }; + /** + * Decodes a ListSubscriptionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSubscriptionsResponse; - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a ListSubscriptionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSubscriptionsResponse; - namespace UninterpretedOption { + /** + * Verifies a ListSubscriptionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of a NamePart. */ - interface INamePart { + /** + * Creates a ListSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSubscriptionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSubscriptionsResponse; + + /** + * Creates a plain object from a ListSubscriptionsResponse message. Also converts values to other types if specified. + * @param message ListSubscriptionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ListSubscriptionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSubscriptionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** NamePart namePart */ - namePart: string; + /** Properties of a DeleteSubscriptionRequest. */ + interface IDeleteSubscriptionRequest { - /** NamePart isExtension */ - isExtension: boolean; + /** DeleteSubscriptionRequest subscription */ + subscription?: (string|null); } - /** Represents a NamePart. */ - class NamePart implements INamePart { + /** Represents a DeleteSubscriptionRequest. */ + class DeleteSubscriptionRequest implements IDeleteSubscriptionRequest { /** - * Constructs a new NamePart. + * Constructs a new DeleteSubscriptionRequest. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; + constructor(properties?: google.pubsub.v1.IDeleteSubscriptionRequest); - /** NamePart isExtension. */ - public isExtension: boolean; + /** DeleteSubscriptionRequest subscription. */ + public subscription: string; /** - * Creates a new NamePart instance using the specified properties. + * Creates a new DeleteSubscriptionRequest instance using the specified properties. * @param [properties] Properties to set - * @returns NamePart instance + * @returns DeleteSubscriptionRequest instance */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + public static create(properties?: google.pubsub.v1.IDeleteSubscriptionRequest): google.pubsub.v1.DeleteSubscriptionRequest; /** - * 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 + * Encodes the specified DeleteSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. + * @param message DeleteSubscriptionRequest 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; + public static encode(message: google.pubsub.v1.IDeleteSubscriptionRequest, 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 + * Encodes the specified DeleteSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. + * @param message DeleteSubscriptionRequest 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; + public static encodeDelimited(message: google.pubsub.v1.IDeleteSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NamePart message from the specified reader or buffer. + * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns NamePart + * @returns DeleteSubscriptionRequest * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DeleteSubscriptionRequest; /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. + * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NamePart + * @returns DeleteSubscriptionRequest * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DeleteSubscriptionRequest; /** - * Verifies a NamePart message. + * Verifies a DeleteSubscriptionRequest message. * @param message Plain object 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. + * Creates a DeleteSubscriptionRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NamePart + * @returns DeleteSubscriptionRequest */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSubscriptionRequest; /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart + * Creates a plain object from a DeleteSubscriptionRequest message. Also converts values to other types if specified. + * @param message DeleteSubscriptionRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.pubsub.v1.DeleteSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this NamePart to JSON. + * Converts this DeleteSubscriptionRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } + /** Properties of a ModifyPushConfigRequest. */ + interface IModifyPushConfigRequest { - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { + /** ModifyPushConfigRequest subscription */ + subscription?: (string|null); - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); + /** ModifyPushConfigRequest pushConfig */ + pushConfig?: (google.pubsub.v1.IPushConfig|null); + } - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; + /** Represents a ModifyPushConfigRequest. */ + class ModifyPushConfigRequest implements IModifyPushConfigRequest { - /** - * 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; + /** + * Constructs a new ModifyPushConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IModifyPushConfigRequest); - /** - * 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; + /** ModifyPushConfigRequest subscription. */ + public subscription: string; - /** - * 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; + /** ModifyPushConfigRequest pushConfig. */ + public pushConfig?: (google.pubsub.v1.IPushConfig|null); - /** - * 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; + /** + * Creates a new ModifyPushConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ModifyPushConfigRequest instance + */ + public static create(properties?: google.pubsub.v1.IModifyPushConfigRequest): google.pubsub.v1.ModifyPushConfigRequest; - /** - * 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; + /** + * Encodes the specified ModifyPushConfigRequest message. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. + * @param message ModifyPushConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IModifyPushConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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); + /** + * Encodes the specified ModifyPushConfigRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. + * @param message ModifyPushConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IModifyPushConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes a ModifyPushConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModifyPushConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ModifyPushConfigRequest; - /** - * 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 }; + /** + * Decodes a ModifyPushConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModifyPushConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ModifyPushConfigRequest; - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies a ModifyPushConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - namespace SourceCodeInfo { + /** + * Creates a ModifyPushConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModifyPushConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ModifyPushConfigRequest; - /** Properties of a Location. */ - interface ILocation { + /** + * Creates a plain object from a ModifyPushConfigRequest message. Also converts values to other types if specified. + * @param message ModifyPushConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.ModifyPushConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Location path */ - path?: (number[]|null); + /** + * Converts this ModifyPushConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Location span */ - span?: (number[]|null); + /** Properties of a PullRequest. */ + interface IPullRequest { - /** Location leadingComments */ - leadingComments?: (string|null); + /** PullRequest subscription */ + subscription?: (string|null); - /** Location trailingComments */ - trailingComments?: (string|null); + /** PullRequest returnImmediately */ + returnImmediately?: (boolean|null); - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); + /** PullRequest maxMessages */ + maxMessages?: (number|null); } - /** Represents a Location. */ - class Location implements ILocation { + /** Represents a PullRequest. */ + class PullRequest implements IPullRequest { /** - * Constructs a new Location. + * Constructs a new PullRequest. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; + constructor(properties?: google.pubsub.v1.IPullRequest); - /** Location leadingComments. */ - public leadingComments: string; + /** PullRequest subscription. */ + public subscription: string; - /** Location trailingComments. */ - public trailingComments: string; + /** PullRequest returnImmediately. */ + public returnImmediately: boolean; - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; + /** PullRequest maxMessages. */ + public maxMessages: number; /** - * Creates a new Location instance using the specified properties. + * Creates a new PullRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Location instance + * @returns PullRequest instance */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + public static create(properties?: google.pubsub.v1.IPullRequest): google.pubsub.v1.PullRequest; /** - * 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 + * Encodes the specified PullRequest message. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. + * @param message PullRequest 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; + public static encode(message: google.pubsub.v1.IPullRequest, 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 + * Encodes the specified PullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. + * @param message PullRequest 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; + public static encodeDelimited(message: google.pubsub.v1.IPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Location message from the specified reader or buffer. + * Decodes a PullRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Location + * @returns PullRequest * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PullRequest; /** - * Decodes a Location message from the specified reader or buffer, length delimited. + * Decodes a PullRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Location + * @returns PullRequest * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PullRequest; /** - * Verifies a Location message. + * Verifies a PullRequest message. * @param message Plain object 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. + * Creates a PullRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Location + * @returns PullRequest */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PullRequest; /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location + * Creates a plain object from a PullRequest message. Also converts values to other types if specified. + * @param message PullRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.pubsub.v1.PullRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Location to JSON. + * Converts this PullRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { + /** Properties of a PullResponse. */ + interface IPullResponse { - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); + /** PullResponse receivedMessages */ + receivedMessages?: (google.pubsub.v1.IReceivedMessage[]|null); + } - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + /** Represents a PullResponse. */ + class PullResponse implements IPullResponse { - /** - * 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; + /** + * Constructs a new PullResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IPullResponse); - /** - * 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; + /** PullResponse receivedMessages. */ + public receivedMessages: google.pubsub.v1.IReceivedMessage[]; - /** - * 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; + /** + * Creates a new PullResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PullResponse instance + */ + public static create(properties?: google.pubsub.v1.IPullResponse): google.pubsub.v1.PullResponse; - /** - * 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; + /** + * Encodes the specified PullResponse message. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. + * @param message PullResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Encodes the specified PullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. + * @param message PullResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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); + /** + * Decodes a PullResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PullResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PullResponse; - /** - * 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; + /** + * Decodes a PullResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PullResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PullResponse; - /** - * 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 }; + /** + * Verifies a PullResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a PullResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PullResponse + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PullResponse; - namespace GeneratedCodeInfo { + /** + * Creates a plain object from a PullResponse message. Also converts values to other types if specified. + * @param message PullResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.PullResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of an Annotation. */ - interface IAnnotation { + /** + * Converts this PullResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Annotation path */ - path?: (number[]|null); + /** Properties of a ModifyAckDeadlineRequest. */ + interface IModifyAckDeadlineRequest { - /** Annotation sourceFile */ - sourceFile?: (string|null); + /** ModifyAckDeadlineRequest subscription */ + subscription?: (string|null); - /** Annotation begin */ - begin?: (number|null); + /** ModifyAckDeadlineRequest ackIds */ + ackIds?: (string[]|null); - /** Annotation end */ - end?: (number|null); + /** ModifyAckDeadlineRequest ackDeadlineSeconds */ + ackDeadlineSeconds?: (number|null); } - /** Represents an Annotation. */ - class Annotation implements IAnnotation { + /** Represents a ModifyAckDeadlineRequest. */ + class ModifyAckDeadlineRequest implements IModifyAckDeadlineRequest { /** - * Constructs a new Annotation. + * Constructs a new ModifyAckDeadlineRequest. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; + constructor(properties?: google.pubsub.v1.IModifyAckDeadlineRequest); - /** Annotation sourceFile. */ - public sourceFile: string; + /** ModifyAckDeadlineRequest subscription. */ + public subscription: string; - /** Annotation begin. */ - public begin: number; + /** ModifyAckDeadlineRequest ackIds. */ + public ackIds: string[]; - /** Annotation end. */ - public end: number; + /** ModifyAckDeadlineRequest ackDeadlineSeconds. */ + public ackDeadlineSeconds: number; /** - * Creates a new Annotation instance using the specified properties. + * Creates a new ModifyAckDeadlineRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Annotation instance + * @returns ModifyAckDeadlineRequest instance */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + public static create(properties?: google.pubsub.v1.IModifyAckDeadlineRequest): google.pubsub.v1.ModifyAckDeadlineRequest; /** - * 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 + * Encodes the specified ModifyAckDeadlineRequest message. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. + * @param message ModifyAckDeadlineRequest 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; + public static encode(message: google.pubsub.v1.IModifyAckDeadlineRequest, 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 + * Encodes the specified ModifyAckDeadlineRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. + * @param message ModifyAckDeadlineRequest 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; + public static encodeDelimited(message: google.pubsub.v1.IModifyAckDeadlineRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Annotation message from the specified reader or buffer. + * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Annotation + * @returns ModifyAckDeadlineRequest * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ModifyAckDeadlineRequest; /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. + * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Annotation + * @returns ModifyAckDeadlineRequest * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ModifyAckDeadlineRequest; /** - * Verifies an Annotation message. + * Verifies a ModifyAckDeadlineRequest message. * @param message Plain 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. + * Creates a ModifyAckDeadlineRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Annotation + * @returns ModifyAckDeadlineRequest */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ModifyAckDeadlineRequest; /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation + * Creates a plain object from a ModifyAckDeadlineRequest message. Also converts values to other types if specified. + * @param message ModifyAckDeadlineRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.pubsub.v1.ModifyAckDeadlineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Annotation to JSON. + * Converts this ModifyAckDeadlineRequest to JSON. * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** 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 }; - } - - /** 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 }; - } - - /** 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); + */ + public toJSON(): { [k: string]: any }; + } - /** FieldMask paths. */ - public paths: string[]; + /** Properties of an AcknowledgeRequest. */ + interface IAcknowledgeRequest { - /** - * 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; + /** AcknowledgeRequest subscription */ + subscription?: (string|null); - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + /** AcknowledgeRequest ackIds */ + ackIds?: (string[]|null); + } - /** - * 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; + /** Represents an AcknowledgeRequest. */ + class AcknowledgeRequest implements IAcknowledgeRequest { - /** - * 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; + /** + * Constructs a new AcknowledgeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IAcknowledgeRequest); - /** - * 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; + /** AcknowledgeRequest subscription. */ + public subscription: string; - /** - * 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); + /** AcknowledgeRequest ackIds. */ + public ackIds: string[]; - /** - * 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 new AcknowledgeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AcknowledgeRequest instance + */ + public static create(properties?: google.pubsub.v1.IAcknowledgeRequest): google.pubsub.v1.AcknowledgeRequest; - /** - * 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 }; + /** + * Encodes the specified AcknowledgeRequest message. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. + * @param message AcknowledgeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IAcknowledgeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this FieldMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified AcknowledgeRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. + * @param message AcknowledgeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IAcknowledgeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a Timestamp. */ - interface ITimestamp { + /** + * Decodes an AcknowledgeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcknowledgeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.AcknowledgeRequest; - /** Timestamp seconds */ - seconds?: (number|Long|string|null); + /** + * Decodes an AcknowledgeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcknowledgeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.AcknowledgeRequest; - /** Timestamp nanos */ - nanos?: (number|null); - } + /** + * Verifies an AcknowledgeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { + /** + * Creates an AcknowledgeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcknowledgeRequest + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.AcknowledgeRequest; - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); + /** + * Creates a plain object from an AcknowledgeRequest message. Also converts values to other types if specified. + * @param message AcknowledgeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.AcknowledgeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Timestamp seconds. */ - public seconds: (number|Long|string); + /** + * Converts this AcknowledgeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Timestamp nanos. */ - public nanos: number; + /** Properties of a StreamingPullRequest. */ + interface IStreamingPullRequest { - /** - * 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; + /** StreamingPullRequest subscription */ + subscription?: (string|null); - /** - * 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; + /** StreamingPullRequest ackIds */ + ackIds?: (string[]|null); - /** - * 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; + /** StreamingPullRequest modifyDeadlineSeconds */ + modifyDeadlineSeconds?: (number[]|null); - /** - * 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; + /** StreamingPullRequest modifyDeadlineAckIds */ + modifyDeadlineAckIds?: (string[]|null); - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + /** StreamingPullRequest streamAckDeadlineSeconds */ + streamAckDeadlineSeconds?: (number|null); - /** - * Verifies a Timestamp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** StreamingPullRequest clientId */ + clientId?: (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; + /** Represents a StreamingPullRequest. */ + class StreamingPullRequest implements IStreamingPullRequest { - /** - * 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 }; + /** + * Constructs a new StreamingPullRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IStreamingPullRequest); - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** StreamingPullRequest subscription. */ + public subscription: string; - /** Namespace iam. */ - namespace iam { + /** StreamingPullRequest ackIds. */ + public ackIds: string[]; - /** Namespace v1. */ - namespace v1 { + /** StreamingPullRequest modifyDeadlineSeconds. */ + public modifyDeadlineSeconds: number[]; - /** Represents a IAMPolicy */ - class IAMPolicy extends $protobuf.rpc.Service { + /** StreamingPullRequest modifyDeadlineAckIds. */ + public modifyDeadlineAckIds: string[]; - /** - * Constructs a new IAMPolicy service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + /** StreamingPullRequest streamAckDeadlineSeconds. */ + public streamAckDeadlineSeconds: number; - /** - * Creates new IAMPolicy service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): IAMPolicy; + /** StreamingPullRequest clientId. */ + public clientId: string; /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy + * Creates a new StreamingPullRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingPullRequest instance */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; + public static create(properties?: google.pubsub.v1.IStreamingPullRequest): google.pubsub.v1.StreamingPullRequest; /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise + * Encodes the specified StreamingPullRequest message. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. + * @param message StreamingPullRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + public static encode(message: google.pubsub.v1.IStreamingPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy + * Encodes the specified StreamingPullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. + * @param message StreamingPullRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; + public static encodeDelimited(message: google.pubsub.v1.IStreamingPullRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise + * Decodes a StreamingPullRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingPullRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.StreamingPullRequest; /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * Decodes a StreamingPullRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingPullRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.StreamingPullRequest; /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise + * Verifies a StreamingPullRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - } - - namespace IAMPolicy { + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.iam.v1.IAMPolicy#setIamPolicy}. - * @param error Error, if any - * @param [response] Policy + * Creates a StreamingPullRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingPullRequest */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullRequest; /** - * Callback as used by {@link google.iam.v1.IAMPolicy#getIamPolicy}. - * @param error Error, if any - * @param [response] Policy + * Creates a plain object from a StreamingPullRequest message. Also converts values to other types if specified. + * @param message StreamingPullRequest + * @param [options] Conversion options + * @returns Plain object */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + public static toObject(message: google.pubsub.v1.StreamingPullRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.iam.v1.IAMPolicy#testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse + * Converts this StreamingPullRequest to JSON. + * @returns JSON object */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + public toJSON(): { [k: string]: any }; } - /** Properties of a SetIamPolicyRequest. */ - interface ISetIamPolicyRequest { - - /** SetIamPolicyRequest resource */ - resource?: (string|null); + /** Properties of a StreamingPullResponse. */ + interface IStreamingPullResponse { - /** SetIamPolicyRequest policy */ - policy?: (google.iam.v1.IPolicy|null); + /** StreamingPullResponse receivedMessages */ + receivedMessages?: (google.pubsub.v1.IReceivedMessage[]|null); } - /** Represents a SetIamPolicyRequest. */ - class SetIamPolicyRequest implements ISetIamPolicyRequest { + /** Represents a StreamingPullResponse. */ + class StreamingPullResponse implements IStreamingPullResponse { /** - * Constructs a new SetIamPolicyRequest. + * Constructs a new StreamingPullResponse. * @param [properties] Properties to set */ - constructor(properties?: google.iam.v1.ISetIamPolicyRequest); - - /** SetIamPolicyRequest resource. */ - public resource: string; + constructor(properties?: google.pubsub.v1.IStreamingPullResponse); - /** SetIamPolicyRequest policy. */ - public policy?: (google.iam.v1.IPolicy|null); + /** StreamingPullResponse receivedMessages. */ + public receivedMessages: google.pubsub.v1.IReceivedMessage[]; /** - * Creates a new SetIamPolicyRequest instance using the specified properties. + * Creates a new StreamingPullResponse instance using the specified properties. * @param [properties] Properties to set - * @returns SetIamPolicyRequest instance + * @returns StreamingPullResponse instance */ - public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; + public static create(properties?: google.pubsub.v1.IStreamingPullResponse): google.pubsub.v1.StreamingPullResponse; /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode + * Encodes the specified StreamingPullResponse message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. + * @param message StreamingPullResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.pubsub.v1.IStreamingPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode + * Encodes the specified StreamingPullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. + * @param message StreamingPullResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.pubsub.v1.IStreamingPullResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * Decodes a StreamingPullResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SetIamPolicyRequest + * @returns StreamingPullResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.StreamingPullResponse; /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a StreamingPullResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SetIamPolicyRequest + * @returns StreamingPullResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.StreamingPullResponse; /** - * Verifies a SetIamPolicyRequest message. + * Verifies a StreamingPullResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StreamingPullResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SetIamPolicyRequest + * @returns StreamingPullResponse */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.StreamingPullResponse; /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. - * @param message SetIamPolicyRequest + * Creates a plain object from a StreamingPullResponse message. Also converts values to other types if specified. + * @param message StreamingPullResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.pubsub.v1.StreamingPullResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SetIamPolicyRequest to JSON. + * Converts this StreamingPullResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetIamPolicyRequest. */ - interface IGetIamPolicyRequest { + /** Properties of a CreateSnapshotRequest. */ + interface ICreateSnapshotRequest { - /** GetIamPolicyRequest resource */ - resource?: (string|null); + /** CreateSnapshotRequest name */ + name?: (string|null); - /** GetIamPolicyRequest options */ - options?: (google.iam.v1.IGetPolicyOptions|null); + /** CreateSnapshotRequest subscription */ + subscription?: (string|null); + + /** CreateSnapshotRequest labels */ + labels?: ({ [k: string]: string }|null); } - /** Represents a GetIamPolicyRequest. */ - class GetIamPolicyRequest implements IGetIamPolicyRequest { + /** Represents a CreateSnapshotRequest. */ + class CreateSnapshotRequest implements ICreateSnapshotRequest { /** - * Constructs a new GetIamPolicyRequest. + * Constructs a new CreateSnapshotRequest. * @param [properties] Properties to set */ - constructor(properties?: google.iam.v1.IGetIamPolicyRequest); + constructor(properties?: google.pubsub.v1.ICreateSnapshotRequest); - /** GetIamPolicyRequest resource. */ - public resource: string; + /** CreateSnapshotRequest name. */ + public name: string; - /** GetIamPolicyRequest options. */ - public options?: (google.iam.v1.IGetPolicyOptions|null); + /** CreateSnapshotRequest subscription. */ + public subscription: string; + + /** CreateSnapshotRequest labels. */ + public labels: { [k: string]: string }; /** - * Creates a new GetIamPolicyRequest instance using the specified properties. + * Creates a new CreateSnapshotRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetIamPolicyRequest instance + * @returns CreateSnapshotRequest instance */ - public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; + public static create(properties?: google.pubsub.v1.ICreateSnapshotRequest): google.pubsub.v1.CreateSnapshotRequest; /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode + * Encodes the specified CreateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. + * @param message CreateSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.pubsub.v1.ICreateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode + * Encodes the specified CreateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. + * @param message CreateSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.pubsub.v1.ICreateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * Decodes a CreateSnapshotRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetIamPolicyRequest + * @returns CreateSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.CreateSnapshotRequest; /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSnapshotRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetIamPolicyRequest + * @returns CreateSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.CreateSnapshotRequest; /** - * Verifies a GetIamPolicyRequest message. + * Verifies a CreateSnapshotRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetIamPolicyRequest + * @returns CreateSnapshotRequest */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.CreateSnapshotRequest; /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. - * @param message GetIamPolicyRequest + * Creates a plain object from a CreateSnapshotRequest message. Also converts values to other types if specified. + * @param message CreateSnapshotRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.pubsub.v1.CreateSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetIamPolicyRequest to JSON. + * Converts this CreateSnapshotRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TestIamPermissionsRequest. */ - interface ITestIamPermissionsRequest { + /** Properties of an UpdateSnapshotRequest. */ + interface IUpdateSnapshotRequest { - /** TestIamPermissionsRequest resource */ - resource?: (string|null); + /** UpdateSnapshotRequest snapshot */ + snapshot?: (google.pubsub.v1.ISnapshot|null); - /** TestIamPermissionsRequest permissions */ - permissions?: (string[]|null); + /** UpdateSnapshotRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a TestIamPermissionsRequest. */ - class TestIamPermissionsRequest implements ITestIamPermissionsRequest { + /** Represents an UpdateSnapshotRequest. */ + class UpdateSnapshotRequest implements IUpdateSnapshotRequest { /** - * Constructs a new TestIamPermissionsRequest. + * Constructs a new UpdateSnapshotRequest. * @param [properties] Properties to set */ - constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); + constructor(properties?: google.pubsub.v1.IUpdateSnapshotRequest); - /** TestIamPermissionsRequest resource. */ - public resource: string; + /** UpdateSnapshotRequest snapshot. */ + public snapshot?: (google.pubsub.v1.ISnapshot|null); - /** TestIamPermissionsRequest permissions. */ - public permissions: string[]; + /** UpdateSnapshotRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. + * Creates a new UpdateSnapshotRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TestIamPermissionsRequest instance + * @returns UpdateSnapshotRequest instance */ - public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; + public static create(properties?: google.pubsub.v1.IUpdateSnapshotRequest): google.pubsub.v1.UpdateSnapshotRequest; /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode + * Encodes the specified UpdateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. + * @param message UpdateSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.pubsub.v1.IUpdateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode + * Encodes the specified UpdateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. + * @param message UpdateSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.pubsub.v1.IUpdateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * Decodes an UpdateSnapshotRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TestIamPermissionsRequest + * @returns UpdateSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.UpdateSnapshotRequest; /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateSnapshotRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsRequest + * @returns UpdateSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.UpdateSnapshotRequest; /** - * Verifies a TestIamPermissionsRequest message. + * Verifies an UpdateSnapshotRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TestIamPermissionsRequest + * @returns UpdateSnapshotRequest */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.UpdateSnapshotRequest; /** - * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. - * @param message TestIamPermissionsRequest + * Creates a plain object from an UpdateSnapshotRequest message. Also converts values to other types if specified. + * @param message UpdateSnapshotRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.pubsub.v1.UpdateSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TestIamPermissionsRequest to JSON. + * Converts this UpdateSnapshotRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TestIamPermissionsResponse. */ - interface ITestIamPermissionsResponse { + /** Properties of a Snapshot. */ + interface ISnapshot { - /** TestIamPermissionsResponse permissions */ - permissions?: (string[]|null); + /** Snapshot name */ + name?: (string|null); + + /** Snapshot topic */ + topic?: (string|null); + + /** Snapshot expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot labels */ + labels?: ({ [k: string]: string }|null); } - /** Represents a TestIamPermissionsResponse. */ - class TestIamPermissionsResponse implements ITestIamPermissionsResponse { + /** Represents a Snapshot. */ + class Snapshot implements ISnapshot { /** - * Constructs a new TestIamPermissionsResponse. + * Constructs a new Snapshot. * @param [properties] Properties to set */ - constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); + constructor(properties?: google.pubsub.v1.ISnapshot); - /** TestIamPermissionsResponse permissions. */ - public permissions: string[]; + /** Snapshot name. */ + public name: string; + + /** Snapshot topic. */ + public topic: string; + + /** Snapshot expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot labels. */ + public labels: { [k: string]: string }; /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. + * Creates a new Snapshot instance using the specified properties. * @param [properties] Properties to set - * @returns TestIamPermissionsResponse instance + * @returns Snapshot instance */ - public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; + public static create(properties?: google.pubsub.v1.ISnapshot): google.pubsub.v1.Snapshot; /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode + * Encodes the specified Snapshot message. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. + * @param message Snapshot message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.pubsub.v1.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. + * @param message Snapshot message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.pubsub.v1.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * Decodes a Snapshot message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TestIamPermissionsResponse + * @returns Snapshot * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.Snapshot; /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * Decodes a Snapshot message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsResponse + * @returns Snapshot * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.Snapshot; /** - * Verifies a TestIamPermissionsResponse message. + * Verifies a Snapshot message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TestIamPermissionsResponse + * @returns Snapshot */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.Snapshot; /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. - * @param message TestIamPermissionsResponse + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @param message Snapshot * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.pubsub.v1.Snapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TestIamPermissionsResponse to JSON. + * Converts this Snapshot to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetPolicyOptions. */ - interface IGetPolicyOptions { + /** Properties of a GetSnapshotRequest. */ + interface IGetSnapshotRequest { - /** GetPolicyOptions requestedPolicyVersion */ - requestedPolicyVersion?: (number|null); + /** GetSnapshotRequest snapshot */ + snapshot?: (string|null); } - /** Represents a GetPolicyOptions. */ - class GetPolicyOptions implements IGetPolicyOptions { + /** Represents a GetSnapshotRequest. */ + class GetSnapshotRequest implements IGetSnapshotRequest { /** - * Constructs a new GetPolicyOptions. + * Constructs a new GetSnapshotRequest. * @param [properties] Properties to set */ - constructor(properties?: google.iam.v1.IGetPolicyOptions); + constructor(properties?: google.pubsub.v1.IGetSnapshotRequest); - /** GetPolicyOptions requestedPolicyVersion. */ - public requestedPolicyVersion: number; + /** GetSnapshotRequest snapshot. */ + public snapshot: string; /** - * Creates a new GetPolicyOptions instance using the specified properties. + * Creates a new GetSnapshotRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetPolicyOptions instance + * @returns GetSnapshotRequest instance */ - public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; + public static create(properties?: google.pubsub.v1.IGetSnapshotRequest): google.pubsub.v1.GetSnapshotRequest; /** - * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode + * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. + * @param message GetSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.pubsub.v1.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode + * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. + * @param message GetSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.pubsub.v1.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetPolicyOptions message from the specified reader or buffer. + * Decodes a GetSnapshotRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetPolicyOptions + * @returns GetSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.GetSnapshotRequest; /** - * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetPolicyOptions + * @returns GetSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.GetSnapshotRequest; /** - * Verifies a GetPolicyOptions message. + * Verifies a GetSnapshotRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetPolicyOptions + * @returns GetSnapshotRequest */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.GetSnapshotRequest; /** - * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. - * @param message GetPolicyOptions + * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. + * @param message GetSnapshotRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.pubsub.v1.GetSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetPolicyOptions to JSON. + * Converts this GetSnapshotRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Policy. */ - interface IPolicy { + /** Properties of a ListSnapshotsRequest. */ + interface IListSnapshotsRequest { - /** Policy version */ - version?: (number|null); + /** ListSnapshotsRequest project */ + project?: (string|null); - /** Policy bindings */ - bindings?: (google.iam.v1.IBinding[]|null); + /** ListSnapshotsRequest pageSize */ + pageSize?: (number|null); - /** Policy etag */ - etag?: (Uint8Array|string|null); + /** ListSnapshotsRequest pageToken */ + pageToken?: (string|null); } - /** Represents a Policy. */ - class Policy implements IPolicy { + /** Represents a ListSnapshotsRequest. */ + class ListSnapshotsRequest implements IListSnapshotsRequest { /** - * Constructs a new Policy. + * Constructs a new ListSnapshotsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.iam.v1.IPolicy); - - /** Policy version. */ - public version: number; + constructor(properties?: google.pubsub.v1.IListSnapshotsRequest); - /** Policy bindings. */ - public bindings: google.iam.v1.IBinding[]; + /** ListSnapshotsRequest project. */ + public project: string; - /** Policy etag. */ - public etag: (Uint8Array|string); + /** ListSnapshotsRequest pageSize. */ + public pageSize: number; + + /** ListSnapshotsRequest pageToken. */ + public pageToken: string; /** - * Creates a new Policy instance using the specified properties. + * Creates a new ListSnapshotsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Policy instance + * @returns ListSnapshotsRequest instance */ - public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + public static create(properties?: google.pubsub.v1.IListSnapshotsRequest): google.pubsub.v1.ListSnapshotsRequest; /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode + * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. + * @param message ListSnapshotsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.pubsub.v1.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode + * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. + * @param message ListSnapshotsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.pubsub.v1.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Policy message from the specified reader or buffer. + * Decodes a ListSnapshotsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Policy + * @returns ListSnapshotsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSnapshotsRequest; /** - * Decodes a Policy message from the specified reader or buffer, length delimited. + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Policy + * @returns ListSnapshotsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSnapshotsRequest; /** - * Verifies a Policy message. + * Verifies a ListSnapshotsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Policy + * @returns ListSnapshotsRequest */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSnapshotsRequest; /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @param message Policy + * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. + * @param message ListSnapshotsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.pubsub.v1.ListSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Policy to JSON. + * Converts this ListSnapshotsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Binding. */ - interface IBinding { - - /** Binding role */ - role?: (string|null); + /** Properties of a ListSnapshotsResponse. */ + interface IListSnapshotsResponse { - /** Binding members */ - members?: (string[]|null); + /** ListSnapshotsResponse snapshots */ + snapshots?: (google.pubsub.v1.ISnapshot[]|null); - /** Binding condition */ - condition?: (google.type.IExpr|null); + /** ListSnapshotsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a Binding. */ - class Binding implements IBinding { + /** Represents a ListSnapshotsResponse. */ + class ListSnapshotsResponse implements IListSnapshotsResponse { /** - * Constructs a new Binding. + * Constructs a new ListSnapshotsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.iam.v1.IBinding); - - /** Binding role. */ - public role: string; + constructor(properties?: google.pubsub.v1.IListSnapshotsResponse); - /** Binding members. */ - public members: string[]; + /** ListSnapshotsResponse snapshots. */ + public snapshots: google.pubsub.v1.ISnapshot[]; - /** Binding condition. */ - public condition?: (google.type.IExpr|null); + /** ListSnapshotsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new Binding instance using the specified properties. + * Creates a new ListSnapshotsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Binding instance + * @returns ListSnapshotsResponse instance */ - public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + public static create(properties?: google.pubsub.v1.IListSnapshotsResponse): google.pubsub.v1.ListSnapshotsResponse; /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode + * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. + * @param message ListSnapshotsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.pubsub.v1.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode + * Encodes the specified ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. + * @param message ListSnapshotsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.pubsub.v1.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Binding message from the specified reader or buffer. + * Decodes a ListSnapshotsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Binding + * @returns ListSnapshotsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.ListSnapshotsResponse; /** - * Decodes a Binding message from the specified reader or buffer, length delimited. + * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Binding + * @returns ListSnapshotsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.ListSnapshotsResponse; /** - * Verifies a Binding message. + * Verifies a ListSnapshotsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Binding + * @returns ListSnapshotsResponse */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.ListSnapshotsResponse; /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @param message Binding + * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. + * @param message ListSnapshotsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.pubsub.v1.ListSnapshotsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Binding to JSON. + * Converts this ListSnapshotsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PolicyDelta. */ - interface IPolicyDelta { - - /** PolicyDelta bindingDeltas */ - bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + /** Properties of a DeleteSnapshotRequest. */ + interface IDeleteSnapshotRequest { - /** PolicyDelta auditConfigDeltas */ - auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + /** DeleteSnapshotRequest snapshot */ + snapshot?: (string|null); } - /** Represents a PolicyDelta. */ - class PolicyDelta implements IPolicyDelta { + /** Represents a DeleteSnapshotRequest. */ + class DeleteSnapshotRequest implements IDeleteSnapshotRequest { /** - * Constructs a new PolicyDelta. + * Constructs a new DeleteSnapshotRequest. * @param [properties] Properties to set */ - constructor(properties?: google.iam.v1.IPolicyDelta); - - /** PolicyDelta bindingDeltas. */ - public bindingDeltas: google.iam.v1.IBindingDelta[]; + constructor(properties?: google.pubsub.v1.IDeleteSnapshotRequest); - /** PolicyDelta auditConfigDeltas. */ - public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + /** DeleteSnapshotRequest snapshot. */ + public snapshot: string; /** - * Creates a new PolicyDelta instance using the specified properties. + * Creates a new DeleteSnapshotRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PolicyDelta instance + * @returns DeleteSnapshotRequest instance */ - public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + public static create(properties?: google.pubsub.v1.IDeleteSnapshotRequest): google.pubsub.v1.DeleteSnapshotRequest; /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode + * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. + * @param message DeleteSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.pubsub.v1.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode + * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. + * @param message DeleteSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.pubsub.v1.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PolicyDelta message from the specified reader or buffer. + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PolicyDelta + * @returns DeleteSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DeleteSnapshotRequest; /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PolicyDelta + * @returns DeleteSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DeleteSnapshotRequest; /** - * Verifies a PolicyDelta message. + * Verifies a DeleteSnapshotRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PolicyDelta + * @returns DeleteSnapshotRequest */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DeleteSnapshotRequest; /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @param message PolicyDelta + * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. + * @param message DeleteSnapshotRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.pubsub.v1.DeleteSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PolicyDelta to JSON. + * Converts this DeleteSnapshotRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BindingDelta. */ - interface IBindingDelta { - - /** BindingDelta action */ - action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + /** Properties of a SeekRequest. */ + interface ISeekRequest { - /** BindingDelta role */ - role?: (string|null); + /** SeekRequest subscription */ + subscription?: (string|null); - /** BindingDelta member */ - member?: (string|null); + /** SeekRequest time */ + time?: (google.protobuf.ITimestamp|null); - /** BindingDelta condition */ - condition?: (google.type.IExpr|null); + /** SeekRequest snapshot */ + snapshot?: (string|null); } - /** Represents a BindingDelta. */ - class BindingDelta implements IBindingDelta { + /** Represents a SeekRequest. */ + class SeekRequest implements ISeekRequest { /** - * Constructs a new BindingDelta. + * Constructs a new SeekRequest. * @param [properties] Properties to set */ - constructor(properties?: google.iam.v1.IBindingDelta); + constructor(properties?: google.pubsub.v1.ISeekRequest); - /** BindingDelta action. */ - public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + /** SeekRequest subscription. */ + public subscription: string; - /** BindingDelta role. */ - public role: string; + /** SeekRequest time. */ + public time?: (google.protobuf.ITimestamp|null); - /** BindingDelta member. */ - public member: string; + /** SeekRequest snapshot. */ + public snapshot: string; - /** BindingDelta condition. */ - public condition?: (google.type.IExpr|null); + /** SeekRequest target. */ + public target?: ("time"|"snapshot"); /** - * Creates a new BindingDelta instance using the specified properties. + * Creates a new SeekRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BindingDelta instance + * @returns SeekRequest instance */ - public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + public static create(properties?: google.pubsub.v1.ISeekRequest): google.pubsub.v1.SeekRequest; /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode + * Encodes the specified SeekRequest message. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. + * @param message SeekRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.pubsub.v1.ISeekRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode + * Encodes the specified SeekRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. + * @param message SeekRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.pubsub.v1.ISeekRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BindingDelta message from the specified reader or buffer. + * Decodes a SeekRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BindingDelta + * @returns SeekRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.SeekRequest; /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * Decodes a SeekRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BindingDelta + * @returns SeekRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.SeekRequest; /** - * Verifies a BindingDelta message. + * Verifies a SeekRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * Creates a SeekRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BindingDelta + * @returns SeekRequest */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.SeekRequest; /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @param message BindingDelta + * Creates a plain object from a SeekRequest message. Also converts values to other types if specified. + * @param message SeekRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.pubsub.v1.SeekRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BindingDelta to JSON. + * Converts this SeekRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace BindingDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - - /** Properties of an AuditConfigDelta. */ - interface IAuditConfigDelta { - - /** AuditConfigDelta action */ - action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); - - /** AuditConfigDelta service */ - service?: (string|null); - - /** AuditConfigDelta exemptedMember */ - exemptedMember?: (string|null); - - /** AuditConfigDelta logType */ - logType?: (string|null); + /** Properties of a SeekResponse. */ + interface ISeekResponse { } - /** Represents an AuditConfigDelta. */ - class AuditConfigDelta implements IAuditConfigDelta { + /** Represents a SeekResponse. */ + class SeekResponse implements ISeekResponse { /** - * Constructs a new AuditConfigDelta. + * Constructs a new SeekResponse. * @param [properties] Properties to set */ - constructor(properties?: google.iam.v1.IAuditConfigDelta); - - /** AuditConfigDelta action. */ - public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); - - /** AuditConfigDelta service. */ - public service: string; - - /** AuditConfigDelta exemptedMember. */ - public exemptedMember: string; - - /** AuditConfigDelta logType. */ - public logType: string; + constructor(properties?: google.pubsub.v1.ISeekResponse); /** - * Creates a new AuditConfigDelta instance using the specified properties. + * Creates a new SeekResponse instance using the specified properties. * @param [properties] Properties to set - * @returns AuditConfigDelta instance + * @returns SeekResponse instance */ - public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + public static create(properties?: google.pubsub.v1.ISeekResponse): google.pubsub.v1.SeekResponse; /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode + * Encodes the specified SeekResponse message. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. + * @param message SeekResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.pubsub.v1.ISeekResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode + * Encodes the specified SeekResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. + * @param message SeekResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.pubsub.v1.ISeekResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. + * Decodes a SeekResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AuditConfigDelta + * @returns SeekResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.SeekResponse; /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * Decodes a SeekResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AuditConfigDelta + * @returns SeekResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.SeekResponse; /** - * Verifies an AuditConfigDelta message. + * Verifies a SeekResponse message. * @param message Plain 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * Creates a SeekResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AuditConfigDelta + * @returns SeekResponse */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.SeekResponse; /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @param message AuditConfigDelta + * Creates a plain object from a SeekResponse message. Also converts values to other types if specified. + * @param message SeekResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.pubsub.v1.SeekResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AuditConfigDelta to JSON. + * Converts this SeekResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - - namespace AuditConfigDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - } - } - - /** 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 }; } } } diff --git a/protos/protos.js b/protos/protos.js index 4d983e4a1..45f51a30b 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + var $root = $protobuf.roots._google_cloud_pubsub_1_7_1_protos || ($protobuf.roots._google_cloud_pubsub_1_7_1_protos = {}); $root.google = (function() { @@ -39,421 +39,413 @@ */ var google = {}; - google.pubsub = (function() { + google.iam = (function() { /** - * Namespace pubsub. + * Namespace iam. * @memberof google * @namespace */ - var pubsub = {}; + var iam = {}; - pubsub.v1 = (function() { + iam.v1 = (function() { /** * Namespace v1. - * @memberof google.pubsub + * @memberof google.iam * @namespace */ var v1 = {}; - v1.Publisher = (function() { + v1.Policy = (function() { /** - * Constructs a new Publisher service. - * @memberof google.pubsub.v1 - * @classdesc Represents a Publisher - * @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 + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Uint8Array|null} [etag] Policy etag */ - function Publisher(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Publisher.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Publisher; /** - * Creates new Publisher service using the specified rpc implementation. - * @function create - * @memberof google.pubsub.v1.Publisher - * @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 {Publisher} RPC service. Useful where requests and/or responses are streamed. + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set */ - Publisher.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + function Policy(properties) { + this.bindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Callback as used by {@link google.pubsub.v1.Publisher#createTopic}. - * @memberof google.pubsub.v1.Publisher - * @typedef CreateTopicCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Topic} [response] Topic + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance */ + Policy.prototype.version = 0; /** - * Calls CreateTopic. - * @function createTopic - * @memberof google.pubsub.v1.Publisher + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy * @instance - * @param {google.pubsub.v1.ITopic} request Topic message or plain object - * @param {google.pubsub.v1.Publisher.CreateTopicCallback} callback Node-style callback called with the error, if any, and Topic - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Publisher.prototype.createTopic = function createTopic(request, callback) { - return this.rpcCall(createTopic, $root.google.pubsub.v1.Topic, $root.google.pubsub.v1.Topic, request, callback); - }, "name", { value: "CreateTopic" }); + Policy.prototype.bindings = $util.emptyArray; /** - * Calls CreateTopic. - * @function createTopic - * @memberof google.pubsub.v1.Publisher + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy * @instance - * @param {google.pubsub.v1.ITopic} request Topic message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Policy.prototype.etag = $util.newBuffer([]); /** - * Callback as used by {@link google.pubsub.v1.Publisher#updateTopic}. - * @memberof google.pubsub.v1.Publisher - * @typedef UpdateTopicCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Topic} [response] Topic + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance */ + Policy.create = function create(properties) { + return new Policy(properties); + }; /** - * Calls UpdateTopic. - * @function updateTopic - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IUpdateTopicRequest} request UpdateTopicRequest message or plain object - * @param {google.pubsub.v1.Publisher.UpdateTopicCallback} callback Node-style callback called with the error, if any, and Topic - * @returns {undefined} - * @variation 1 + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(Publisher.prototype.updateTopic = function updateTopic(request, callback) { - return this.rpcCall(updateTopic, $root.google.pubsub.v1.UpdateTopicRequest, $root.google.pubsub.v1.Topic, request, callback); - }, "name", { value: "UpdateTopic" }); + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && message.hasOwnProperty("version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && message.hasOwnProperty("etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; /** - * Calls UpdateTopic. - * @function updateTopic - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IUpdateTopicRequest} request UpdateTopicRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.pubsub.v1.Publisher#publish}. - * @memberof google.pubsub.v1.Publisher - * @typedef PublishCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.PublishResponse} [response] PublishResponse + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + Policy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.int32(); + break; + case 4: + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + case 3: + message.etag = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls Publish. - * @function publish - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IPublishRequest} request PublishRequest message or plain object - * @param {google.pubsub.v1.Publisher.PublishCallback} callback Node-style callback called with the error, if any, and PublishResponse - * @returns {undefined} - * @variation 1 + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(Publisher.prototype.publish = function publish(request, callback) { - return this.rpcCall(publish, $root.google.pubsub.v1.PublishRequest, $root.google.pubsub.v1.PublishResponse, request, callback); - }, "name", { value: "Publish" }); + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls Publish. - * @function publish - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IPublishRequest} request PublishRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; /** - * Callback as used by {@link google.pubsub.v1.Publisher#getTopic}. - * @memberof google.pubsub.v1.Publisher - * @typedef GetTopicCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Topic} [response] Topic - */ + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length) + message.etag = object.etag; + return message; + }; /** - * Calls GetTopic. - * @function getTopic - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IGetTopicRequest} request GetTopicRequest message or plain object - * @param {google.pubsub.v1.Publisher.GetTopicCallback} callback Node-style callback called with the error, if any, and Topic - * @returns {undefined} - * @variation 1 + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(Publisher.prototype.getTopic = function getTopic(request, callback) { - return this.rpcCall(getTopic, $root.google.pubsub.v1.GetTopicRequest, $root.google.pubsub.v1.Topic, request, callback); - }, "name", { value: "GetTopic" }); + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bindings = []; + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + return object; + }; /** - * Calls GetTopic. - * @function getTopic - * @memberof google.pubsub.v1.Publisher + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy * @instance - * @param {google.pubsub.v1.IGetTopicRequest} request GetTopicRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Callback as used by {@link google.pubsub.v1.Publisher#listTopics}. - * @memberof google.pubsub.v1.Publisher - * @typedef ListTopicsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.ListTopicsResponse} [response] ListTopicsResponse - */ + return Policy; + })(); - /** - * Calls ListTopics. - * @function listTopics - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IListTopicsRequest} request ListTopicsRequest message or plain object - * @param {google.pubsub.v1.Publisher.ListTopicsCallback} callback Node-style callback called with the error, if any, and ListTopicsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Publisher.prototype.listTopics = function listTopics(request, callback) { - return this.rpcCall(listTopics, $root.google.pubsub.v1.ListTopicsRequest, $root.google.pubsub.v1.ListTopicsResponse, request, callback); - }, "name", { value: "ListTopics" }); + v1.Binding = (function() { /** - * Calls ListTopics. - * @function listTopics - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IListTopicsRequest} request ListTopicsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition */ /** - * Callback as used by {@link google.pubsub.v1.Publisher#listTopicSubscriptions}. - * @memberof google.pubsub.v1.Publisher - * @typedef ListTopicSubscriptionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.ListTopicSubscriptionsResponse} [response] ListTopicSubscriptionsResponse + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set */ + function Binding(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls ListTopicSubscriptions. - * @function listTopicSubscriptions - * @memberof google.pubsub.v1.Publisher + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding * @instance - * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} request ListTopicSubscriptionsRequest message or plain object - * @param {google.pubsub.v1.Publisher.ListTopicSubscriptionsCallback} callback Node-style callback called with the error, if any, and ListTopicSubscriptionsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Publisher.prototype.listTopicSubscriptions = function listTopicSubscriptions(request, callback) { - return this.rpcCall(listTopicSubscriptions, $root.google.pubsub.v1.ListTopicSubscriptionsRequest, $root.google.pubsub.v1.ListTopicSubscriptionsResponse, request, callback); - }, "name", { value: "ListTopicSubscriptions" }); + Binding.prototype.role = ""; /** - * Calls ListTopicSubscriptions. - * @function listTopicSubscriptions - * @memberof google.pubsub.v1.Publisher + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding * @instance - * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} request ListTopicSubscriptionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.pubsub.v1.Publisher#listTopicSnapshots}. - * @memberof google.pubsub.v1.Publisher - * @typedef ListTopicSnapshotsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.ListTopicSnapshotsResponse} [response] ListTopicSnapshotsResponse */ + Binding.prototype.members = $util.emptyArray; /** - * Calls ListTopicSnapshots. - * @function listTopicSnapshots - * @memberof google.pubsub.v1.Publisher + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding * @instance - * @param {google.pubsub.v1.IListTopicSnapshotsRequest} request ListTopicSnapshotsRequest message or plain object - * @param {google.pubsub.v1.Publisher.ListTopicSnapshotsCallback} callback Node-style callback called with the error, if any, and ListTopicSnapshotsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Publisher.prototype.listTopicSnapshots = function listTopicSnapshots(request, callback) { - return this.rpcCall(listTopicSnapshots, $root.google.pubsub.v1.ListTopicSnapshotsRequest, $root.google.pubsub.v1.ListTopicSnapshotsResponse, request, callback); - }, "name", { value: "ListTopicSnapshots" }); + Binding.prototype.condition = null; /** - * Calls ListTopicSnapshots. - * @function listTopicSnapshots - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IListTopicSnapshotsRequest} request ListTopicSnapshotsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance */ + Binding.create = function create(properties) { + return new Binding(properties); + }; /** - * Callback as used by {@link google.pubsub.v1.Publisher#deleteTopic}. - * @memberof google.pubsub.v1.Publisher - * @typedef DeleteTopicCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && message.hasOwnProperty("role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && message.hasOwnProperty("condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; /** - * Calls DeleteTopic. - * @function deleteTopic - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IDeleteTopicRequest} request DeleteTopicRequest message or plain object - * @param {google.pubsub.v1.Publisher.DeleteTopicCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(Publisher.prototype.deleteTopic = function deleteTopic(request, callback) { - return this.rpcCall(deleteTopic, $root.google.pubsub.v1.DeleteTopicRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteTopic" }); + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls DeleteTopic. - * @function deleteTopic - * @memberof google.pubsub.v1.Publisher - * @instance - * @param {google.pubsub.v1.IDeleteTopicRequest} request DeleteTopicRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Publisher; - })(); - - v1.MessageStoragePolicy = (function() { - - /** - * Properties of a MessageStoragePolicy. - * @memberof google.pubsub.v1 - * @interface IMessageStoragePolicy - * @property {Array.|null} [allowedPersistenceRegions] MessageStoragePolicy allowedPersistenceRegions - */ - - /** - * Constructs a new MessageStoragePolicy. - * @memberof google.pubsub.v1 - * @classdesc Represents a MessageStoragePolicy. - * @implements IMessageStoragePolicy - * @constructor - * @param {google.pubsub.v1.IMessageStoragePolicy=} [properties] Properties to set - */ - function MessageStoragePolicy(properties) { - this.allowedPersistenceRegions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageStoragePolicy allowedPersistenceRegions. - * @member {Array.} allowedPersistenceRegions - * @memberof google.pubsub.v1.MessageStoragePolicy - * @instance - */ - MessageStoragePolicy.prototype.allowedPersistenceRegions = $util.emptyArray; - - /** - * Creates a new MessageStoragePolicy instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.MessageStoragePolicy - * @static - * @param {google.pubsub.v1.IMessageStoragePolicy=} [properties] Properties to set - * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy instance - */ - MessageStoragePolicy.create = function create(properties) { - return new MessageStoragePolicy(properties); - }; - - /** - * Encodes the specified MessageStoragePolicy message. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.MessageStoragePolicy - * @static - * @param {google.pubsub.v1.IMessageStoragePolicy} message MessageStoragePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageStoragePolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedPersistenceRegions != null && message.allowedPersistenceRegions.length) - for (var i = 0; i < message.allowedPersistenceRegions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedPersistenceRegions[i]); - return writer; - }; - - /** - * Encodes the specified MessageStoragePolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.MessageStoragePolicy - * @static - * @param {google.pubsub.v1.IMessageStoragePolicy} message MessageStoragePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageStoragePolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageStoragePolicy message from the specified reader or buffer. + * Decodes a Binding message from the specified reader or buffer. * @function decode - * @memberof google.pubsub.v1.MessageStoragePolicy + * @memberof google.iam.v1.Binding * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy + * @returns {google.iam.v1.Binding} Binding * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageStoragePolicy.decode = function decode(reader, length) { + Binding.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.MessageStoragePolicy(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.allowedPersistenceRegions && message.allowedPersistenceRegions.length)) - message.allowedPersistenceRegions = []; - message.allowedPersistenceRegions.push(reader.string()); + message.role = reader.string(); + break; + case 2: + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + case 3: + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -464,123 +456,145 @@ }; /** - * Decodes a MessageStoragePolicy message from the specified reader or buffer, length delimited. + * Decodes a Binding message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.pubsub.v1.MessageStoragePolicy + * @memberof google.iam.v1.Binding * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy + * @returns {google.iam.v1.Binding} Binding * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageStoragePolicy.decodeDelimited = function decodeDelimited(reader) { + Binding.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MessageStoragePolicy message. + * Verifies a Binding message. * @function verify - * @memberof google.pubsub.v1.MessageStoragePolicy + * @memberof google.iam.v1.Binding * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MessageStoragePolicy.verify = function verify(message) { + Binding.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.allowedPersistenceRegions != null && message.hasOwnProperty("allowedPersistenceRegions")) { - if (!Array.isArray(message.allowedPersistenceRegions)) - return "allowedPersistenceRegions: array expected"; - for (var i = 0; i < message.allowedPersistenceRegions.length; ++i) - if (!$util.isString(message.allowedPersistenceRegions[i])) - return "allowedPersistenceRegions: string[] expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; } return null; }; /** - * Creates a MessageStoragePolicy message from a plain object. Also converts values to their respective internal types. + * Creates a Binding message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.pubsub.v1.MessageStoragePolicy + * @memberof google.iam.v1.Binding * @static * @param {Object.} object Plain object - * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy + * @returns {google.iam.v1.Binding} Binding */ - MessageStoragePolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.MessageStoragePolicy) + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) return object; - var message = new $root.google.pubsub.v1.MessageStoragePolicy(); - if (object.allowedPersistenceRegions) { - if (!Array.isArray(object.allowedPersistenceRegions)) - throw TypeError(".google.pubsub.v1.MessageStoragePolicy.allowedPersistenceRegions: array expected"); - message.allowedPersistenceRegions = []; - for (var i = 0; i < object.allowedPersistenceRegions.length; ++i) - message.allowedPersistenceRegions[i] = String(object.allowedPersistenceRegions[i]); + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); } return message; }; /** - * Creates a plain object from a MessageStoragePolicy message. Also converts values to other types if specified. + * Creates a plain object from a Binding message. Also converts values to other types if specified. * @function toObject - * @memberof google.pubsub.v1.MessageStoragePolicy + * @memberof google.iam.v1.Binding * @static - * @param {google.pubsub.v1.MessageStoragePolicy} message MessageStoragePolicy + * @param {google.iam.v1.Binding} message Binding * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageStoragePolicy.toObject = function toObject(message, options) { + Binding.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.allowedPersistenceRegions = []; - if (message.allowedPersistenceRegions && message.allowedPersistenceRegions.length) { - object.allowedPersistenceRegions = []; - for (var j = 0; j < message.allowedPersistenceRegions.length; ++j) - object.allowedPersistenceRegions[j] = message.allowedPersistenceRegions[j]; + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); return object; }; /** - * Converts this MessageStoragePolicy to JSON. + * Converts this Binding to JSON. * @function toJSON - * @memberof google.pubsub.v1.MessageStoragePolicy + * @memberof google.iam.v1.Binding * @instance * @returns {Object.} JSON object */ - MessageStoragePolicy.prototype.toJSON = function toJSON() { + Binding.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return MessageStoragePolicy; + return Binding; })(); - v1.Topic = (function() { + v1.PolicyDelta = (function() { /** - * Properties of a Topic. - * @memberof google.pubsub.v1 - * @interface ITopic - * @property {string|null} [name] Topic name - * @property {Object.|null} [labels] Topic labels - * @property {google.pubsub.v1.IMessageStoragePolicy|null} [messageStoragePolicy] Topic messageStoragePolicy - * @property {string|null} [kmsKeyName] Topic kmsKeyName + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas */ /** - * Constructs a new Topic. - * @memberof google.pubsub.v1 - * @classdesc Represents a Topic. - * @implements ITopic + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta * @constructor - * @param {google.pubsub.v1.ITopic=} [properties] Properties to set + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set */ - function Topic(properties) { - this.labels = {}; + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -588,120 +602,94 @@ } /** - * Topic name. - * @member {string} name - * @memberof google.pubsub.v1.Topic + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta * @instance */ - Topic.prototype.name = ""; + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; /** - * Topic labels. - * @member {Object.} labels - * @memberof google.pubsub.v1.Topic + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta * @instance */ - Topic.prototype.labels = $util.emptyObject; + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; /** - * Topic messageStoragePolicy. - * @member {google.pubsub.v1.IMessageStoragePolicy|null|undefined} messageStoragePolicy - * @memberof google.pubsub.v1.Topic - * @instance - */ - Topic.prototype.messageStoragePolicy = null; - - /** - * Topic kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.pubsub.v1.Topic - * @instance - */ - Topic.prototype.kmsKeyName = ""; - - /** - * Creates a new Topic instance using the specified properties. + * Creates a new PolicyDelta instance using the specified properties. * @function create - * @memberof google.pubsub.v1.Topic + * @memberof google.iam.v1.PolicyDelta * @static - * @param {google.pubsub.v1.ITopic=} [properties] Properties to set - * @returns {google.pubsub.v1.Topic} Topic instance + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance */ - Topic.create = function create(properties) { - return new Topic(properties); + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); }; /** - * Encodes the specified Topic message. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. * @function encode - * @memberof google.pubsub.v1.Topic + * @memberof google.iam.v1.PolicyDelta * @static - * @param {google.pubsub.v1.ITopic} message Topic message or plain object to encode + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Topic.encode = function encode(message, writer) { + PolicyDelta.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.labels != null && message.hasOwnProperty("labels")) - for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); - if (message.messageStoragePolicy != null && message.hasOwnProperty("messageStoragePolicy")) - $root.google.pubsub.v1.MessageStoragePolicy.encode(message.messageStoragePolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.kmsKeyName); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Topic message, length delimited. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. * @function encodeDelimited - * @memberof google.pubsub.v1.Topic + * @memberof google.iam.v1.PolicyDelta * @static - * @param {google.pubsub.v1.ITopic} message Topic message or plain object to encode + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Topic.encodeDelimited = function encodeDelimited(message, writer) { + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Topic message from the specified reader or buffer. + * Decodes a PolicyDelta message from the specified reader or buffer. * @function decode - * @memberof google.pubsub.v1.Topic + * @memberof google.iam.v1.PolicyDelta * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.Topic} Topic + * @returns {google.iam.v1.PolicyDelta} PolicyDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Topic.decode = function decode(reader, length) { + PolicyDelta.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.Topic(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); break; case 2: - reader.skip().pos++; - if (message.labels === $util.emptyObject) - message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); - break; - case 3: - message.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.decode(reader, reader.uint32()); - break; - case 5: - message.kmsKeyName = reader.string(); + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -712,157 +700,153 @@ }; /** - * Decodes a Topic message from the specified reader or buffer, length delimited. + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.pubsub.v1.Topic + * @memberof google.iam.v1.PolicyDelta * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.Topic} Topic + * @returns {google.iam.v1.PolicyDelta} PolicyDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Topic.decodeDelimited = function decodeDelimited(reader) { + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Topic message. + * Verifies a PolicyDelta message. * @function verify - * @memberof google.pubsub.v1.Topic + * @memberof google.iam.v1.PolicyDelta * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Topic.verify = function verify(message) { + PolicyDelta.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.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.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } } - if (message.messageStoragePolicy != null && message.hasOwnProperty("messageStoragePolicy")) { - var error = $root.google.pubsub.v1.MessageStoragePolicy.verify(message.messageStoragePolicy); - if (error) - return "messageStoragePolicy." + error; + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; return null; }; /** - * Creates a Topic message from a plain object. Also converts values to their respective internal types. + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.pubsub.v1.Topic + * @memberof google.iam.v1.PolicyDelta * @static * @param {Object.} object Plain object - * @returns {google.pubsub.v1.Topic} Topic + * @returns {google.iam.v1.PolicyDelta} PolicyDelta */ - Topic.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.Topic) + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) return object; - var message = new $root.google.pubsub.v1.Topic(); - if (object.name != null) - message.name = String(object.name); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.pubsub.v1.Topic.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]]); + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } } - if (object.messageStoragePolicy != null) { - if (typeof object.messageStoragePolicy !== "object") - throw TypeError(".google.pubsub.v1.Topic.messageStoragePolicy: object expected"); - message.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.fromObject(object.messageStoragePolicy); + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } } - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); return message; }; /** - * Creates a plain object from a Topic message. Also converts values to other types if specified. + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. * @function toObject - * @memberof google.pubsub.v1.Topic + * @memberof google.iam.v1.PolicyDelta * @static - * @param {google.pubsub.v1.Topic} message Topic + * @param {google.iam.v1.PolicyDelta} message PolicyDelta * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Topic.toObject = function toObject(message, options) { + PolicyDelta.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.messageStoragePolicy = null; - object.kmsKeyName = ""; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - 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.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); } - if (message.messageStoragePolicy != null && message.hasOwnProperty("messageStoragePolicy")) - object.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.toObject(message.messageStoragePolicy, options); - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; return object; }; /** - * Converts this Topic to JSON. + * Converts this PolicyDelta to JSON. * @function toJSON - * @memberof google.pubsub.v1.Topic + * @memberof google.iam.v1.PolicyDelta * @instance * @returns {Object.} JSON object */ - Topic.prototype.toJSON = function toJSON() { + PolicyDelta.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Topic; + return PolicyDelta; })(); - v1.PubsubMessage = (function() { + v1.BindingDelta = (function() { /** - * Properties of a PubsubMessage. - * @memberof google.pubsub.v1 - * @interface IPubsubMessage - * @property {Uint8Array|null} [data] PubsubMessage data - * @property {Object.|null} [attributes] PubsubMessage attributes - * @property {string|null} [messageId] PubsubMessage messageId - * @property {google.protobuf.ITimestamp|null} [publishTime] PubsubMessage publishTime - * @property {string|null} [orderingKey] PubsubMessage orderingKey + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition */ /** - * Constructs a new PubsubMessage. - * @memberof google.pubsub.v1 - * @classdesc Represents a PubsubMessage. - * @implements IPubsubMessage + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta * @constructor - * @param {google.pubsub.v1.IPubsubMessage=} [properties] Properties to set + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set */ - function PubsubMessage(properties) { - this.attributes = {}; + function BindingDelta(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -870,133 +854,114 @@ } /** - * PubsubMessage data. - * @member {Uint8Array} data - * @memberof google.pubsub.v1.PubsubMessage + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta * @instance */ - PubsubMessage.prototype.data = $util.newBuffer([]); - - /** - * PubsubMessage attributes. - * @member {Object.} attributes - * @memberof google.pubsub.v1.PubsubMessage - * @instance - */ - PubsubMessage.prototype.attributes = $util.emptyObject; + BindingDelta.prototype.action = 0; /** - * PubsubMessage messageId. - * @member {string} messageId - * @memberof google.pubsub.v1.PubsubMessage + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta * @instance */ - PubsubMessage.prototype.messageId = ""; + BindingDelta.prototype.role = ""; /** - * PubsubMessage publishTime. - * @member {google.protobuf.ITimestamp|null|undefined} publishTime - * @memberof google.pubsub.v1.PubsubMessage + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta * @instance */ - PubsubMessage.prototype.publishTime = null; + BindingDelta.prototype.member = ""; /** - * PubsubMessage orderingKey. - * @member {string} orderingKey - * @memberof google.pubsub.v1.PubsubMessage + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta * @instance */ - PubsubMessage.prototype.orderingKey = ""; + BindingDelta.prototype.condition = null; /** - * Creates a new PubsubMessage instance using the specified properties. + * Creates a new BindingDelta instance using the specified properties. * @function create - * @memberof google.pubsub.v1.PubsubMessage + * @memberof google.iam.v1.BindingDelta * @static - * @param {google.pubsub.v1.IPubsubMessage=} [properties] Properties to set - * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage instance + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance */ - PubsubMessage.create = function create(properties) { - return new PubsubMessage(properties); + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); }; /** - * Encodes the specified PubsubMessage message. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. * @function encode - * @memberof google.pubsub.v1.PubsubMessage + * @memberof google.iam.v1.BindingDelta * @static - * @param {google.pubsub.v1.IPubsubMessage} message PubsubMessage message or plain object to encode + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PubsubMessage.encode = function encode(message, writer) { + BindingDelta.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.data != null && message.hasOwnProperty("data")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data); - if (message.attributes != null && message.hasOwnProperty("attributes")) - for (var keys = Object.keys(message.attributes), 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.attributes[keys[i]]).ldelim(); - if (message.messageId != null && message.hasOwnProperty("messageId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.messageId); - if (message.publishTime != null && message.hasOwnProperty("publishTime")) - $root.google.protobuf.Timestamp.encode(message.publishTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.orderingKey != null && message.hasOwnProperty("orderingKey")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderingKey); + if (message.action != null && message.hasOwnProperty("action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && message.hasOwnProperty("role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && message.hasOwnProperty("member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && message.hasOwnProperty("condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified PubsubMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. * @function encodeDelimited - * @memberof google.pubsub.v1.PubsubMessage + * @memberof google.iam.v1.BindingDelta * @static - * @param {google.pubsub.v1.IPubsubMessage} message PubsubMessage message or plain object to encode + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PubsubMessage.encodeDelimited = function encodeDelimited(message, writer) { + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PubsubMessage message from the specified reader or buffer. + * Decodes a BindingDelta message from the specified reader or buffer. * @function decode - * @memberof google.pubsub.v1.PubsubMessage + * @memberof google.iam.v1.BindingDelta * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage + * @returns {google.iam.v1.BindingDelta} BindingDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PubsubMessage.decode = function decode(reader, length) { + BindingDelta.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PubsubMessage(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.data = reader.bytes(); + message.action = reader.int32(); break; case 2: - reader.skip().pos++; - if (message.attributes === $util.emptyObject) - message.attributes = {}; - key = reader.string(); - reader.pos++; - message.attributes[key] = reader.string(); + message.role = reader.string(); break; case 3: - message.messageId = reader.string(); + message.member = reader.string(); break; case 4: - message.publishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.orderingKey = reader.string(); + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1007,169 +972,174 @@ }; /** - * Decodes a PubsubMessage message from the specified reader or buffer, length delimited. + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.pubsub.v1.PubsubMessage + * @memberof google.iam.v1.BindingDelta * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage + * @returns {google.iam.v1.BindingDelta} BindingDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PubsubMessage.decodeDelimited = function decodeDelimited(reader) { + BindingDelta.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PubsubMessage message. + * Verifies a BindingDelta message. * @function verify - * @memberof google.pubsub.v1.PubsubMessage + * @memberof google.iam.v1.BindingDelta * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PubsubMessage.verify = function verify(message) { + BindingDelta.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.attributes[key[i]])) - return "attributes: string{k:string} expected"; - } - if (message.messageId != null && message.hasOwnProperty("messageId")) - if (!$util.isString(message.messageId)) - return "messageId: string expected"; - if (message.publishTime != null && message.hasOwnProperty("publishTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.publishTime); + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); if (error) - return "publishTime." + error; + return "condition." + error; } - if (message.orderingKey != null && message.hasOwnProperty("orderingKey")) - if (!$util.isString(message.orderingKey)) - return "orderingKey: string expected"; return null; }; /** - * Creates a PubsubMessage message from a plain object. Also converts values to their respective internal types. + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.pubsub.v1.PubsubMessage + * @memberof google.iam.v1.BindingDelta * @static * @param {Object.} object Plain object - * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage + * @returns {google.iam.v1.BindingDelta} BindingDelta */ - PubsubMessage.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.PubsubMessage) + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) return object; - var message = new $root.google.pubsub.v1.PubsubMessage(); - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.pubsub.v1.PubsubMessage.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) - message.attributes[keys[i]] = String(object.attributes[keys[i]]); + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; } - if (object.messageId != null) - message.messageId = String(object.messageId); - if (object.publishTime != null) { - if (typeof object.publishTime !== "object") - throw TypeError(".google.pubsub.v1.PubsubMessage.publishTime: object expected"); - message.publishTime = $root.google.protobuf.Timestamp.fromObject(object.publishTime); + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); } - if (object.orderingKey != null) - message.orderingKey = String(object.orderingKey); return message; }; /** - * Creates a plain object from a PubsubMessage message. Also converts values to other types if specified. + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. * @function toObject - * @memberof google.pubsub.v1.PubsubMessage + * @memberof google.iam.v1.BindingDelta * @static - * @param {google.pubsub.v1.PubsubMessage} message PubsubMessage + * @param {google.iam.v1.BindingDelta} message BindingDelta * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PubsubMessage.toObject = function toObject(message, options) { + BindingDelta.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.attributes = {}; if (options.defaults) { - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - object.messageId = ""; - object.publishTime = null; - object.orderingKey = ""; - } - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = message.attributes[keys2[j]]; + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; } - if (message.messageId != null && message.hasOwnProperty("messageId")) - object.messageId = message.messageId; - if (message.publishTime != null && message.hasOwnProperty("publishTime")) - object.publishTime = $root.google.protobuf.Timestamp.toObject(message.publishTime, options); - if (message.orderingKey != null && message.hasOwnProperty("orderingKey")) - object.orderingKey = message.orderingKey; - return object; - }; - - /** - * Converts this PubsubMessage to JSON. - * @function toJSON - * @memberof google.pubsub.v1.PubsubMessage + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta * @instance * @returns {Object.} JSON object */ - PubsubMessage.prototype.toJSON = function toJSON() { + BindingDelta.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PubsubMessage; + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {string} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; })(); - v1.GetTopicRequest = (function() { + v1.AuditConfigDelta = (function() { /** - * Properties of a GetTopicRequest. - * @memberof google.pubsub.v1 - * @interface IGetTopicRequest - * @property {string|null} [topic] GetTopicRequest topic + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType */ /** - * Constructs a new GetTopicRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a GetTopicRequest. - * @implements IGetTopicRequest + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta * @constructor - * @param {google.pubsub.v1.IGetTopicRequest=} [properties] Properties to set + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set */ - function GetTopicRequest(properties) { + function AuditConfigDelta(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1177,75 +1147,114 @@ } /** - * GetTopicRequest topic. - * @member {string} topic - * @memberof google.pubsub.v1.GetTopicRequest + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta * @instance */ - GetTopicRequest.prototype.topic = ""; + AuditConfigDelta.prototype.action = 0; /** - * Creates a new GetTopicRequest instance using the specified properties. + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. * @function create - * @memberof google.pubsub.v1.GetTopicRequest + * @memberof google.iam.v1.AuditConfigDelta * @static - * @param {google.pubsub.v1.IGetTopicRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest instance + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance */ - GetTopicRequest.create = function create(properties) { - return new GetTopicRequest(properties); + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); }; /** - * Encodes the specified GetTopicRequest message. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. * @function encode - * @memberof google.pubsub.v1.GetTopicRequest + * @memberof google.iam.v1.AuditConfigDelta * @static - * @param {google.pubsub.v1.IGetTopicRequest} message GetTopicRequest message or plain object to encode + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetTopicRequest.encode = function encode(message, writer) { + AuditConfigDelta.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.topic != null && message.hasOwnProperty("topic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.action != null && message.hasOwnProperty("action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && message.hasOwnProperty("service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && message.hasOwnProperty("logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); return writer; }; /** - * Encodes the specified GetTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. * @function encodeDelimited - * @memberof google.pubsub.v1.GetTopicRequest + * @memberof google.iam.v1.AuditConfigDelta * @static - * @param {google.pubsub.v1.IGetTopicRequest} message GetTopicRequest message or plain object to encode + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetTopicRequest.encodeDelimited = function encodeDelimited(message, writer) { + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetTopicRequest message from the specified reader or buffer. + * Decodes an AuditConfigDelta message from the specified reader or buffer. * @function decode - * @memberof google.pubsub.v1.GetTopicRequest + * @memberof google.iam.v1.AuditConfigDelta * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetTopicRequest.decode = function decode(reader, length) { + AuditConfigDelta.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.GetTopicRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.topic = reader.string(); + message.action = reader.int32(); + break; + case 2: + message.service = reader.string(); + break; + case 3: + message.exemptedMember = reader.string(); + break; + case 4: + message.logType = reader.string(); break; default: reader.skipType(tag & 7); @@ -1256,108 +1265,166 @@ }; /** - * Decodes a GetTopicRequest message from the specified reader or buffer, length delimited. + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.pubsub.v1.GetTopicRequest + * @memberof google.iam.v1.AuditConfigDelta * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetTopicRequest.decodeDelimited = function decodeDelimited(reader) { + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetTopicRequest message. + * Verifies an AuditConfigDelta message. * @function verify - * @memberof google.pubsub.v1.GetTopicRequest + * @memberof google.iam.v1.AuditConfigDelta * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetTopicRequest.verify = function verify(message) { + AuditConfigDelta.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; return null; }; /** - * Creates a GetTopicRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.pubsub.v1.GetTopicRequest + * @memberof google.iam.v1.AuditConfigDelta * @static * @param {Object.} object Plain object - * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta */ - GetTopicRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.GetTopicRequest) + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) return object; - var message = new $root.google.pubsub.v1.GetTopicRequest(); - if (object.topic != null) - message.topic = String(object.topic); + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); return message; }; /** - * Creates a plain object from a GetTopicRequest message. Also converts values to other types if specified. + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. * @function toObject - * @memberof google.pubsub.v1.GetTopicRequest + * @memberof google.iam.v1.AuditConfigDelta * @static - * @param {google.pubsub.v1.GetTopicRequest} message GetTopicRequest + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetTopicRequest.toObject = function toObject(message, options) { + AuditConfigDelta.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.topic = ""; - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; return object; }; /** - * Converts this GetTopicRequest to JSON. + * Converts this AuditConfigDelta to JSON. * @function toJSON - * @memberof google.pubsub.v1.GetTopicRequest + * @memberof google.iam.v1.AuditConfigDelta * @instance * @returns {Object.} JSON object */ - GetTopicRequest.prototype.toJSON = function toJSON() { + AuditConfigDelta.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetTopicRequest; - })(); - - v1.UpdateTopicRequest = (function() { + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {string} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + v1.GetPolicyOptions = (function() { /** - * Properties of an UpdateTopicRequest. - * @memberof google.pubsub.v1 - * @interface IUpdateTopicRequest - * @property {google.pubsub.v1.ITopic|null} [topic] UpdateTopicRequest topic - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTopicRequest updateMask + * Properties of a GetPolicyOptions. + * @memberof google.iam.v1 + * @interface IGetPolicyOptions + * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion */ /** - * Constructs a new UpdateTopicRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents an UpdateTopicRequest. - * @implements IUpdateTopicRequest + * Constructs a new GetPolicyOptions. + * @memberof google.iam.v1 + * @classdesc Represents a GetPolicyOptions. + * @implements IGetPolicyOptions * @constructor - * @param {google.pubsub.v1.IUpdateTopicRequest=} [properties] Properties to set + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set */ - function UpdateTopicRequest(properties) { + function GetPolicyOptions(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1365,88 +1432,75 @@ } /** - * UpdateTopicRequest topic. - * @member {google.pubsub.v1.ITopic|null|undefined} topic - * @memberof google.pubsub.v1.UpdateTopicRequest - * @instance - */ - UpdateTopicRequest.prototype.topic = null; - - /** - * UpdateTopicRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.pubsub.v1.UpdateTopicRequest + * GetPolicyOptions requestedPolicyVersion. + * @member {number} requestedPolicyVersion + * @memberof google.iam.v1.GetPolicyOptions * @instance */ - UpdateTopicRequest.prototype.updateMask = null; + GetPolicyOptions.prototype.requestedPolicyVersion = 0; /** - * Creates a new UpdateTopicRequest instance using the specified properties. + * Creates a new GetPolicyOptions instance using the specified properties. * @function create - * @memberof google.pubsub.v1.UpdateTopicRequest + * @memberof google.iam.v1.GetPolicyOptions * @static - * @param {google.pubsub.v1.IUpdateTopicRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest instance + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance */ - UpdateTopicRequest.create = function create(properties) { - return new UpdateTopicRequest(properties); + GetPolicyOptions.create = function create(properties) { + return new GetPolicyOptions(properties); }; /** - * Encodes the specified UpdateTopicRequest message. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. * @function encode - * @memberof google.pubsub.v1.UpdateTopicRequest + * @memberof google.iam.v1.GetPolicyOptions * @static - * @param {google.pubsub.v1.IUpdateTopicRequest} message UpdateTopicRequest message or plain object to encode + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateTopicRequest.encode = function encode(message, writer) { + GetPolicyOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.topic != null && message.hasOwnProperty("topic")) - $root.google.pubsub.v1.Topic.encode(message.topic, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); return writer; }; /** - * Encodes the specified UpdateTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.pubsub.v1.UpdateTopicRequest + * @memberof google.iam.v1.GetPolicyOptions * @static - * @param {google.pubsub.v1.IUpdateTopicRequest} message UpdateTopicRequest message or plain object to encode + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateTopicRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateTopicRequest message from the specified reader or buffer. + * Decodes a GetPolicyOptions message from the specified reader or buffer. * @function decode - * @memberof google.pubsub.v1.UpdateTopicRequest + * @memberof google.iam.v1.GetPolicyOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateTopicRequest.decode = function decode(reader, length) { + GetPolicyOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.UpdateTopicRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.topic = $root.google.pubsub.v1.Topic.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.requestedPolicyVersion = reader.int32(); break; default: reader.skipType(tag & 7); @@ -1457,220 +1511,331 @@ }; /** - * Decodes an UpdateTopicRequest message from the specified reader or buffer, length delimited. + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.pubsub.v1.UpdateTopicRequest + * @memberof google.iam.v1.GetPolicyOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateTopicRequest.decodeDelimited = function decodeDelimited(reader) { + GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateTopicRequest message. + * Verifies a GetPolicyOptions message. * @function verify - * @memberof google.pubsub.v1.UpdateTopicRequest + * @memberof google.iam.v1.GetPolicyOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateTopicRequest.verify = function verify(message) { + GetPolicyOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.topic != null && message.hasOwnProperty("topic")) { - var error = $root.google.pubsub.v1.Topic.verify(message.topic); - if (error) - return "topic." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (!$util.isInteger(message.requestedPolicyVersion)) + return "requestedPolicyVersion: integer expected"; return null; }; /** - * Creates an UpdateTopicRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.pubsub.v1.UpdateTopicRequest + * @memberof google.iam.v1.GetPolicyOptions * @static * @param {Object.} object Plain object - * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions */ - UpdateTopicRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.UpdateTopicRequest) + GetPolicyOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetPolicyOptions) return object; - var message = new $root.google.pubsub.v1.UpdateTopicRequest(); - if (object.topic != null) { - if (typeof object.topic !== "object") - throw TypeError(".google.pubsub.v1.UpdateTopicRequest.topic: object expected"); - message.topic = $root.google.pubsub.v1.Topic.fromObject(object.topic); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.pubsub.v1.UpdateTopicRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.iam.v1.GetPolicyOptions(); + if (object.requestedPolicyVersion != null) + message.requestedPolicyVersion = object.requestedPolicyVersion | 0; return message; }; /** - * Creates a plain object from an UpdateTopicRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.pubsub.v1.UpdateTopicRequest + * @memberof google.iam.v1.GetPolicyOptions * @static - * @param {google.pubsub.v1.UpdateTopicRequest} message UpdateTopicRequest + * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateTopicRequest.toObject = function toObject(message, options) { + GetPolicyOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.topic = null; - object.updateMask = null; - } - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = $root.google.pubsub.v1.Topic.toObject(message.topic, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (options.defaults) + object.requestedPolicyVersion = 0; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + object.requestedPolicyVersion = message.requestedPolicyVersion; return object; }; /** - * Converts this UpdateTopicRequest to JSON. + * Converts this GetPolicyOptions to JSON. * @function toJSON - * @memberof google.pubsub.v1.UpdateTopicRequest + * @memberof google.iam.v1.GetPolicyOptions * @instance * @returns {Object.} JSON object */ - UpdateTopicRequest.prototype.toJSON = function toJSON() { + GetPolicyOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateTopicRequest; + return GetPolicyOptions; })(); - v1.PublishRequest = (function() { + v1.IAMPolicy = (function() { /** - * Properties of a PublishRequest. - * @memberof google.pubsub.v1 - * @interface IPublishRequest - * @property {string|null} [topic] PublishRequest topic - * @property {Array.|null} [messages] PublishRequest messages + * Constructs a new IAMPolicy service. + * @memberof google.iam.v1 + * @classdesc Represents a IAMPolicy + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ + function IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; /** - * Constructs a new PublishRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a PublishRequest. - * @implements IPublishRequest - * @constructor - * @param {google.pubsub.v1.IPublishRequest=} [properties] Properties to set + * Creates new IAMPolicy service using the specified rpc implementation. + * @function create + * @memberof google.iam.v1.IAMPolicy + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. */ - function PublishRequest(properties) { - this.messages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * PublishRequest topic. - * @member {string} topic - * @memberof google.pubsub.v1.PublishRequest - * @instance + * Callback as used by {@link google.iam.v1.IAMPolicy#setIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy */ - PublishRequest.prototype.topic = ""; /** - * PublishRequest messages. - * @member {Array.} messages - * @memberof google.pubsub.v1.PublishRequest + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 */ - PublishRequest.prototype.messages = $util.emptyArray; + Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); /** - * Creates a new PublishRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.PublishRequest + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy#getIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy#testIamPermissions}. + * @memberof google.iam.v1.IAMPolicy + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return IAMPolicy; + })(); + + v1.SetIamPolicyRequest = (function() { + + /** + * Properties of a SetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface ISetIamPolicyRequest + * @property {string|null} [resource] SetIamPolicyRequest resource + * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy + */ + + /** + * Constructs a new SetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a SetIamPolicyRequest. + * @implements ISetIamPolicyRequest + * @constructor + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + */ + function SetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.resource = ""; + + /** + * SetIamPolicyRequest policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.policy = null; + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.SetIamPolicyRequest * @static - * @param {google.pubsub.v1.IPublishRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.PublishRequest} PublishRequest instance + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance */ - PublishRequest.create = function create(properties) { - return new PublishRequest(properties); + SetIamPolicyRequest.create = function create(properties) { + return new SetIamPolicyRequest(properties); }; /** - * Encodes the specified PublishRequest message. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. * @function encode - * @memberof google.pubsub.v1.PublishRequest + * @memberof google.iam.v1.SetIamPolicyRequest * @static - * @param {google.pubsub.v1.IPublishRequest} message PublishRequest message or plain object to encode + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PublishRequest.encode = function encode(message, writer) { + SetIamPolicyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.topic != null && message.hasOwnProperty("topic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.google.pubsub.v1.PubsubMessage.encode(message.messages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resource != null && message.hasOwnProperty("resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.policy != null && message.hasOwnProperty("policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified PublishRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.pubsub.v1.PublishRequest + * @memberof google.iam.v1.SetIamPolicyRequest * @static - * @param {google.pubsub.v1.IPublishRequest} message PublishRequest message or plain object to encode + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PublishRequest.encodeDelimited = function encodeDelimited(message, writer) { + SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PublishRequest message from the specified reader or buffer. + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. * @function decode - * @memberof google.pubsub.v1.PublishRequest + * @memberof google.iam.v1.SetIamPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.PublishRequest} PublishRequest + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PublishRequest.decode = function decode(reader, length) { + SetIamPolicyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PublishRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.topic = reader.string(); + message.resource = reader.string(); break; case 2: - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.pubsub.v1.PubsubMessage.decode(reader, reader.uint32())); + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1681,134 +1846,122 @@ }; /** - * Decodes a PublishRequest message from the specified reader or buffer, length delimited. + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.pubsub.v1.PublishRequest + * @memberof google.iam.v1.SetIamPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.PublishRequest} PublishRequest + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PublishRequest.decodeDelimited = function decodeDelimited(reader) { + SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PublishRequest message. + * Verifies a SetIamPolicyRequest message. * @function verify - * @memberof google.pubsub.v1.PublishRequest + * @memberof google.iam.v1.SetIamPolicyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PublishRequest.verify = function verify(message) { + SetIamPolicyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: string expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.pubsub.v1.PubsubMessage.verify(message.messages[i]); - if (error) - return "messages." + error; - } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; } return null; }; /** - * Creates a PublishRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.pubsub.v1.PublishRequest + * @memberof google.iam.v1.SetIamPolicyRequest * @static * @param {Object.} object Plain object - * @returns {google.pubsub.v1.PublishRequest} PublishRequest + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest */ - PublishRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.PublishRequest) + SetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) return object; - var message = new $root.google.pubsub.v1.PublishRequest(); - if (object.topic != null) - message.topic = String(object.topic); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".google.pubsub.v1.PublishRequest.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".google.pubsub.v1.PublishRequest.messages: object expected"); - message.messages[i] = $root.google.pubsub.v1.PubsubMessage.fromObject(object.messages[i]); - } + var message = new $root.google.iam.v1.SetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); } return message; }; /** - * Creates a plain object from a PublishRequest message. Also converts values to other types if specified. + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.pubsub.v1.PublishRequest + * @memberof google.iam.v1.SetIamPolicyRequest * @static - * @param {google.pubsub.v1.PublishRequest} message PublishRequest + * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PublishRequest.toObject = function toObject(message, options) { + SetIamPolicyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.messages = []; - if (options.defaults) - object.topic = ""; - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.pubsub.v1.PubsubMessage.toObject(message.messages[j], options); + if (options.defaults) { + object.resource = ""; + object.policy = null; } - return object; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + return object; }; /** - * Converts this PublishRequest to JSON. + * Converts this SetIamPolicyRequest to JSON. * @function toJSON - * @memberof google.pubsub.v1.PublishRequest + * @memberof google.iam.v1.SetIamPolicyRequest * @instance * @returns {Object.} JSON object */ - PublishRequest.prototype.toJSON = function toJSON() { + SetIamPolicyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PublishRequest; + return SetIamPolicyRequest; })(); - v1.PublishResponse = (function() { + v1.GetIamPolicyRequest = (function() { /** - * Properties of a PublishResponse. - * @memberof google.pubsub.v1 - * @interface IPublishResponse - * @property {Array.|null} [messageIds] PublishResponse messageIds + * Properties of a GetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface IGetIamPolicyRequest + * @property {string|null} [resource] GetIamPolicyRequest resource + * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options */ /** - * Constructs a new PublishResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a PublishResponse. - * @implements IPublishResponse + * Constructs a new GetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a GetIamPolicyRequest. + * @implements IGetIamPolicyRequest * @constructor - * @param {google.pubsub.v1.IPublishResponse=} [properties] Properties to set + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set */ - function PublishResponse(properties) { - this.messageIds = []; + function GetIamPolicyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1816,78 +1969,88 @@ } /** - * PublishResponse messageIds. - * @member {Array.} messageIds - * @memberof google.pubsub.v1.PublishResponse + * GetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.GetIamPolicyRequest * @instance */ - PublishResponse.prototype.messageIds = $util.emptyArray; + GetIamPolicyRequest.prototype.resource = ""; /** - * Creates a new PublishResponse instance using the specified properties. + * GetIamPolicyRequest options. + * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.options = null; + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. * @function create - * @memberof google.pubsub.v1.PublishResponse + * @memberof google.iam.v1.GetIamPolicyRequest * @static - * @param {google.pubsub.v1.IPublishResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.PublishResponse} PublishResponse instance + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance */ - PublishResponse.create = function create(properties) { - return new PublishResponse(properties); + GetIamPolicyRequest.create = function create(properties) { + return new GetIamPolicyRequest(properties); }; /** - * Encodes the specified PublishResponse message. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. * @function encode - * @memberof google.pubsub.v1.PublishResponse + * @memberof google.iam.v1.GetIamPolicyRequest * @static - * @param {google.pubsub.v1.IPublishResponse} message PublishResponse message or plain object to encode + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PublishResponse.encode = function encode(message, writer) { + GetIamPolicyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messageIds != null && message.messageIds.length) - for (var i = 0; i < message.messageIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.messageIds[i]); + if (message.resource != null && message.hasOwnProperty("resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified PublishResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.pubsub.v1.PublishResponse + * @memberof google.iam.v1.GetIamPolicyRequest * @static - * @param {google.pubsub.v1.IPublishResponse} message PublishResponse message or plain object to encode + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PublishResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PublishResponse message from the specified reader or buffer. + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. * @function decode - * @memberof google.pubsub.v1.PublishResponse + * @memberof google.iam.v1.GetIamPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.PublishResponse} PublishResponse + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PublishResponse.decode = function decode(reader, length) { + GetIamPolicyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PublishResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.messageIds && message.messageIds.length)) - message.messageIds = []; - message.messageIds.push(reader.string()); + message.resource = reader.string(); + break; + case 2: + message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1898,121 +2061,123 @@ }; /** - * Decodes a PublishResponse message from the specified reader or buffer, length delimited. + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.pubsub.v1.PublishResponse + * @memberof google.iam.v1.GetIamPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.PublishResponse} PublishResponse + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PublishResponse.decodeDelimited = function decodeDelimited(reader) { + GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PublishResponse message. + * Verifies a GetIamPolicyRequest message. * @function verify - * @memberof google.pubsub.v1.PublishResponse + * @memberof google.iam.v1.GetIamPolicyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PublishResponse.verify = function verify(message) { + GetIamPolicyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.messageIds != null && message.hasOwnProperty("messageIds")) { - if (!Array.isArray(message.messageIds)) - return "messageIds: array expected"; - for (var i = 0; i < message.messageIds.length; ++i) - if (!$util.isString(message.messageIds[i])) - return "messageIds: string[] expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); + if (error) + return "options." + error; } return null; }; /** - * Creates a PublishResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.pubsub.v1.PublishResponse + * @memberof google.iam.v1.GetIamPolicyRequest * @static * @param {Object.} object Plain object - * @returns {google.pubsub.v1.PublishResponse} PublishResponse + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest */ - PublishResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.PublishResponse) + GetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) return object; - var message = new $root.google.pubsub.v1.PublishResponse(); - if (object.messageIds) { - if (!Array.isArray(object.messageIds)) - throw TypeError(".google.pubsub.v1.PublishResponse.messageIds: array expected"); - message.messageIds = []; - for (var i = 0; i < object.messageIds.length; ++i) - message.messageIds[i] = String(object.messageIds[i]); + var message = new $root.google.iam.v1.GetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); + message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); } return message; }; /** - * Creates a plain object from a PublishResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.pubsub.v1.PublishResponse + * @memberof google.iam.v1.GetIamPolicyRequest * @static - * @param {google.pubsub.v1.PublishResponse} message PublishResponse + * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PublishResponse.toObject = function toObject(message, options) { + GetIamPolicyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.messageIds = []; - if (message.messageIds && message.messageIds.length) { - object.messageIds = []; - for (var j = 0; j < message.messageIds.length; ++j) - object.messageIds[j] = message.messageIds[j]; + if (options.defaults) { + object.resource = ""; + object.options = null; } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); return object; }; /** - * Converts this PublishResponse to JSON. + * Converts this GetIamPolicyRequest to JSON. * @function toJSON - * @memberof google.pubsub.v1.PublishResponse + * @memberof google.iam.v1.GetIamPolicyRequest * @instance * @returns {Object.} JSON object */ - PublishResponse.prototype.toJSON = function toJSON() { + GetIamPolicyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PublishResponse; + return GetIamPolicyRequest; })(); - v1.ListTopicsRequest = (function() { + v1.TestIamPermissionsRequest = (function() { /** - * Properties of a ListTopicsRequest. - * @memberof google.pubsub.v1 - * @interface IListTopicsRequest - * @property {string|null} [project] ListTopicsRequest project - * @property {number|null} [pageSize] ListTopicsRequest pageSize - * @property {string|null} [pageToken] ListTopicsRequest pageToken + * Properties of a TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsRequest + * @property {string|null} [resource] TestIamPermissionsRequest resource + * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions */ /** - * Constructs a new ListTopicsRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListTopicsRequest. - * @implements IListTopicsRequest + * Constructs a new TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsRequest. + * @implements ITestIamPermissionsRequest * @constructor - * @param {google.pubsub.v1.IListTopicsRequest=} [properties] Properties to set + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set */ - function ListTopicsRequest(properties) { + function TestIamPermissionsRequest(properties) { + this.permissions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2020,101 +2185,91 @@ } /** - * ListTopicsRequest project. - * @member {string} project - * @memberof google.pubsub.v1.ListTopicsRequest - * @instance - */ - ListTopicsRequest.prototype.project = ""; - - /** - * ListTopicsRequest pageSize. - * @member {number} pageSize - * @memberof google.pubsub.v1.ListTopicsRequest + * TestIamPermissionsRequest resource. + * @member {string} resource + * @memberof google.iam.v1.TestIamPermissionsRequest * @instance */ - ListTopicsRequest.prototype.pageSize = 0; + TestIamPermissionsRequest.prototype.resource = ""; /** - * ListTopicsRequest pageToken. - * @member {string} pageToken - * @memberof google.pubsub.v1.ListTopicsRequest + * TestIamPermissionsRequest permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsRequest * @instance */ - ListTopicsRequest.prototype.pageToken = ""; + TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; /** - * Creates a new ListTopicsRequest instance using the specified properties. + * Creates a new TestIamPermissionsRequest instance using the specified properties. * @function create - * @memberof google.pubsub.v1.ListTopicsRequest + * @memberof google.iam.v1.TestIamPermissionsRequest * @static - * @param {google.pubsub.v1.IListTopicsRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest instance + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance */ - ListTopicsRequest.create = function create(properties) { - return new ListTopicsRequest(properties); + TestIamPermissionsRequest.create = function create(properties) { + return new TestIamPermissionsRequest(properties); }; /** - * Encodes the specified ListTopicsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. * @function encode - * @memberof google.pubsub.v1.ListTopicsRequest + * @memberof google.iam.v1.TestIamPermissionsRequest * @static - * @param {google.pubsub.v1.IListTopicsRequest} message ListTopicsRequest message or plain object to encode + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTopicsRequest.encode = function encode(message, writer) { + TestIamPermissionsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.project != null && message.hasOwnProperty("project")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.resource != null && message.hasOwnProperty("resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); return writer; }; /** - * Encodes the specified ListTopicsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.pubsub.v1.ListTopicsRequest + * @memberof google.iam.v1.TestIamPermissionsRequest * @static - * @param {google.pubsub.v1.IListTopicsRequest} message ListTopicsRequest message or plain object to encode + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTopicsRequest.encodeDelimited = function encodeDelimited(message, writer) { + TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListTopicsRequest message from the specified reader or buffer. + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. * @function decode - * @memberof google.pubsub.v1.ListTopicsRequest + * @memberof google.iam.v1.TestIamPermissionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTopicsRequest.decode = function decode(reader, length) { + TestIamPermissionsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.project = reader.string(); + message.resource = reader.string(); break; case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2125,126 +2280,129 @@ }; /** - * Decodes a ListTopicsRequest message from the specified reader or buffer, length delimited. + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.pubsub.v1.ListTopicsRequest + * @memberof google.iam.v1.TestIamPermissionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTopicsRequest.decodeDelimited = function decodeDelimited(reader) { + TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListTopicsRequest message. + * Verifies a TestIamPermissionsRequest message. * @function verify - * @memberof google.pubsub.v1.ListTopicsRequest + * @memberof google.iam.v1.TestIamPermissionsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListTopicsRequest.verify = function verify(message) { + TestIamPermissionsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: 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.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } return null; }; /** - * Creates a ListTopicsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.pubsub.v1.ListTopicsRequest + * @memberof google.iam.v1.TestIamPermissionsRequest * @static * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest */ - ListTopicsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListTopicsRequest) + TestIamPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) return object; - var message = new $root.google.pubsub.v1.ListTopicsRequest(); - if (object.project != null) - message.project = String(object.project); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + var message = new $root.google.iam.v1.TestIamPermissionsRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } return message; }; /** - * Creates a plain object from a ListTopicsRequest message. Also converts values to other types if specified. + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.pubsub.v1.ListTopicsRequest + * @memberof google.iam.v1.TestIamPermissionsRequest * @static - * @param {google.pubsub.v1.ListTopicsRequest} message ListTopicsRequest + * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListTopicsRequest.toObject = function toObject(message, options) { + TestIamPermissionsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.project = ""; - object.pageSize = 0; - object.pageToken = ""; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) + object.resource = ""; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; } - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; return object; }; /** - * Converts this ListTopicsRequest to JSON. + * Converts this TestIamPermissionsRequest to JSON. * @function toJSON - * @memberof google.pubsub.v1.ListTopicsRequest + * @memberof google.iam.v1.TestIamPermissionsRequest * @instance * @returns {Object.} JSON object */ - ListTopicsRequest.prototype.toJSON = function toJSON() { + TestIamPermissionsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListTopicsRequest; + return TestIamPermissionsRequest; })(); - v1.ListTopicsResponse = (function() { + v1.TestIamPermissionsResponse = (function() { /** - * Properties of a ListTopicsResponse. - * @memberof google.pubsub.v1 - * @interface IListTopicsResponse - * @property {Array.|null} [topics] ListTopicsResponse topics - * @property {string|null} [nextPageToken] ListTopicsResponse nextPageToken + * Properties of a TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsResponse + * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions */ /** - * Constructs a new ListTopicsResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListTopicsResponse. - * @implements IListTopicsResponse + * Constructs a new TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsResponse. + * @implements ITestIamPermissionsResponse * @constructor - * @param {google.pubsub.v1.IListTopicsResponse=} [properties] Properties to set + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set */ - function ListTopicsResponse(properties) { - this.topics = []; + function TestIamPermissionsResponse(properties) { + this.permissions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2252,91 +2410,78 @@ } /** - * ListTopicsResponse topics. - * @member {Array.} topics - * @memberof google.pubsub.v1.ListTopicsResponse - * @instance - */ - ListTopicsResponse.prototype.topics = $util.emptyArray; - - /** - * ListTopicsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.pubsub.v1.ListTopicsResponse + * TestIamPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsResponse * @instance */ - ListTopicsResponse.prototype.nextPageToken = ""; + TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; /** - * Creates a new ListTopicsResponse instance using the specified properties. + * Creates a new TestIamPermissionsResponse instance using the specified properties. * @function create - * @memberof google.pubsub.v1.ListTopicsResponse + * @memberof google.iam.v1.TestIamPermissionsResponse * @static - * @param {google.pubsub.v1.IListTopicsResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse instance + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance */ - ListTopicsResponse.create = function create(properties) { - return new ListTopicsResponse(properties); + TestIamPermissionsResponse.create = function create(properties) { + return new TestIamPermissionsResponse(properties); }; /** - * Encodes the specified ListTopicsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. * @function encode - * @memberof google.pubsub.v1.ListTopicsResponse + * @memberof google.iam.v1.TestIamPermissionsResponse * @static - * @param {google.pubsub.v1.IListTopicsResponse} message ListTopicsResponse message or plain object to encode + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTopicsResponse.encode = function encode(message, writer) { + TestIamPermissionsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.topics != null && message.topics.length) - for (var i = 0; i < message.topics.length; ++i) - $root.google.pubsub.v1.Topic.encode(message.topics[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); return writer; }; /** - * Encodes the specified ListTopicsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.pubsub.v1.ListTopicsResponse + * @memberof google.iam.v1.TestIamPermissionsResponse * @static - * @param {google.pubsub.v1.IListTopicsResponse} message ListTopicsResponse message or plain object to encode + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTopicsResponse.encodeDelimited = function encodeDelimited(message, writer) { + TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListTopicsResponse message from the specified reader or buffer. + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. * @function decode - * @memberof google.pubsub.v1.ListTopicsResponse + * @memberof google.iam.v1.TestIamPermissionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTopicsResponse.decode = function decode(reader, length) { + TestIamPermissionsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.topics && message.topics.length)) - message.topics = []; - message.topics.push($root.google.pubsub.v1.Topic.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -2347,3763 +2492,3244 @@ }; /** - * Decodes a ListTopicsResponse message from the specified reader or buffer, length delimited. + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.pubsub.v1.ListTopicsResponse + * @memberof google.iam.v1.TestIamPermissionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTopicsResponse.decodeDelimited = function decodeDelimited(reader) { + TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListTopicsResponse message. + * Verifies a TestIamPermissionsResponse message. * @function verify - * @memberof google.pubsub.v1.ListTopicsResponse + * @memberof google.iam.v1.TestIamPermissionsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListTopicsResponse.verify = function verify(message) { + TestIamPermissionsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.topics != null && message.hasOwnProperty("topics")) { - if (!Array.isArray(message.topics)) - return "topics: array expected"; - for (var i = 0; i < message.topics.length; ++i) { - var error = $root.google.pubsub.v1.Topic.verify(message.topics[i]); - if (error) - return "topics." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; }; /** - * Creates a ListTopicsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.pubsub.v1.ListTopicsResponse + * @memberof google.iam.v1.TestIamPermissionsResponse * @static * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse */ - ListTopicsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListTopicsResponse) + TestIamPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) return object; - var message = new $root.google.pubsub.v1.ListTopicsResponse(); - if (object.topics) { - if (!Array.isArray(object.topics)) - throw TypeError(".google.pubsub.v1.ListTopicsResponse.topics: array expected"); - message.topics = []; - for (var i = 0; i < object.topics.length; ++i) { - if (typeof object.topics[i] !== "object") - throw TypeError(".google.pubsub.v1.ListTopicsResponse.topics: object expected"); - message.topics[i] = $root.google.pubsub.v1.Topic.fromObject(object.topics[i]); - } + var message = new $root.google.iam.v1.TestIamPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListTopicsResponse message. Also converts values to other types if specified. + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.pubsub.v1.ListTopicsResponse + * @memberof google.iam.v1.TestIamPermissionsResponse * @static - * @param {google.pubsub.v1.ListTopicsResponse} message ListTopicsResponse + * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListTopicsResponse.toObject = function toObject(message, options) { + TestIamPermissionsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.topics = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.topics && message.topics.length) { - object.topics = []; - for (var j = 0; j < message.topics.length; ++j) - object.topics[j] = $root.google.pubsub.v1.Topic.toObject(message.topics[j], options); + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ListTopicsResponse to JSON. + * Converts this TestIamPermissionsResponse to JSON. * @function toJSON - * @memberof google.pubsub.v1.ListTopicsResponse + * @memberof google.iam.v1.TestIamPermissionsResponse * @instance * @returns {Object.} JSON object */ - ListTopicsResponse.prototype.toJSON = function toJSON() { + TestIamPermissionsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListTopicsResponse; + return TestIamPermissionsResponse; })(); - v1.ListTopicSubscriptionsRequest = (function() { + return v1; + })(); - /** - * Properties of a ListTopicSubscriptionsRequest. - * @memberof google.pubsub.v1 - * @interface IListTopicSubscriptionsRequest - * @property {string|null} [topic] ListTopicSubscriptionsRequest topic - * @property {number|null} [pageSize] ListTopicSubscriptionsRequest pageSize - * @property {string|null} [pageToken] ListTopicSubscriptionsRequest pageToken - */ + return iam; + })(); - /** - * Constructs a new ListTopicSubscriptionsRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListTopicSubscriptionsRequest. - * @implements IListTopicSubscriptionsRequest - * @constructor - * @param {google.pubsub.v1.IListTopicSubscriptionsRequest=} [properties] Properties to set - */ - function ListTopicSubscriptionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + google.type = (function() { - /** - * ListTopicSubscriptionsRequest topic. - * @member {string} topic - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @instance - */ - ListTopicSubscriptionsRequest.prototype.topic = ""; + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; - /** - * ListTopicSubscriptionsRequest pageSize. - * @member {number} pageSize - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @instance - */ - ListTopicSubscriptionsRequest.prototype.pageSize = 0; + type.Expr = (function() { - /** - * ListTopicSubscriptionsRequest pageToken. - * @member {string} pageToken - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @instance - */ - ListTopicSubscriptionsRequest.prototype.pageToken = ""; + /** + * 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 + */ - /** - * Creates a new ListTopicSubscriptionsRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @static - * @param {google.pubsub.v1.IListTopicSubscriptionsRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest instance - */ - ListTopicSubscriptionsRequest.create = function create(properties) { - return new ListTopicSubscriptionsRequest(properties); - }; + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified ListTopicSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @static - * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicSubscriptionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.topic != null && message.hasOwnProperty("topic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; - /** - * Encodes the specified ListTopicSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @static - * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicSubscriptionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; - /** - * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicSubscriptionsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicSubscriptionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.topic = 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; - }; + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; - /** - * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicSubscriptionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTopicSubscriptionsRequest message. - * @function verify - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTopicSubscriptionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: 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 ListTopicSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest - */ - ListTopicSubscriptionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListTopicSubscriptionsRequest) - return object; - var message = new $root.google.pubsub.v1.ListTopicSubscriptionsRequest(); - if (object.topic != null) - message.topic = String(object.topic); - 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 ListTopicSubscriptionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @static - * @param {google.pubsub.v1.ListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTopicSubscriptionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.topic = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListTopicSubscriptionsRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListTopicSubscriptionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; - return ListTopicSubscriptionsRequest; - })(); + /** + * 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); + }; - v1.ListTopicSubscriptionsResponse = (function() { + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && message.hasOwnProperty("expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && message.hasOwnProperty("title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && message.hasOwnProperty("location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; - /** - * Properties of a ListTopicSubscriptionsResponse. - * @memberof google.pubsub.v1 - * @interface IListTopicSubscriptionsResponse - * @property {Array.|null} [subscriptions] ListTopicSubscriptionsResponse subscriptions - * @property {string|null} [nextPageToken] ListTopicSubscriptionsResponse nextPageToken - */ + /** + * 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(); + }; - /** - * Constructs a new ListTopicSubscriptionsResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListTopicSubscriptionsResponse. - * @implements IListTopicSubscriptionsResponse - * @constructor - * @param {google.pubsub.v1.IListTopicSubscriptionsResponse=} [properties] Properties to set - */ - function ListTopicSubscriptionsResponse(properties) { - this.subscriptions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expression = reader.string(); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.location = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } + return message; + }; - /** - * ListTopicSubscriptionsResponse subscriptions. - * @member {Array.} subscriptions - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @instance - */ - ListTopicSubscriptionsResponse.prototype.subscriptions = $util.emptyArray; + /** + * 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()); + }; - /** - * ListTopicSubscriptionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @instance - */ - ListTopicSubscriptionsResponse.prototype.nextPageToken = ""; + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; - /** - * Creates a new ListTopicSubscriptionsResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @static - * @param {google.pubsub.v1.IListTopicSubscriptionsResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse instance - */ - ListTopicSubscriptionsResponse.create = function create(properties) { - return new ListTopicSubscriptionsResponse(properties); - }; - - /** - * Encodes the specified ListTopicSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @static - * @param {google.pubsub.v1.IListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicSubscriptionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscriptions != null && message.subscriptions.length) - for (var i = 0; i < message.subscriptions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscriptions[i]); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListTopicSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @static - * @param {google.pubsub.v1.IListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicSubscriptionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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; + }; - /** - * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicSubscriptionsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicSubscriptionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.subscriptions && message.subscriptions.length)) - message.subscriptions = []; - message.subscriptions.push(reader.string()); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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; + }; - /** - * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicSubscriptionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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); + }; - /** - * Verifies a ListTopicSubscriptionsResponse message. - * @function verify - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTopicSubscriptionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscriptions != null && message.hasOwnProperty("subscriptions")) { - if (!Array.isArray(message.subscriptions)) - return "subscriptions: array expected"; - for (var i = 0; i < message.subscriptions.length; ++i) - if (!$util.isString(message.subscriptions[i])) - return "subscriptions: string[] expected"; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; + return Expr; + })(); - /** - * Creates a ListTopicSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse - */ - ListTopicSubscriptionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListTopicSubscriptionsResponse) - return object; - var message = new $root.google.pubsub.v1.ListTopicSubscriptionsResponse(); - if (object.subscriptions) { - if (!Array.isArray(object.subscriptions)) - throw TypeError(".google.pubsub.v1.ListTopicSubscriptionsResponse.subscriptions: array expected"); - message.subscriptions = []; - for (var i = 0; i < object.subscriptions.length; ++i) - message.subscriptions[i] = String(object.subscriptions[i]); - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; + return type; + })(); - /** - * Creates a plain object from a ListTopicSubscriptionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @static - * @param {google.pubsub.v1.ListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTopicSubscriptionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.subscriptions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.subscriptions && message.subscriptions.length) { - object.subscriptions = []; - for (var j = 0; j < message.subscriptions.length; ++j) - object.subscriptions[j] = message.subscriptions[j]; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; + google.api = (function() { - /** - * Converts this ListTopicSubscriptionsResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListTopicSubscriptionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; - return ListTopicSubscriptionsResponse; - })(); + api.Http = (function() { - v1.ListTopicSnapshotsRequest = (function() { + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ - /** - * Properties of a ListTopicSnapshotsRequest. - * @memberof google.pubsub.v1 - * @interface IListTopicSnapshotsRequest - * @property {string|null} [topic] ListTopicSnapshotsRequest topic - * @property {number|null} [pageSize] ListTopicSnapshotsRequest pageSize - * @property {string|null} [pageToken] ListTopicSnapshotsRequest pageToken - */ - - /** - * Constructs a new ListTopicSnapshotsRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListTopicSnapshotsRequest. - * @implements IListTopicSnapshotsRequest - * @constructor - * @param {google.pubsub.v1.IListTopicSnapshotsRequest=} [properties] Properties to set - */ - function ListTopicSnapshotsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListTopicSnapshotsRequest topic. - * @member {string} topic - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @instance - */ - ListTopicSnapshotsRequest.prototype.topic = ""; + /** + * 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]]; + } - /** - * ListTopicSnapshotsRequest pageSize. - * @member {number} pageSize - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @instance - */ - ListTopicSnapshotsRequest.prototype.pageSize = 0; + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; - /** - * ListTopicSnapshotsRequest pageToken. - * @member {string} pageToken - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @instance - */ - ListTopicSnapshotsRequest.prototype.pageToken = ""; + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; - /** - * Creates a new ListTopicSnapshotsRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @static - * @param {google.pubsub.v1.IListTopicSnapshotsRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest instance - */ - ListTopicSnapshotsRequest.create = function create(properties) { - return new ListTopicSnapshotsRequest(properties); - }; + /** + * 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 ListTopicSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @static - * @param {google.pubsub.v1.IListTopicSnapshotsRequest} message ListTopicSnapshotsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicSnapshotsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.topic != null && message.hasOwnProperty("topic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; - /** - * Encodes the specified ListTopicSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @static - * @param {google.pubsub.v1.IListTopicSnapshotsRequest} message ListTopicSnapshotsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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 ListTopicSnapshotsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicSnapshotsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicSnapshotsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.topic = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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 ListTopicSnapshotsRequest message. - * @function verify - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTopicSnapshotsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: 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 ListTopicSnapshotsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest - */ - ListTopicSnapshotsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListTopicSnapshotsRequest) - return object; - var message = new $root.google.pubsub.v1.ListTopicSnapshotsRequest(); - if (object.topic != null) - message.topic = String(object.topic); - 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 ListTopicSnapshotsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @static - * @param {google.pubsub.v1.ListTopicSnapshotsRequest} message ListTopicSnapshotsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTopicSnapshotsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.topic = ""; - object.pageSize = 0; - object.pageToken = ""; + /** + * 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.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; + } + 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; + }; - /** - * Converts this ListTopicSnapshotsRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListTopicSnapshotsRequest - * @instance - * @returns {Object.} JSON object - */ - ListTopicSnapshotsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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; + }; - return ListTopicSnapshotsRequest; - })(); + /** + * 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); + }; - v1.ListTopicSnapshotsResponse = (function() { + return Http; + })(); - /** - * Properties of a ListTopicSnapshotsResponse. - * @memberof google.pubsub.v1 - * @interface IListTopicSnapshotsResponse - * @property {Array.|null} [snapshots] ListTopicSnapshotsResponse snapshots - * @property {string|null} [nextPageToken] ListTopicSnapshotsResponse nextPageToken - */ + api.HttpRule = (function() { - /** - * Constructs a new ListTopicSnapshotsResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListTopicSnapshotsResponse. - * @implements IListTopicSnapshotsResponse - * @constructor - * @param {google.pubsub.v1.IListTopicSnapshotsResponse=} [properties] Properties to set - */ - function ListTopicSnapshotsResponse(properties) { - this.snapshots = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a 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 + */ - /** - * ListTopicSnapshotsResponse snapshots. - * @member {Array.} snapshots - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @instance - */ - ListTopicSnapshotsResponse.prototype.snapshots = $util.emptyArray; + /** + * 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]]; + } - /** - * ListTopicSnapshotsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @instance - */ - ListTopicSnapshotsResponse.prototype.nextPageToken = ""; + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; - /** - * Creates a new ListTopicSnapshotsResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @static - * @param {google.pubsub.v1.IListTopicSnapshotsResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse instance - */ - ListTopicSnapshotsResponse.create = function create(properties) { - return new ListTopicSnapshotsResponse(properties); - }; + /** + * HttpRule get. + * @member {string} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = ""; - /** - * Encodes the specified ListTopicSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @static - * @param {google.pubsub.v1.IListTopicSnapshotsResponse} message ListTopicSnapshotsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicSnapshotsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.snapshots != null && message.snapshots.length) - for (var i = 0; i < message.snapshots.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshots[i]); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; + /** + * HttpRule put. + * @member {string} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = ""; - /** - * Encodes the specified ListTopicSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @static - * @param {google.pubsub.v1.IListTopicSnapshotsResponse} message ListTopicSnapshotsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTopicSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * HttpRule post. + * @member {string} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = ""; - /** - * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicSnapshotsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicSnapshotsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.snapshots && message.snapshots.length)) - message.snapshots = []; - message.snapshots.push(reader.string()); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * HttpRule delete. + * @member {string} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = ""; - /** - * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTopicSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * HttpRule patch. + * @member {string} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = ""; - /** - * Verifies a ListTopicSnapshotsResponse message. - * @function verify - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTopicSnapshotsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.snapshots != null && message.hasOwnProperty("snapshots")) { - if (!Array.isArray(message.snapshots)) - return "snapshots: array expected"; - for (var i = 0; i < message.snapshots.length; ++i) - if (!$util.isString(message.snapshots[i])) - return "snapshots: string[] expected"; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; - /** - * Creates a ListTopicSnapshotsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse - */ - ListTopicSnapshotsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListTopicSnapshotsResponse) - return object; - var message = new $root.google.pubsub.v1.ListTopicSnapshotsResponse(); - if (object.snapshots) { - if (!Array.isArray(object.snapshots)) - throw TypeError(".google.pubsub.v1.ListTopicSnapshotsResponse.snapshots: array expected"); - message.snapshots = []; - for (var i = 0; i < object.snapshots.length; ++i) - message.snapshots[i] = String(object.snapshots[i]); - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; - /** - * Creates a plain object from a ListTopicSnapshotsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @static - * @param {google.pubsub.v1.ListTopicSnapshotsResponse} message ListTopicSnapshotsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTopicSnapshotsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.snapshots = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.snapshots && message.snapshots.length) { - object.snapshots = []; - for (var j = 0; j < message.snapshots.length; ++j) - object.snapshots[j] = message.snapshots[j]; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; - /** - * Converts this ListTopicSnapshotsResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListTopicSnapshotsResponse - * @instance - * @returns {Object.} JSON object - */ - ListTopicSnapshotsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; - return ListTopicSnapshotsResponse; - })(); + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - v1.DeleteTopicRequest = (function() { + /** + * 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) + }); - /** - * Properties of a DeleteTopicRequest. - * @memberof google.pubsub.v1 - * @interface IDeleteTopicRequest - * @property {string|null} [topic] DeleteTopicRequest topic - */ + /** + * 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); + }; - /** - * Constructs a new DeleteTopicRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a DeleteTopicRequest. - * @implements IDeleteTopicRequest - * @constructor - * @param {google.pubsub.v1.IDeleteTopicRequest=} [properties] Properties to set - */ - function DeleteTopicRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteTopicRequest topic. - * @member {string} topic - * @memberof google.pubsub.v1.DeleteTopicRequest - * @instance - */ - DeleteTopicRequest.prototype.topic = ""; - - /** - * Creates a new DeleteTopicRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.DeleteTopicRequest - * @static - * @param {google.pubsub.v1.IDeleteTopicRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest instance - */ - DeleteTopicRequest.create = function create(properties) { - return new DeleteTopicRequest(properties); - }; - - /** - * Encodes the specified DeleteTopicRequest message. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.DeleteTopicRequest - * @static - * @param {google.pubsub.v1.IDeleteTopicRequest} message DeleteTopicRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteTopicRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.topic != null && message.hasOwnProperty("topic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); - return writer; - }; + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && message.hasOwnProperty("selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && message.hasOwnProperty("get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && message.hasOwnProperty("put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && message.hasOwnProperty("post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && message.hasOwnProperty("delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && message.hasOwnProperty("patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && message.hasOwnProperty("custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; - /** - * Encodes the specified DeleteTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.DeleteTopicRequest - * @static - * @param {google.pubsub.v1.IDeleteTopicRequest} message DeleteTopicRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteTopicRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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 DeleteTopicRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.DeleteTopicRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteTopicRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeleteTopicRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.topic = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message["delete"] = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a DeleteTopicRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.DeleteTopicRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteTopicRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteTopicRequest message. - * @function verify - * @memberof google.pubsub.v1.DeleteTopicRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteTopicRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: string expected"; - return null; - }; + } + return message; + }; - /** - * Creates a DeleteTopicRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.DeleteTopicRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest - */ - DeleteTopicRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.DeleteTopicRequest) - return object; - var message = new $root.google.pubsub.v1.DeleteTopicRequest(); - if (object.topic != null) - message.topic = String(object.topic); - 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()); + }; - /** - * Creates a plain object from a DeleteTopicRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.DeleteTopicRequest - * @static - * @param {google.pubsub.v1.DeleteTopicRequest} message DeleteTopicRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteTopicRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.topic = ""; - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; - return object; - }; - - /** - * Converts this DeleteTopicRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.DeleteTopicRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteTopicRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DeleteTopicRequest; - })(); + /** + * 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; + }; - v1.Subscriber = (function() { + /** + * 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; + }; - /** - * Constructs a new Subscriber service. - * @memberof google.pubsub.v1 - * @classdesc Represents a Subscriber - * @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 Subscriber(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + /** + * 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; + }; - (Subscriber.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Subscriber; + /** + * 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); + }; - /** - * Creates new Subscriber service using the specified rpc implementation. - * @function create - * @memberof google.pubsub.v1.Subscriber - * @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 {Subscriber} RPC service. Useful where requests and/or responses are streamed. - */ - Subscriber.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + return HttpRule; + })(); - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#createSubscription}. - * @memberof google.pubsub.v1.Subscriber - * @typedef CreateSubscriptionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Subscription} [response] Subscription - */ + api.CustomHttpPattern = (function() { - /** - * Calls CreateSubscription. - * @function createSubscription - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.ISubscription} request Subscription message or plain object - * @param {google.pubsub.v1.Subscriber.CreateSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.createSubscription = function createSubscription(request, callback) { - return this.rpcCall(createSubscription, $root.google.pubsub.v1.Subscription, $root.google.pubsub.v1.Subscription, request, callback); - }, "name", { value: "CreateSubscription" }); - - /** - * Calls CreateSubscription. - * @function createSubscription - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.ISubscription} request Subscription message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#getSubscription}. - * @memberof google.pubsub.v1.Subscriber - * @typedef GetSubscriptionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Subscription} [response] Subscription - */ + /** + * 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]]; + } - /** - * Calls GetSubscription. - * @function getSubscription - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IGetSubscriptionRequest} request GetSubscriptionRequest message or plain object - * @param {google.pubsub.v1.Subscriber.GetSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.getSubscription = function getSubscription(request, callback) { - return this.rpcCall(getSubscription, $root.google.pubsub.v1.GetSubscriptionRequest, $root.google.pubsub.v1.Subscription, request, callback); - }, "name", { value: "GetSubscription" }); + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; - /** - * Calls GetSubscription. - * @function getSubscription - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IGetSubscriptionRequest} request GetSubscriptionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#updateSubscription}. - * @memberof google.pubsub.v1.Subscriber - * @typedef UpdateSubscriptionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Subscription} [response] Subscription - */ + /** + * 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); + }; - /** - * Calls UpdateSubscription. - * @function updateSubscription - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IUpdateSubscriptionRequest} request UpdateSubscriptionRequest message or plain object - * @param {google.pubsub.v1.Subscriber.UpdateSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.updateSubscription = function updateSubscription(request, callback) { - return this.rpcCall(updateSubscription, $root.google.pubsub.v1.UpdateSubscriptionRequest, $root.google.pubsub.v1.Subscription, request, callback); - }, "name", { value: "UpdateSubscription" }); + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; - /** - * Calls UpdateSubscription. - * @function updateSubscription - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IUpdateSubscriptionRequest} request UpdateSubscriptionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * 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(); + }; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#listSubscriptions}. - * @memberof google.pubsub.v1.Subscriber - * @typedef ListSubscriptionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.ListSubscriptionsResponse} [response] ListSubscriptionsResponse - */ + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Calls ListSubscriptions. - * @function listSubscriptions - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IListSubscriptionsRequest} request ListSubscriptionsRequest message or plain object - * @param {google.pubsub.v1.Subscriber.ListSubscriptionsCallback} callback Node-style callback called with the error, if any, and ListSubscriptionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.listSubscriptions = function listSubscriptions(request, callback) { - return this.rpcCall(listSubscriptions, $root.google.pubsub.v1.ListSubscriptionsRequest, $root.google.pubsub.v1.ListSubscriptionsResponse, request, callback); - }, "name", { value: "ListSubscriptions" }); + /** + * 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()); + }; - /** - * Calls ListSubscriptions. - * @function listSubscriptions - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IListSubscriptionsRequest} request ListSubscriptionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * 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; + }; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#deleteSubscription}. - * @memberof google.pubsub.v1.Subscriber - * @typedef DeleteSubscriptionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteSubscription. - * @function deleteSubscription - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IDeleteSubscriptionRequest} request DeleteSubscriptionRequest message or plain object - * @param {google.pubsub.v1.Subscriber.DeleteSubscriptionCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.deleteSubscription = function deleteSubscription(request, callback) { - return this.rpcCall(deleteSubscription, $root.google.pubsub.v1.DeleteSubscriptionRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteSubscription" }); + /** + * 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; + }; - /** - * Calls DeleteSubscription. - * @function deleteSubscription - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IDeleteSubscriptionRequest} request DeleteSubscriptionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * 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; + }; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#modifyAckDeadline}. - * @memberof google.pubsub.v1.Subscriber - * @typedef ModifyAckDeadlineCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ + /** + * 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); + }; - /** - * Calls ModifyAckDeadline. - * @function modifyAckDeadline - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IModifyAckDeadlineRequest} request ModifyAckDeadlineRequest message or plain object - * @param {google.pubsub.v1.Subscriber.ModifyAckDeadlineCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.modifyAckDeadline = function modifyAckDeadline(request, callback) { - return this.rpcCall(modifyAckDeadline, $root.google.pubsub.v1.ModifyAckDeadlineRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "ModifyAckDeadline" }); + return CustomHttpPattern; + })(); - /** - * Calls ModifyAckDeadline. - * @function modifyAckDeadline - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IModifyAckDeadlineRequest} request ModifyAckDeadlineRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {string} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + return values; + })(); - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#acknowledge}. - * @memberof google.pubsub.v1.Subscriber - * @typedef AcknowledgeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ + api.ResourceDescriptor = (function() { - /** - * Calls Acknowledge. - * @function acknowledge - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IAcknowledgeRequest} request AcknowledgeRequest message or plain object - * @param {google.pubsub.v1.Subscriber.AcknowledgeCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.acknowledge = function acknowledge(request, callback) { - return this.rpcCall(acknowledge, $root.google.pubsub.v1.AcknowledgeRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "Acknowledge" }); + /** + * 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 + */ - /** - * Calls Acknowledge. - * @function acknowledge - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IAcknowledgeRequest} request AcknowledgeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#pull}. - * @memberof google.pubsub.v1.Subscriber - * @typedef PullCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.PullResponse} [response] PullResponse - */ + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; - /** - * Calls Pull. - * @function pull - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IPullRequest} request PullRequest message or plain object - * @param {google.pubsub.v1.Subscriber.PullCallback} callback Node-style callback called with the error, if any, and PullResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.pull = function pull(request, callback) { - return this.rpcCall(pull, $root.google.pubsub.v1.PullRequest, $root.google.pubsub.v1.PullResponse, request, callback); - }, "name", { value: "Pull" }); + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; - /** - * Calls Pull. - * @function pull - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IPullRequest} request PullRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#streamingPull}. - * @memberof google.pubsub.v1.Subscriber - * @typedef StreamingPullCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.StreamingPullResponse} [response] StreamingPullResponse - */ + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; - /** - * Calls StreamingPull. - * @function streamingPull - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IStreamingPullRequest} request StreamingPullRequest message or plain object - * @param {google.pubsub.v1.Subscriber.StreamingPullCallback} callback Node-style callback called with the error, if any, and StreamingPullResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.streamingPull = function streamingPull(request, callback) { - return this.rpcCall(streamingPull, $root.google.pubsub.v1.StreamingPullRequest, $root.google.pubsub.v1.StreamingPullResponse, request, callback); - }, "name", { value: "StreamingPull" }); - - /** - * Calls StreamingPull. - * @function streamingPull - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IStreamingPullRequest} request StreamingPullRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#modifyPushConfig}. - * @memberof google.pubsub.v1.Subscriber - * @typedef ModifyPushConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; - /** - * Calls ModifyPushConfig. - * @function modifyPushConfig - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IModifyPushConfigRequest} request ModifyPushConfigRequest message or plain object - * @param {google.pubsub.v1.Subscriber.ModifyPushConfigCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.modifyPushConfig = function modifyPushConfig(request, callback) { - return this.rpcCall(modifyPushConfig, $root.google.pubsub.v1.ModifyPushConfigRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "ModifyPushConfig" }); + /** + * 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); + }; - /** - * Calls ModifyPushConfig. - * @function modifyPushConfig - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IModifyPushConfigRequest} request ModifyPushConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && message.hasOwnProperty("nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && message.hasOwnProperty("history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && message.hasOwnProperty("plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && message.hasOwnProperty("singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + return writer; + }; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#getSnapshot}. - * @memberof google.pubsub.v1.Subscriber - * @typedef GetSnapshotCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Snapshot} [response] Snapshot - */ + /** + * 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(); + }; - /** - * Calls GetSnapshot. - * @function getSnapshot - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IGetSnapshotRequest} request GetSnapshotRequest message or plain object - * @param {google.pubsub.v1.Subscriber.GetSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.getSnapshot = function getSnapshot(request, callback) { - return this.rpcCall(getSnapshot, $root.google.pubsub.v1.GetSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback); - }, "name", { value: "GetSnapshot" }); + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + case 3: + message.nameField = reader.string(); + break; + case 4: + message.history = reader.int32(); + break; + case 5: + message.plural = reader.string(); + break; + case 6: + message.singular = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Calls GetSnapshot. - * @function getSnapshot - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IGetSnapshotRequest} request GetSnapshotRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * 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()); + }; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#listSnapshots}. - * @memberof google.pubsub.v1.Subscriber - * @typedef ListSnapshotsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.ListSnapshotsResponse} [response] ListSnapshotsResponse - */ + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + return null; + }; - /** - * Calls ListSnapshots. - * @function listSnapshots - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object - * @param {google.pubsub.v1.Subscriber.ListSnapshotsCallback} callback Node-style callback called with the error, if any, and ListSnapshotsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.listSnapshots = function listSnapshots(request, callback) { - return this.rpcCall(listSnapshots, $root.google.pubsub.v1.ListSnapshotsRequest, $root.google.pubsub.v1.ListSnapshotsResponse, request, callback); - }, "name", { value: "ListSnapshots" }); + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + return message; + }; - /** - * Calls ListSnapshots. - * @function listSnapshots - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pattern = []; + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + return object; + }; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#createSnapshot}. - * @memberof google.pubsub.v1.Subscriber - * @typedef CreateSnapshotCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Snapshot} [response] Snapshot - */ + /** + * 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); + }; - /** - * Calls CreateSnapshot. - * @function createSnapshot - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.ICreateSnapshotRequest} request CreateSnapshotRequest message or plain object - * @param {google.pubsub.v1.Subscriber.CreateSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.createSnapshot = function createSnapshot(request, callback) { - return this.rpcCall(createSnapshot, $root.google.pubsub.v1.CreateSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback); - }, "name", { value: "CreateSnapshot" }); + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {string} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); - /** - * Calls CreateSnapshot. - * @function createSnapshot - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.ICreateSnapshotRequest} request CreateSnapshotRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + return ResourceDescriptor; + })(); - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#updateSnapshot}. - * @memberof google.pubsub.v1.Subscriber - * @typedef UpdateSnapshotCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.Snapshot} [response] Snapshot - */ + api.ResourceReference = (function() { - /** - * Calls UpdateSnapshot. - * @function updateSnapshot - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IUpdateSnapshotRequest} request UpdateSnapshotRequest message or plain object - * @param {google.pubsub.v1.Subscriber.UpdateSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.updateSnapshot = function updateSnapshot(request, callback) { - return this.rpcCall(updateSnapshot, $root.google.pubsub.v1.UpdateSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback); - }, "name", { value: "UpdateSnapshot" }); + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ - /** - * Calls UpdateSnapshot. - * @function updateSnapshot - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IUpdateSnapshotRequest} request UpdateSnapshotRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * 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]]; + } - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#deleteSnapshot}. - * @memberof google.pubsub.v1.Subscriber - * @typedef DeleteSnapshotCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; - /** - * Calls DeleteSnapshot. - * @function deleteSnapshot - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object - * @param {google.pubsub.v1.Subscriber.DeleteSnapshotCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.deleteSnapshot = function deleteSnapshot(request, callback) { - return this.rpcCall(deleteSnapshot, $root.google.pubsub.v1.DeleteSnapshotRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteSnapshot" }); + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; - /** - * Calls DeleteSnapshot. - * @function deleteSnapshot - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * 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); + }; - /** - * Callback as used by {@link google.pubsub.v1.Subscriber#seek}. - * @memberof google.pubsub.v1.Subscriber - * @typedef SeekCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.pubsub.v1.SeekResponse} [response] SeekResponse - */ + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && message.hasOwnProperty("childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; - /** - * Calls Seek. - * @function seek - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.ISeekRequest} request SeekRequest message or plain object - * @param {google.pubsub.v1.Subscriber.SeekCallback} callback Node-style callback called with the error, if any, and SeekResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Subscriber.prototype.seek = function seek(request, callback) { - return this.rpcCall(seek, $root.google.pubsub.v1.SeekRequest, $root.google.pubsub.v1.SeekResponse, request, callback); - }, "name", { value: "Seek" }); + /** + * 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(); + }; - /** - * Calls Seek. - * @function seek - * @memberof google.pubsub.v1.Subscriber - * @instance - * @param {google.pubsub.v1.ISeekRequest} request SeekRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.childType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - return Subscriber; - })(); + /** + * 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()); + }; - v1.Subscription = (function() { + /** + * 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; + }; - /** - * Properties of a Subscription. - * @memberof google.pubsub.v1 - * @interface ISubscription - * @property {string|null} [name] Subscription name - * @property {string|null} [topic] Subscription topic - * @property {google.pubsub.v1.IPushConfig|null} [pushConfig] Subscription pushConfig - * @property {number|null} [ackDeadlineSeconds] Subscription ackDeadlineSeconds - * @property {boolean|null} [retainAckedMessages] Subscription retainAckedMessages - * @property {google.protobuf.IDuration|null} [messageRetentionDuration] Subscription messageRetentionDuration - * @property {Object.|null} [labels] Subscription labels - * @property {boolean|null} [enableMessageOrdering] Subscription enableMessageOrdering - * @property {google.pubsub.v1.IExpirationPolicy|null} [expirationPolicy] Subscription expirationPolicy - * @property {google.pubsub.v1.IDeadLetterPolicy|null} [deadLetterPolicy] Subscription deadLetterPolicy - */ + /** + * 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; + }; - /** - * Constructs a new Subscription. - * @memberof google.pubsub.v1 - * @classdesc Represents a Subscription. - * @implements ISubscription - * @constructor - * @param {google.pubsub.v1.ISubscription=} [properties] Properties to set - */ - function Subscription(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]]; + /** + * 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; + }; - /** - * Subscription name. - * @member {string} name - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.name = ""; + /** + * 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); + }; - /** - * Subscription topic. - * @member {string} topic - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.topic = ""; + return ResourceReference; + })(); - /** - * Subscription pushConfig. - * @member {google.pubsub.v1.IPushConfig|null|undefined} pushConfig - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.pushConfig = null; + return api; + })(); - /** - * Subscription ackDeadlineSeconds. - * @member {number} ackDeadlineSeconds - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.ackDeadlineSeconds = 0; + google.protobuf = (function() { - /** - * Subscription retainAckedMessages. - * @member {boolean} retainAckedMessages - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.retainAckedMessages = false; - - /** - * Subscription messageRetentionDuration. - * @member {google.protobuf.IDuration|null|undefined} messageRetentionDuration - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.messageRetentionDuration = null; + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; - /** - * Subscription labels. - * @member {Object.} labels - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.labels = $util.emptyObject; + protobuf.FileDescriptorSet = (function() { - /** - * Subscription enableMessageOrdering. - * @member {boolean} enableMessageOrdering - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.enableMessageOrdering = false; + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ - /** - * Subscription expirationPolicy. - * @member {google.pubsub.v1.IExpirationPolicy|null|undefined} expirationPolicy - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.expirationPolicy = null; + /** + * 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]]; + } - /** - * Subscription deadLetterPolicy. - * @member {google.pubsub.v1.IDeadLetterPolicy|null|undefined} deadLetterPolicy - * @memberof google.pubsub.v1.Subscription - * @instance - */ - Subscription.prototype.deadLetterPolicy = null; + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; - /** - * Creates a new Subscription instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.Subscription - * @static - * @param {google.pubsub.v1.ISubscription=} [properties] Properties to set - * @returns {google.pubsub.v1.Subscription} Subscription instance - */ - Subscription.create = function create(properties) { - return new Subscription(properties); - }; + /** + * 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 Subscription message. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.Subscription - * @static - * @param {google.pubsub.v1.ISubscription} message Subscription message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Subscription.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.topic != null && message.hasOwnProperty("topic")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.topic); - if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) - $root.google.pubsub.v1.PushConfig.encode(message.pushConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.ackDeadlineSeconds); - if (message.retainAckedMessages != null && message.hasOwnProperty("retainAckedMessages")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.retainAckedMessages); - if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) - $root.google.protobuf.Duration.encode(message.messageRetentionDuration, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.labels != null && message.hasOwnProperty("labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 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(); - if (message.enableMessageOrdering != null && message.hasOwnProperty("enableMessageOrdering")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.enableMessageOrdering); - if (message.expirationPolicy != null && message.hasOwnProperty("expirationPolicy")) - $root.google.pubsub.v1.ExpirationPolicy.encode(message.expirationPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.deadLetterPolicy != null && message.hasOwnProperty("deadLetterPolicy")) - $root.google.pubsub.v1.DeadLetterPolicy.encode(message.deadLetterPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - return writer; - }; + /** + * 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 Subscription message, length delimited. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.Subscription - * @static - * @param {google.pubsub.v1.ISubscription} message Subscription message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Subscription.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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 Subscription message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.Subscription - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.Subscription} Subscription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Subscription.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.Subscription(), key; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.topic = reader.string(); - break; - case 4: - message.pushConfig = $root.google.pubsub.v1.PushConfig.decode(reader, reader.uint32()); - break; - case 5: - message.ackDeadlineSeconds = reader.int32(); - break; - case 7: - message.retainAckedMessages = reader.bool(); - break; - case 8: - message.messageRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 9: - reader.skip().pos++; - if (message.labels === $util.emptyObject) - message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); - break; - case 10: - message.enableMessageOrdering = reader.bool(); - break; - case 11: - message.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.decode(reader, reader.uint32()); - break; - case 13: - message.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a Subscription message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.Subscription - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.Subscription} Subscription - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Subscription.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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 Subscription message. - * @function verify - * @memberof google.pubsub.v1.Subscription - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Subscription.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.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: string expected"; - if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) { - var error = $root.google.pubsub.v1.PushConfig.verify(message.pushConfig); - if (error) - return "pushConfig." + error; - } - if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) - if (!$util.isInteger(message.ackDeadlineSeconds)) - return "ackDeadlineSeconds: integer expected"; - if (message.retainAckedMessages != null && message.hasOwnProperty("retainAckedMessages")) - if (typeof message.retainAckedMessages !== "boolean") - return "retainAckedMessages: boolean expected"; - if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) { - var error = $root.google.protobuf.Duration.verify(message.messageRetentionDuration); - if (error) - return "messageRetentionDuration." + 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.enableMessageOrdering != null && message.hasOwnProperty("enableMessageOrdering")) - if (typeof message.enableMessageOrdering !== "boolean") - return "enableMessageOrdering: boolean expected"; - if (message.expirationPolicy != null && message.hasOwnProperty("expirationPolicy")) { - var error = $root.google.pubsub.v1.ExpirationPolicy.verify(message.expirationPolicy); - if (error) - return "expirationPolicy." + error; - } - if (message.deadLetterPolicy != null && message.hasOwnProperty("deadLetterPolicy")) { - var error = $root.google.pubsub.v1.DeadLetterPolicy.verify(message.deadLetterPolicy); + /** + * 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 "deadLetterPolicy." + error; + return "file." + error; } - return null; - }; + } + return null; + }; - /** - * Creates a Subscription message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.Subscription - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.Subscription} Subscription - */ - Subscription.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.Subscription) - return object; - var message = new $root.google.pubsub.v1.Subscription(); - if (object.name != null) - message.name = String(object.name); - if (object.topic != null) - message.topic = String(object.topic); - if (object.pushConfig != null) { - if (typeof object.pushConfig !== "object") - throw TypeError(".google.pubsub.v1.Subscription.pushConfig: object expected"); - message.pushConfig = $root.google.pubsub.v1.PushConfig.fromObject(object.pushConfig); - } - if (object.ackDeadlineSeconds != null) - message.ackDeadlineSeconds = object.ackDeadlineSeconds | 0; - if (object.retainAckedMessages != null) - message.retainAckedMessages = Boolean(object.retainAckedMessages); - if (object.messageRetentionDuration != null) { - if (typeof object.messageRetentionDuration !== "object") - throw TypeError(".google.pubsub.v1.Subscription.messageRetentionDuration: object expected"); - message.messageRetentionDuration = $root.google.protobuf.Duration.fromObject(object.messageRetentionDuration); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.pubsub.v1.Subscription.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.enableMessageOrdering != null) - message.enableMessageOrdering = Boolean(object.enableMessageOrdering); - if (object.expirationPolicy != null) { - if (typeof object.expirationPolicy !== "object") - throw TypeError(".google.pubsub.v1.Subscription.expirationPolicy: object expected"); - message.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.fromObject(object.expirationPolicy); - } - if (object.deadLetterPolicy != null) { - if (typeof object.deadLetterPolicy !== "object") - throw TypeError(".google.pubsub.v1.Subscription.deadLetterPolicy: object expected"); - message.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.fromObject(object.deadLetterPolicy); + /** + * 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; - }; + } + return message; + }; - /** - * Creates a plain object from a Subscription message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.Subscription - * @static - * @param {google.pubsub.v1.Subscription} message Subscription - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Subscription.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.topic = ""; - object.pushConfig = null; - object.ackDeadlineSeconds = 0; - object.retainAckedMessages = false; - object.messageRetentionDuration = null; - object.enableMessageOrdering = false; - object.expirationPolicy = null; - object.deadLetterPolicy = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; - if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) - object.pushConfig = $root.google.pubsub.v1.PushConfig.toObject(message.pushConfig, options); - if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) - object.ackDeadlineSeconds = message.ackDeadlineSeconds; - if (message.retainAckedMessages != null && message.hasOwnProperty("retainAckedMessages")) - object.retainAckedMessages = message.retainAckedMessages; - if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) - object.messageRetentionDuration = $root.google.protobuf.Duration.toObject(message.messageRetentionDuration, 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.enableMessageOrdering != null && message.hasOwnProperty("enableMessageOrdering")) - object.enableMessageOrdering = message.enableMessageOrdering; - if (message.expirationPolicy != null && message.hasOwnProperty("expirationPolicy")) - object.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.toObject(message.expirationPolicy, options); - if (message.deadLetterPolicy != null && message.hasOwnProperty("deadLetterPolicy")) - object.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.toObject(message.deadLetterPolicy, options); - return object; - }; + /** + * 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 Subscription to JSON. - * @function toJSON - * @memberof google.pubsub.v1.Subscription - * @instance - * @returns {Object.} JSON object - */ - Subscription.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Subscription; - })(); + /** + * 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); + }; - v1.DeadLetterPolicy = (function() { + return FileDescriptorSet; + })(); - /** - * Properties of a DeadLetterPolicy. - * @memberof google.pubsub.v1 - * @interface IDeadLetterPolicy - * @property {string|null} [deadLetterTopic] DeadLetterPolicy deadLetterTopic - * @property {number|null} [maxDeliveryAttempts] DeadLetterPolicy maxDeliveryAttempts - */ + protobuf.FileDescriptorProto = (function() { - /** - * Constructs a new DeadLetterPolicy. - * @memberof google.pubsub.v1 - * @classdesc Represents a DeadLetterPolicy. - * @implements IDeadLetterPolicy - * @constructor - * @param {google.pubsub.v1.IDeadLetterPolicy=} [properties] Properties to set - */ - function DeadLetterPolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + */ - /** - * DeadLetterPolicy deadLetterTopic. - * @member {string} deadLetterTopic - * @memberof google.pubsub.v1.DeadLetterPolicy - * @instance - */ - DeadLetterPolicy.prototype.deadLetterTopic = ""; + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * DeadLetterPolicy maxDeliveryAttempts. - * @member {number} maxDeliveryAttempts - * @memberof google.pubsub.v1.DeadLetterPolicy - * @instance - */ - DeadLetterPolicy.prototype.maxDeliveryAttempts = 0; + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; - /** - * Creates a new DeadLetterPolicy instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.DeadLetterPolicy - * @static - * @param {google.pubsub.v1.IDeadLetterPolicy=} [properties] Properties to set - * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy instance - */ - DeadLetterPolicy.create = function create(properties) { - return new DeadLetterPolicy(properties); - }; + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; - /** - * Encodes the specified DeadLetterPolicy message. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.DeadLetterPolicy - * @static - * @param {google.pubsub.v1.IDeadLetterPolicy} message DeadLetterPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeadLetterPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deadLetterTopic != null && message.hasOwnProperty("deadLetterTopic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.deadLetterTopic); - if (message.maxDeliveryAttempts != null && message.hasOwnProperty("maxDeliveryAttempts")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxDeliveryAttempts); - return writer; - }; + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; - /** - * Encodes the specified DeadLetterPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.DeadLetterPolicy - * @static - * @param {google.pubsub.v1.IDeadLetterPolicy} message DeadLetterPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeadLetterPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - /** - * Decodes a DeadLetterPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.DeadLetterPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeadLetterPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeadLetterPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deadLetterTopic = reader.string(); - break; - case 2: - message.maxDeliveryAttempts = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - /** - * Decodes a DeadLetterPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.DeadLetterPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeadLetterPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; - /** - * Verifies a DeadLetterPolicy message. - * @function verify - * @memberof google.pubsub.v1.DeadLetterPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeadLetterPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deadLetterTopic != null && message.hasOwnProperty("deadLetterTopic")) - if (!$util.isString(message.deadLetterTopic)) - return "deadLetterTopic: string expected"; - if (message.maxDeliveryAttempts != null && message.hasOwnProperty("maxDeliveryAttempts")) - if (!$util.isInteger(message.maxDeliveryAttempts)) - return "maxDeliveryAttempts: integer expected"; - return null; - }; + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; - /** - * Creates a DeadLetterPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.DeadLetterPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy - */ - DeadLetterPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.DeadLetterPolicy) - return object; - var message = new $root.google.pubsub.v1.DeadLetterPolicy(); - if (object.deadLetterTopic != null) - message.deadLetterTopic = String(object.deadLetterTopic); - if (object.maxDeliveryAttempts != null) - message.maxDeliveryAttempts = object.maxDeliveryAttempts | 0; - return message; - }; - - /** - * Creates a plain object from a DeadLetterPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.DeadLetterPolicy - * @static - * @param {google.pubsub.v1.DeadLetterPolicy} message DeadLetterPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeadLetterPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.deadLetterTopic = ""; - object.maxDeliveryAttempts = 0; - } - if (message.deadLetterTopic != null && message.hasOwnProperty("deadLetterTopic")) - object.deadLetterTopic = message.deadLetterTopic; - if (message.maxDeliveryAttempts != null && message.hasOwnProperty("maxDeliveryAttempts")) - object.maxDeliveryAttempts = message.maxDeliveryAttempts; - return object; - }; - - /** - * Converts this DeadLetterPolicy to JSON. - * @function toJSON - * @memberof google.pubsub.v1.DeadLetterPolicy - * @instance - * @returns {Object.} JSON object - */ - DeadLetterPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DeadLetterPolicy; - })(); - - v1.ExpirationPolicy = (function() { + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; - /** - * Properties of an ExpirationPolicy. - * @memberof google.pubsub.v1 - * @interface IExpirationPolicy - * @property {google.protobuf.IDuration|null} [ttl] ExpirationPolicy ttl - */ + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; - /** - * Constructs a new ExpirationPolicy. - * @memberof google.pubsub.v1 - * @classdesc Represents an ExpirationPolicy. - * @implements IExpirationPolicy - * @constructor - * @param {google.pubsub.v1.IExpirationPolicy=} [properties] Properties to set - */ - function ExpirationPolicy(properties) { - if (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 options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; - /** - * ExpirationPolicy ttl. - * @member {google.protobuf.IDuration|null|undefined} ttl - * @memberof google.pubsub.v1.ExpirationPolicy - * @instance - */ - ExpirationPolicy.prototype.ttl = null; + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; - /** - * Creates a new ExpirationPolicy instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ExpirationPolicy - * @static - * @param {google.pubsub.v1.IExpirationPolicy=} [properties] Properties to set - * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy instance - */ - ExpirationPolicy.create = function create(properties) { - return new ExpirationPolicy(properties); - }; + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; - /** - * Encodes the specified ExpirationPolicy message. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ExpirationPolicy - * @static - * @param {google.pubsub.v1.IExpirationPolicy} message ExpirationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExpirationPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ttl != null && message.hasOwnProperty("ttl")) - $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * 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 ExpirationPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ExpirationPolicy - * @static - * @param {google.pubsub.v1.IExpirationPolicy} message ExpirationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExpirationPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && message.hasOwnProperty("package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && message.hasOwnProperty("syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + return writer; + }; - /** - * Decodes an ExpirationPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ExpirationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExpirationPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ExpirationPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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 an ExpirationPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ExpirationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExpirationPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message["package"] = reader.string(); + break; + case 3: + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + case 10: + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + case 11: + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + case 4: + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Verifies an ExpirationPolicy message. - * @function verify - * @memberof google.pubsub.v1.ExpirationPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExpirationPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ttl != null && message.hasOwnProperty("ttl")) { - var error = $root.google.protobuf.Duration.verify(message.ttl); + /** + * 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.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 "ttl." + error; + return "messageType." + error; } - return null; - }; - - /** - * Creates an ExpirationPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ExpirationPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy - */ - ExpirationPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ExpirationPolicy) - return object; - var message = new $root.google.pubsub.v1.ExpirationPolicy(); - if (object.ttl != null) { - if (typeof object.ttl !== "object") - throw TypeError(".google.pubsub.v1.ExpirationPolicy.ttl: object expected"); - message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + 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; } - return message; - }; - - /** - * Creates a plain object from an ExpirationPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ExpirationPolicy - * @static - * @param {google.pubsub.v1.ExpirationPolicy} message ExpirationPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExpirationPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.ttl = null; - if (message.ttl != null && message.hasOwnProperty("ttl")) - object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); - return object; - }; + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + return null; + }; - /** - * Converts this ExpirationPolicy to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ExpirationPolicy - * @instance - * @returns {Object.} JSON object - */ - ExpirationPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExpirationPolicy; - })(); - - v1.PushConfig = (function() { - - /** - * Properties of a PushConfig. - * @memberof google.pubsub.v1 - * @interface IPushConfig - * @property {string|null} [pushEndpoint] PushConfig pushEndpoint - * @property {Object.|null} [attributes] PushConfig attributes - * @property {google.pubsub.v1.PushConfig.IOidcToken|null} [oidcToken] PushConfig oidcToken - */ + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + return message; + }; - /** - * Constructs a new PushConfig. - * @memberof google.pubsub.v1 - * @classdesc Represents a PushConfig. - * @implements IPushConfig - * @constructor - * @param {google.pubsub.v1.IPushConfig=} [properties] Properties to set - */ - function PushConfig(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]]; + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + return object; + }; - /** - * PushConfig pushEndpoint. - * @member {string} pushEndpoint - * @memberof google.pubsub.v1.PushConfig - * @instance - */ - PushConfig.prototype.pushEndpoint = ""; + /** + * 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); + }; - /** - * PushConfig attributes. - * @member {Object.} attributes - * @memberof google.pubsub.v1.PushConfig - * @instance - */ - PushConfig.prototype.attributes = $util.emptyObject; + return FileDescriptorProto; + })(); - /** - * PushConfig oidcToken. - * @member {google.pubsub.v1.PushConfig.IOidcToken|null|undefined} oidcToken - * @memberof google.pubsub.v1.PushConfig - * @instance - */ - PushConfig.prototype.oidcToken = null; + protobuf.DescriptorProto = (function() { - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * 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 + */ - /** - * PushConfig authenticationMethod. - * @member {"oidcToken"|undefined} authenticationMethod - * @memberof google.pubsub.v1.PushConfig - * @instance - */ - Object.defineProperty(PushConfig.prototype, "authenticationMethod", { - get: $util.oneOfGetter($oneOfFields = ["oidcToken"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * 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]]; + } - /** - * Creates a new PushConfig instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.PushConfig - * @static - * @param {google.pubsub.v1.IPushConfig=} [properties] Properties to set - * @returns {google.pubsub.v1.PushConfig} PushConfig instance - */ - PushConfig.create = function create(properties) { - return new PushConfig(properties); - }; + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; - /** - * Encodes the specified PushConfig message. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.PushConfig - * @static - * @param {google.pubsub.v1.IPushConfig} message PushConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PushConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pushEndpoint != null && message.hasOwnProperty("pushEndpoint")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pushEndpoint); - if (message.attributes != null && message.hasOwnProperty("attributes")) - for (var keys = Object.keys(message.attributes), 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.attributes[keys[i]]).ldelim(); - if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) - $root.google.pubsub.v1.PushConfig.OidcToken.encode(message.oidcToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; - /** - * Encodes the specified PushConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.PushConfig - * @static - * @param {google.pubsub.v1.IPushConfig} message PushConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PushConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; - /** - * Decodes a PushConfig message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.PushConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.PushConfig} PushConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PushConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PushConfig(), key; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pushEndpoint = reader.string(); - break; - case 2: - reader.skip().pos++; - if (message.attributes === $util.emptyObject) - message.attributes = {}; - key = reader.string(); - reader.pos++; - message.attributes[key] = reader.string(); - break; - case 3: - message.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; - /** - * Decodes a PushConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.PushConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.PushConfig} PushConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PushConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; - /** - * Verifies a PushConfig message. - * @function verify - * @memberof google.pubsub.v1.PushConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PushConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.pushEndpoint != null && message.hasOwnProperty("pushEndpoint")) - if (!$util.isString(message.pushEndpoint)) - return "pushEndpoint: string expected"; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.attributes[key[i]])) - return "attributes: string{k:string} expected"; - } - if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) { - properties.authenticationMethod = 1; - { - var error = $root.google.pubsub.v1.PushConfig.OidcToken.verify(message.oidcToken); - if (error) - return "oidcToken." + error; - } - } - return null; - }; + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; - /** - * Creates a PushConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.PushConfig - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.PushConfig} PushConfig - */ - PushConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.PushConfig) - return object; - var message = new $root.google.pubsub.v1.PushConfig(); - if (object.pushEndpoint != null) - message.pushEndpoint = String(object.pushEndpoint); - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.pubsub.v1.PushConfig.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) - message.attributes[keys[i]] = String(object.attributes[keys[i]]); - } - if (object.oidcToken != null) { - if (typeof object.oidcToken !== "object") - throw TypeError(".google.pubsub.v1.PushConfig.oidcToken: object expected"); - message.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.fromObject(object.oidcToken); - } - return message; - }; + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; - /** - * Creates a plain object from a PushConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.PushConfig - * @static - * @param {google.pubsub.v1.PushConfig} message PushConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PushConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.attributes = {}; - if (options.defaults) - object.pushEndpoint = ""; - if (message.pushEndpoint != null && message.hasOwnProperty("pushEndpoint")) - object.pushEndpoint = message.pushEndpoint; - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = message.attributes[keys2[j]]; - } - if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) { - object.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.toObject(message.oidcToken, options); - if (options.oneofs) - object.authenticationMethod = "oidcToken"; - } - return object; - }; + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; - /** - * Converts this PushConfig to JSON. - * @function toJSON - * @memberof google.pubsub.v1.PushConfig - * @instance - * @returns {Object.} JSON object - */ - PushConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; - PushConfig.OidcToken = (function() { + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; - /** - * Properties of an OidcToken. - * @memberof google.pubsub.v1.PushConfig - * @interface IOidcToken - * @property {string|null} [serviceAccountEmail] OidcToken serviceAccountEmail - * @property {string|null} [audience] OidcToken audience - */ + /** + * 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); + }; - /** - * Constructs a new OidcToken. - * @memberof google.pubsub.v1.PushConfig - * @classdesc Represents an OidcToken. - * @implements IOidcToken - * @constructor - * @param {google.pubsub.v1.PushConfig.IOidcToken=} [properties] Properties to set - */ - function OidcToken(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; - /** - * OidcToken serviceAccountEmail. - * @member {string} serviceAccountEmail - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @instance - */ - OidcToken.prototype.serviceAccountEmail = ""; + /** + * 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(); + }; - /** - * OidcToken audience. - * @member {string} audience - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @instance - */ - OidcToken.prototype.audience = ""; + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new OidcToken instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @static - * @param {google.pubsub.v1.PushConfig.IOidcToken=} [properties] Properties to set - * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken instance - */ - OidcToken.create = function create(properties) { - return new OidcToken(properties); - }; + /** + * 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()); + }; - /** - * Encodes the specified OidcToken message. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @static - * @param {google.pubsub.v1.PushConfig.IOidcToken} message OidcToken message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OidcToken.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccountEmail); - if (message.audience != null && message.hasOwnProperty("audience")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.audience); - return writer; - }; - - /** - * Encodes the specified OidcToken message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @static - * @param {google.pubsub.v1.PushConfig.IOidcToken} message OidcToken message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OidcToken.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OidcToken message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OidcToken.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PushConfig.OidcToken(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.serviceAccountEmail = reader.string(); - break; - case 2: - message.audience = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OidcToken message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OidcToken.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OidcToken message. - * @function verify - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OidcToken.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - if (!$util.isString(message.serviceAccountEmail)) - return "serviceAccountEmail: string expected"; - if (message.audience != null && message.hasOwnProperty("audience")) - if (!$util.isString(message.audience)) - return "audience: string expected"; - return null; - }; - - /** - * Creates an OidcToken message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken - */ - OidcToken.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.PushConfig.OidcToken) - return object; - var message = new $root.google.pubsub.v1.PushConfig.OidcToken(); - if (object.serviceAccountEmail != null) - message.serviceAccountEmail = String(object.serviceAccountEmail); - if (object.audience != null) - message.audience = String(object.audience); - return message; - }; - - /** - * Creates a plain object from an OidcToken message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @static - * @param {google.pubsub.v1.PushConfig.OidcToken} message OidcToken - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OidcToken.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.serviceAccountEmail = ""; - object.audience = ""; - } - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - object.serviceAccountEmail = message.serviceAccountEmail; - if (message.audience != null && message.hasOwnProperty("audience")) - object.audience = message.audience; - return object; - }; - - /** - * Converts this OidcToken to JSON. - * @function toJSON - * @memberof google.pubsub.v1.PushConfig.OidcToken - * @instance - * @returns {Object.} JSON object - */ - OidcToken.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return OidcToken; - })(); - - return PushConfig; - })(); - - v1.ReceivedMessage = (function() { - - /** - * Properties of a ReceivedMessage. - * @memberof google.pubsub.v1 - * @interface IReceivedMessage - * @property {string|null} [ackId] ReceivedMessage ackId - * @property {google.pubsub.v1.IPubsubMessage|null} [message] ReceivedMessage message - * @property {number|null} [deliveryAttempt] ReceivedMessage deliveryAttempt - */ - - /** - * Constructs a new ReceivedMessage. - * @memberof google.pubsub.v1 - * @classdesc Represents a ReceivedMessage. - * @implements IReceivedMessage - * @constructor - * @param {google.pubsub.v1.IReceivedMessage=} [properties] Properties to set - */ - function ReceivedMessage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReceivedMessage ackId. - * @member {string} ackId - * @memberof google.pubsub.v1.ReceivedMessage - * @instance - */ - ReceivedMessage.prototype.ackId = ""; - - /** - * ReceivedMessage message. - * @member {google.pubsub.v1.IPubsubMessage|null|undefined} message - * @memberof google.pubsub.v1.ReceivedMessage - * @instance - */ - ReceivedMessage.prototype.message = null; - - /** - * ReceivedMessage deliveryAttempt. - * @member {number} deliveryAttempt - * @memberof google.pubsub.v1.ReceivedMessage - * @instance - */ - ReceivedMessage.prototype.deliveryAttempt = 0; - - /** - * Creates a new ReceivedMessage instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ReceivedMessage - * @static - * @param {google.pubsub.v1.IReceivedMessage=} [properties] Properties to set - * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage instance - */ - ReceivedMessage.create = function create(properties) { - return new ReceivedMessage(properties); - }; - - /** - * Encodes the specified ReceivedMessage message. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ReceivedMessage - * @static - * @param {google.pubsub.v1.IReceivedMessage} message ReceivedMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReceivedMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ackId != null && message.hasOwnProperty("ackId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ackId); - if (message.message != null && message.hasOwnProperty("message")) - $root.google.pubsub.v1.PubsubMessage.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.deliveryAttempt != null && message.hasOwnProperty("deliveryAttempt")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.deliveryAttempt); - return writer; - }; - - /** - * Encodes the specified ReceivedMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ReceivedMessage - * @static - * @param {google.pubsub.v1.IReceivedMessage} message ReceivedMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReceivedMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReceivedMessage message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ReceivedMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReceivedMessage.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ReceivedMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ackId = reader.string(); - break; - case 2: - message.message = $root.google.pubsub.v1.PubsubMessage.decode(reader, reader.uint32()); - break; - case 3: - message.deliveryAttempt = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReceivedMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ReceivedMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReceivedMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReceivedMessage message. - * @function verify - * @memberof google.pubsub.v1.ReceivedMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReceivedMessage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ackId != null && message.hasOwnProperty("ackId")) - if (!$util.isString(message.ackId)) - return "ackId: string expected"; - if (message.message != null && message.hasOwnProperty("message")) { - var error = $root.google.pubsub.v1.PubsubMessage.verify(message.message); - if (error) - return "message." + error; - } - if (message.deliveryAttempt != null && message.hasOwnProperty("deliveryAttempt")) - if (!$util.isInteger(message.deliveryAttempt)) - return "deliveryAttempt: integer expected"; - return null; - }; - - /** - * Creates a ReceivedMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ReceivedMessage - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage - */ - ReceivedMessage.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ReceivedMessage) - return object; - var message = new $root.google.pubsub.v1.ReceivedMessage(); - if (object.ackId != null) - message.ackId = String(object.ackId); - if (object.message != null) { - if (typeof object.message !== "object") - throw TypeError(".google.pubsub.v1.ReceivedMessage.message: object expected"); - message.message = $root.google.pubsub.v1.PubsubMessage.fromObject(object.message); - } - if (object.deliveryAttempt != null) - message.deliveryAttempt = object.deliveryAttempt | 0; - return message; - }; - - /** - * Creates a plain object from a ReceivedMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ReceivedMessage - * @static - * @param {google.pubsub.v1.ReceivedMessage} message ReceivedMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReceivedMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.ackId = ""; - object.message = null; - object.deliveryAttempt = 0; - } - if (message.ackId != null && message.hasOwnProperty("ackId")) - object.ackId = message.ackId; - if (message.message != null && message.hasOwnProperty("message")) - object.message = $root.google.pubsub.v1.PubsubMessage.toObject(message.message, options); - if (message.deliveryAttempt != null && message.hasOwnProperty("deliveryAttempt")) - object.deliveryAttempt = message.deliveryAttempt; - return object; - }; - - /** - * Converts this ReceivedMessage to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ReceivedMessage - * @instance - * @returns {Object.} JSON object - */ - ReceivedMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ReceivedMessage; - })(); - - v1.GetSubscriptionRequest = (function() { - - /** - * Properties of a GetSubscriptionRequest. - * @memberof google.pubsub.v1 - * @interface IGetSubscriptionRequest - * @property {string|null} [subscription] GetSubscriptionRequest subscription - */ - - /** - * Constructs a new GetSubscriptionRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a GetSubscriptionRequest. - * @implements IGetSubscriptionRequest - * @constructor - * @param {google.pubsub.v1.IGetSubscriptionRequest=} [properties] Properties to set - */ - function GetSubscriptionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetSubscriptionRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @instance - */ - GetSubscriptionRequest.prototype.subscription = ""; - - /** - * Creates a new GetSubscriptionRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @static - * @param {google.pubsub.v1.IGetSubscriptionRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest instance - */ - GetSubscriptionRequest.create = function create(properties) { - return new GetSubscriptionRequest(properties); - }; - - /** - * Encodes the specified GetSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @static - * @param {google.pubsub.v1.IGetSubscriptionRequest} message GetSubscriptionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSubscriptionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && message.hasOwnProperty("subscription")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); - return writer; - }; - - /** - * Encodes the specified GetSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @static - * @param {google.pubsub.v1.IGetSubscriptionRequest} message GetSubscriptionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetSubscriptionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSubscriptionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.GetSubscriptionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.subscription = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * 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; } - return message; - }; - - /** - * Decodes a GetSubscriptionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetSubscriptionRequest message. - * @function verify - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetSubscriptionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string expected"; - return null; - }; - - /** - * Creates a GetSubscriptionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest - */ - GetSubscriptionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.GetSubscriptionRequest) - return object; - var message = new $root.google.pubsub.v1.GetSubscriptionRequest(); - if (object.subscription != null) - message.subscription = String(object.subscription); - return message; - }; - - /** - * Creates a plain object from a GetSubscriptionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @static - * @param {google.pubsub.v1.GetSubscriptionRequest} message GetSubscriptionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetSubscriptionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.subscription = ""; - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - return object; - }; - - /** - * Converts this GetSubscriptionRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.GetSubscriptionRequest - * @instance - * @returns {Object.} JSON object - */ - GetSubscriptionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetSubscriptionRequest; - })(); - - v1.UpdateSubscriptionRequest = (function() { - - /** - * Properties of an UpdateSubscriptionRequest. - * @memberof google.pubsub.v1 - * @interface IUpdateSubscriptionRequest - * @property {google.pubsub.v1.ISubscription|null} [subscription] UpdateSubscriptionRequest subscription - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSubscriptionRequest updateMask - */ - - /** - * Constructs a new UpdateSubscriptionRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents an UpdateSubscriptionRequest. - * @implements IUpdateSubscriptionRequest - * @constructor - * @param {google.pubsub.v1.IUpdateSubscriptionRequest=} [properties] Properties to set - */ - function UpdateSubscriptionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; } - - /** - * UpdateSubscriptionRequest subscription. - * @member {google.pubsub.v1.ISubscription|null|undefined} subscription - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @instance - */ - UpdateSubscriptionRequest.prototype.subscription = null; - - /** - * UpdateSubscriptionRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @instance - */ - UpdateSubscriptionRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateSubscriptionRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @static - * @param {google.pubsub.v1.IUpdateSubscriptionRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest instance - */ - UpdateSubscriptionRequest.create = function create(properties) { - return new UpdateSubscriptionRequest(properties); - }; - - /** - * Encodes the specified UpdateSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @static - * @param {google.pubsub.v1.IUpdateSubscriptionRequest} message UpdateSubscriptionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSubscriptionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && message.hasOwnProperty("subscription")) - $root.google.pubsub.v1.Subscription.encode(message.subscription, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @static - * @param {google.pubsub.v1.IUpdateSubscriptionRequest} message UpdateSubscriptionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSubscriptionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.UpdateSubscriptionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.subscription = $root.google.pubsub.v1.Subscription.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } + 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; } - return message; - }; - - /** - * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateSubscriptionRequest message. - * @function verify - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateSubscriptionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscription != null && message.hasOwnProperty("subscription")) { - var error = $root.google.pubsub.v1.Subscription.verify(message.subscription); + } + 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 "subscription." + error; + return "extensionRange." + error; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + } + 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 "updateMask." + error; + return "oneofDecl." + error; } - return null; - }; + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; - /** - * Creates an UpdateSubscriptionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest - */ - UpdateSubscriptionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.UpdateSubscriptionRequest) - return object; - var message = new $root.google.pubsub.v1.UpdateSubscriptionRequest(); - if (object.subscription != null) { - if (typeof object.subscription !== "object") - throw TypeError(".google.pubsub.v1.UpdateSubscriptionRequest.subscription: object expected"); - message.subscription = $root.google.pubsub.v1.Subscription.fromObject(object.subscription); + /** + * 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.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.pubsub.v1.UpdateSubscriptionRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + 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]); } - return message; - }; - - /** - * Creates a plain object from an UpdateSubscriptionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @static - * @param {google.pubsub.v1.UpdateSubscriptionRequest} message UpdateSubscriptionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateSubscriptionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.subscription = null; - object.updateMask = null; + } + 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 (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = $root.google.pubsub.v1.Subscription.toObject(message.subscription, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; - /** - * Converts this UpdateSubscriptionRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.UpdateSubscriptionRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateSubscriptionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; - return UpdateSubscriptionRequest; - })(); + /** + * 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); + }; - v1.ListSubscriptionsRequest = (function() { + DescriptorProto.ExtensionRange = (function() { /** - * Properties of a ListSubscriptionsRequest. - * @memberof google.pubsub.v1 - * @interface IListSubscriptionsRequest - * @property {string|null} [project] ListSubscriptionsRequest project - * @property {number|null} [pageSize] ListSubscriptionsRequest pageSize - * @property {string|null} [pageToken] ListSubscriptionsRequest pageToken + * 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 ListSubscriptionsRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListSubscriptionsRequest. - * @implements IListSubscriptionsRequest + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange * @constructor - * @param {google.pubsub.v1.IListSubscriptionsRequest=} [properties] Properties to set + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set */ - function ListSubscriptionsRequest(properties) { + function ExtensionRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6111,101 +5737,101 @@ } /** - * ListSubscriptionsRequest project. - * @member {string} project - * @memberof google.pubsub.v1.ListSubscriptionsRequest + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance */ - ListSubscriptionsRequest.prototype.project = ""; + ExtensionRange.prototype.start = 0; /** - * ListSubscriptionsRequest pageSize. - * @member {number} pageSize - * @memberof google.pubsub.v1.ListSubscriptionsRequest + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance */ - ListSubscriptionsRequest.prototype.pageSize = 0; + ExtensionRange.prototype.end = 0; /** - * ListSubscriptionsRequest pageToken. - * @member {string} pageToken - * @memberof google.pubsub.v1.ListSubscriptionsRequest + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance */ - ListSubscriptionsRequest.prototype.pageToken = ""; + ExtensionRange.prototype.options = null; /** - * Creates a new ListSubscriptionsRequest instance using the specified properties. + * Creates a new ExtensionRange instance using the specified properties. * @function create - * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static - * @param {google.pubsub.v1.IListSubscriptionsRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest instance + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance */ - ListSubscriptionsRequest.create = function create(properties) { - return new ListSubscriptionsRequest(properties); + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); }; /** - * Encodes the specified ListSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. * @function encode - * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static - * @param {google.pubsub.v1.IListSubscriptionsRequest} message ListSubscriptionsRequest message or plain object to encode + * @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 */ - ListSubscriptionsRequest.encode = function encode(message, writer) { + ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.project != null && message.hasOwnProperty("project")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. * @function encodeDelimited - * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static - * @param {google.pubsub.v1.IListSubscriptionsRequest} message ListSubscriptionsRequest message or plain object to encode + * @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 */ - ListSubscriptionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSubscriptionsRequest message from the specified reader or buffer. + * Decodes an ExtensionRange message from the specified reader or buffer. * @function decode - * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @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.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest + * @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 */ - ListSubscriptionsRequest.decode = function decode(reader, length) { + ExtensionRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSubscriptionsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.project = reader.string(); + message.start = reader.int32(); break; case 2: - message.pageSize = reader.int32(); + message.end = reader.int32(); break; case 3: - message.pageToken = reader.string(); + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6216,126 +5842,130 @@ }; /** - * Decodes a ListSubscriptionsRequest message from the specified reader or buffer, length delimited. + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest + * @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 */ - ListSubscriptionsRequest.decodeDelimited = function decodeDelimited(reader) { + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSubscriptionsRequest message. + * Verifies an ExtensionRange message. * @function verify - * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @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 */ - ListSubscriptionsRequest.verify = function verify(message) { + ExtensionRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: 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.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 a ListSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange */ - ListSubscriptionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListSubscriptionsRequest) + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) return object; - var message = new $root.google.pubsub.v1.ListSubscriptionsRequest(); - if (object.project != null) - message.project = String(object.project); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + 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 a ListSubscriptionsRequest message. Also converts values to other types if specified. + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. * @function toObject - * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static - * @param {google.pubsub.v1.ListSubscriptionsRequest} message ListSubscriptionsRequest + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSubscriptionsRequest.toObject = function toObject(message, options) { + ExtensionRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.project = ""; - object.pageSize = 0; - object.pageToken = ""; + object.start = 0; + object.end = 0; + object.options = null; } - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; + 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 ListSubscriptionsRequest to JSON. + * Converts this ExtensionRange to JSON. * @function toJSON - * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance * @returns {Object.} JSON object */ - ListSubscriptionsRequest.prototype.toJSON = function toJSON() { + ExtensionRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListSubscriptionsRequest; + return ExtensionRange; })(); - v1.ListSubscriptionsResponse = (function() { + DescriptorProto.ReservedRange = (function() { /** - * Properties of a ListSubscriptionsResponse. - * @memberof google.pubsub.v1 - * @interface IListSubscriptionsResponse - * @property {Array.|null} [subscriptions] ListSubscriptionsResponse subscriptions - * @property {string|null} [nextPageToken] ListSubscriptionsResponse nextPageToken + * 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 ListSubscriptionsResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListSubscriptionsResponse. - * @implements IListSubscriptionsResponse + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange * @constructor - * @param {google.pubsub.v1.IListSubscriptionsResponse=} [properties] Properties to set + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set */ - function ListSubscriptionsResponse(properties) { - this.subscriptions = []; + function ReservedRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6343,91 +5973,88 @@ } /** - * ListSubscriptionsResponse subscriptions. - * @member {Array.} subscriptions - * @memberof google.pubsub.v1.ListSubscriptionsResponse + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange * @instance */ - ListSubscriptionsResponse.prototype.subscriptions = $util.emptyArray; + ReservedRange.prototype.start = 0; /** - * ListSubscriptionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.pubsub.v1.ListSubscriptionsResponse + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange * @instance */ - ListSubscriptionsResponse.prototype.nextPageToken = ""; + ReservedRange.prototype.end = 0; /** - * Creates a new ListSubscriptionsResponse instance using the specified properties. + * Creates a new ReservedRange instance using the specified properties. * @function create - * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @memberof google.protobuf.DescriptorProto.ReservedRange * @static - * @param {google.pubsub.v1.IListSubscriptionsResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse instance + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance */ - ListSubscriptionsResponse.create = function create(properties) { - return new ListSubscriptionsResponse(properties); + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); }; /** - * Encodes the specified ListSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. * @function encode - * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @memberof google.protobuf.DescriptorProto.ReservedRange * @static - * @param {google.pubsub.v1.IListSubscriptionsResponse} message ListSubscriptionsResponse message or plain object to encode + * @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 */ - ListSubscriptionsResponse.encode = function encode(message, writer) { + ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.subscriptions != null && message.subscriptions.length) - for (var i = 0; i < message.subscriptions.length; ++i) - $root.google.pubsub.v1.Subscription.encode(message.subscriptions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; /** - * Encodes the specified ListSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. * @function encodeDelimited - * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @memberof google.protobuf.DescriptorProto.ReservedRange * @static - * @param {google.pubsub.v1.IListSubscriptionsResponse} message ListSubscriptionsResponse message or plain object to encode + * @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 */ - ListSubscriptionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSubscriptionsResponse message from the specified reader or buffer. + * Decodes a ReservedRange message from the specified reader or buffer. * @function decode - * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @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.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse + * @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 */ - ListSubscriptionsResponse.decode = function decode(reader, length) { + ReservedRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSubscriptionsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.subscriptions && message.subscriptions.length)) - message.subscriptions = []; - message.subscriptions.push($root.google.pubsub.v1.Subscription.decode(reader, reader.uint32())); + message.start = reader.int32(); break; case 2: - message.nextPageToken = reader.string(); + message.end = reader.int32(); break; default: reader.skipType(tag & 7); @@ -6438,1226 +6065,1445 @@ }; /** - * Decodes a ListSubscriptionsResponse message from the specified reader or buffer, length delimited. + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse + * @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 */ - ListSubscriptionsResponse.decodeDelimited = function decodeDelimited(reader) { + ReservedRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSubscriptionsResponse message. + * Verifies a ReservedRange message. * @function verify - * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @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 */ - ListSubscriptionsResponse.verify = function verify(message) { + ReservedRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.subscriptions != null && message.hasOwnProperty("subscriptions")) { - if (!Array.isArray(message.subscriptions)) - return "subscriptions: array expected"; - for (var i = 0; i < message.subscriptions.length; ++i) { - var error = $root.google.pubsub.v1.Subscription.verify(message.subscriptions[i]); - if (error) - return "subscriptions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string 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 ListSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange */ - ListSubscriptionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListSubscriptionsResponse) + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) return object; - var message = new $root.google.pubsub.v1.ListSubscriptionsResponse(); - if (object.subscriptions) { - if (!Array.isArray(object.subscriptions)) - throw TypeError(".google.pubsub.v1.ListSubscriptionsResponse.subscriptions: array expected"); - message.subscriptions = []; - for (var i = 0; i < object.subscriptions.length; ++i) { - if (typeof object.subscriptions[i] !== "object") - throw TypeError(".google.pubsub.v1.ListSubscriptionsResponse.subscriptions: object expected"); - message.subscriptions[i] = $root.google.pubsub.v1.Subscription.fromObject(object.subscriptions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + 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 ListSubscriptionsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. * @function toObject - * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @memberof google.protobuf.DescriptorProto.ReservedRange * @static - * @param {google.pubsub.v1.ListSubscriptionsResponse} message ListSubscriptionsResponse + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSubscriptionsResponse.toObject = function toObject(message, options) { + ReservedRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.subscriptions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.subscriptions && message.subscriptions.length) { - object.subscriptions = []; - for (var j = 0; j < message.subscriptions.length; ++j) - object.subscriptions[j] = $root.google.pubsub.v1.Subscription.toObject(message.subscriptions[j], options); + if (options.defaults) { + object.start = 0; + object.end = 0; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + 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 ListSubscriptionsResponse to JSON. + * Converts this ReservedRange to JSON. * @function toJSON - * @memberof google.pubsub.v1.ListSubscriptionsResponse + * @memberof google.protobuf.DescriptorProto.ReservedRange * @instance * @returns {Object.} JSON object */ - ListSubscriptionsResponse.prototype.toJSON = function toJSON() { + ReservedRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListSubscriptionsResponse; - })(); + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * 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.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(); + }; - v1.DeleteSubscriptionRequest = (function() { + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a DeleteSubscriptionRequest. - * @memberof google.pubsub.v1 - * @interface IDeleteSubscriptionRequest - * @property {string|null} [subscription] DeleteSubscriptionRequest subscription - */ + /** + * 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()); + }; - /** - * Constructs a new DeleteSubscriptionRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a DeleteSubscriptionRequest. - * @implements IDeleteSubscriptionRequest - * @constructor - * @param {google.pubsub.v1.IDeleteSubscriptionRequest=} [properties] Properties to set - */ - function DeleteSubscriptionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } } + return null; + }; - /** - * DeleteSubscriptionRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @instance - */ - DeleteSubscriptionRequest.prototype.subscription = ""; + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; - /** - * Creates a new DeleteSubscriptionRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @static - * @param {google.pubsub.v1.IDeleteSubscriptionRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest instance - */ - DeleteSubscriptionRequest.create = function create(properties) { - return new DeleteSubscriptionRequest(properties); - }; + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; - /** - * Encodes the specified DeleteSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @static - * @param {google.pubsub.v1.IDeleteSubscriptionRequest} message DeleteSubscriptionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSubscriptionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && message.hasOwnProperty("subscription")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); - return writer; - }; + /** + * 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); + }; - /** - * Encodes the specified DeleteSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @static - * @param {google.pubsub.v1.IDeleteSubscriptionRequest} message DeleteSubscriptionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return ExtensionRangeOptions; + })(); - /** - * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSubscriptionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeleteSubscriptionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.subscription = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + protobuf.FieldDescriptorProto = (function() { - /** - * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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 + */ - /** - * Verifies a DeleteSubscriptionRequest message. - * @function verify - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteSubscriptionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string expected"; - return null; - }; + /** + * 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]]; + } - /** - * Creates a DeleteSubscriptionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest - */ - DeleteSubscriptionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.DeleteSubscriptionRequest) - return object; - var message = new $root.google.pubsub.v1.DeleteSubscriptionRequest(); - if (object.subscription != null) - message.subscription = String(object.subscription); - return message; - }; + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; - /** - * Creates a plain object from a DeleteSubscriptionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @static - * @param {google.pubsub.v1.DeleteSubscriptionRequest} message DeleteSubscriptionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteSubscriptionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.subscription = ""; - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - return object; - }; + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; - /** - * Converts this DeleteSubscriptionRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.DeleteSubscriptionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteSubscriptionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; - return DeleteSubscriptionRequest; - })(); + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; - v1.ModifyPushConfigRequest = (function() { + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; - /** - * Properties of a ModifyPushConfigRequest. - * @memberof google.pubsub.v1 - * @interface IModifyPushConfigRequest - * @property {string|null} [subscription] ModifyPushConfigRequest subscription - * @property {google.pubsub.v1.IPushConfig|null} [pushConfig] ModifyPushConfigRequest pushConfig - */ + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; - /** - * Constructs a new ModifyPushConfigRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ModifyPushConfigRequest. - * @implements IModifyPushConfigRequest - * @constructor - * @param {google.pubsub.v1.IModifyPushConfigRequest=} [properties] Properties to set - */ - function ModifyPushConfigRequest(properties) { - if (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 defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; - /** - * ModifyPushConfigRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @instance - */ - ModifyPushConfigRequest.prototype.subscription = ""; + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; - /** - * ModifyPushConfigRequest pushConfig. - * @member {google.pubsub.v1.IPushConfig|null|undefined} pushConfig - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @instance - */ - ModifyPushConfigRequest.prototype.pushConfig = null; + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; - /** - * Creates a new ModifyPushConfigRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @static - * @param {google.pubsub.v1.IModifyPushConfigRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest instance - */ - ModifyPushConfigRequest.create = function create(properties) { - return new ModifyPushConfigRequest(properties); - }; + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; - /** - * Encodes the specified ModifyPushConfigRequest message. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @static - * @param {google.pubsub.v1.IModifyPushConfigRequest} message ModifyPushConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModifyPushConfigRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && message.hasOwnProperty("subscription")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); - if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) - $root.google.pubsub.v1.PushConfig.encode(message.pushConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && message.hasOwnProperty("extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && message.hasOwnProperty("label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && message.hasOwnProperty("typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + return writer; + }; - /** - * Encodes the specified ModifyPushConfigRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @static - * @param {google.pubsub.v1.IModifyPushConfigRequest} message ModifyPushConfigRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModifyPushConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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 ModifyPushConfigRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModifyPushConfigRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ModifyPushConfigRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.subscription = reader.string(); - break; - case 2: - message.pushConfig = $root.google.pubsub.v1.PushConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32(); + break; + case 5: + message.type = reader.int32(); + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a ModifyPushConfigRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModifyPushConfigRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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 ModifyPushConfigRequest message. - * @function verify - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ModifyPushConfigRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string expected"; - if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) { - var error = $root.google.pubsub.v1.PushConfig.verify(message.pushConfig); - if (error) - return "pushConfig." + error; + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; } - return null; - }; - - /** - * Creates a ModifyPushConfigRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest - */ - ModifyPushConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ModifyPushConfigRequest) - return object; - var message = new $root.google.pubsub.v1.ModifyPushConfigRequest(); - if (object.subscription != null) - message.subscription = String(object.subscription); - if (object.pushConfig != null) { - if (typeof object.pushConfig !== "object") - throw TypeError(".google.pubsub.v1.ModifyPushConfigRequest.pushConfig: object expected"); - message.pushConfig = $root.google.pubsub.v1.PushConfig.fromObject(object.pushConfig); + 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; } - return message; - }; + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; - /** - * Creates a plain object from a ModifyPushConfigRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @static - * @param {google.pubsub.v1.ModifyPushConfigRequest} message ModifyPushConfigRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ModifyPushConfigRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.subscription = ""; - object.pushConfig = null; - } - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) - object.pushConfig = $root.google.pubsub.v1.PushConfig.toObject(message.pushConfig, options); + /** + * 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; - }; - - /** - * Converts this ModifyPushConfigRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ModifyPushConfigRequest - * @instance - * @returns {Object.} JSON object - */ - ModifyPushConfigRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ModifyPushConfigRequest; - })(); - - v1.PullRequest = (function() { - - /** - * Properties of a PullRequest. - * @memberof google.pubsub.v1 - * @interface IPullRequest - * @property {string|null} [subscription] PullRequest subscription - * @property {boolean|null} [returnImmediately] PullRequest returnImmediately - * @property {number|null} [maxMessages] PullRequest maxMessages - */ - - /** - * Constructs a new PullRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a PullRequest. - * @implements IPullRequest - * @constructor - * @param {google.pubsub.v1.IPullRequest=} [properties] Properties to set - */ - function PullRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; } + switch (object.type) { + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + return message; + }; - /** - * PullRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.PullRequest - * @instance - */ - PullRequest.prototype.subscription = ""; - - /** - * PullRequest returnImmediately. - * @member {boolean} returnImmediately - * @memberof google.pubsub.v1.PullRequest - * @instance - */ - PullRequest.prototype.returnImmediately = false; - - /** - * PullRequest maxMessages. - * @member {number} maxMessages - * @memberof google.pubsub.v1.PullRequest - * @instance - */ - PullRequest.prototype.maxMessages = 0; - - /** - * Creates a new PullRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.PullRequest - * @static - * @param {google.pubsub.v1.IPullRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.PullRequest} PullRequest instance - */ - PullRequest.create = function create(properties) { - return new PullRequest(properties); - }; - - /** - * Encodes the specified PullRequest message. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.PullRequest - * @static - * @param {google.pubsub.v1.IPullRequest} message PullRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PullRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && message.hasOwnProperty("subscription")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); - if (message.returnImmediately != null && message.hasOwnProperty("returnImmediately")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.returnImmediately); - if (message.maxMessages != null && message.hasOwnProperty("maxMessages")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxMessages); - return writer; - }; - - /** - * Encodes the specified PullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.PullRequest - * @static - * @param {google.pubsub.v1.IPullRequest} message PullRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PullRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + return object; + }; - /** - * Decodes a PullRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.PullRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.PullRequest} PullRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PullRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PullRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.subscription = reader.string(); - break; - case 2: - message.returnImmediately = reader.bool(); - break; - case 3: - message.maxMessages = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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); + }; - /** - * Decodes a PullRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.PullRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.PullRequest} PullRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PullRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {string} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); - /** - * Verifies a PullRequest message. - * @function verify - * @memberof google.pubsub.v1.PullRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PullRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string expected"; - if (message.returnImmediately != null && message.hasOwnProperty("returnImmediately")) - if (typeof message.returnImmediately !== "boolean") - return "returnImmediately: boolean expected"; - if (message.maxMessages != null && message.hasOwnProperty("maxMessages")) - if (!$util.isInteger(message.maxMessages)) - return "maxMessages: integer expected"; - return null; - }; + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {string} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); - /** - * Creates a PullRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.PullRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.PullRequest} PullRequest - */ - PullRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.PullRequest) - return object; - var message = new $root.google.pubsub.v1.PullRequest(); - if (object.subscription != null) - message.subscription = String(object.subscription); - if (object.returnImmediately != null) - message.returnImmediately = Boolean(object.returnImmediately); - if (object.maxMessages != null) - message.maxMessages = object.maxMessages | 0; - return message; - }; + return FieldDescriptorProto; + })(); - /** - * Creates a plain object from a PullRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.PullRequest - * @static - * @param {google.pubsub.v1.PullRequest} message PullRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PullRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.subscription = ""; - object.returnImmediately = false; - object.maxMessages = 0; - } - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - if (message.returnImmediately != null && message.hasOwnProperty("returnImmediately")) - object.returnImmediately = message.returnImmediately; - if (message.maxMessages != null && message.hasOwnProperty("maxMessages")) - object.maxMessages = message.maxMessages; - return object; - }; + protobuf.OneofDescriptorProto = (function() { - /** - * Converts this PullRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.PullRequest - * @instance - * @returns {Object.} JSON object - */ - PullRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ - return PullRequest; - })(); + /** + * 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]]; + } - v1.PullResponse = (function() { + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; - /** - * Properties of a PullResponse. - * @memberof google.pubsub.v1 - * @interface IPullResponse - * @property {Array.|null} [receivedMessages] PullResponse receivedMessages - */ + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; - /** - * Constructs a new PullResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a PullResponse. - * @implements IPullResponse - * @constructor - * @param {google.pubsub.v1.IPullResponse=} [properties] Properties to set - */ - function PullResponse(properties) { - this.receivedMessages = []; - if (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 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); + }; - /** - * PullResponse receivedMessages. - * @member {Array.} receivedMessages - * @memberof google.pubsub.v1.PullResponse - * @instance - */ - PullResponse.prototype.receivedMessages = $util.emptyArray; + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Creates a new PullResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.PullResponse - * @static - * @param {google.pubsub.v1.IPullResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.PullResponse} PullResponse instance - */ - PullResponse.create = function create(properties) { - return new PullResponse(properties); - }; + /** + * 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(); + }; - /** - * Encodes the specified PullResponse message. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.PullResponse - * @static - * @param {google.pubsub.v1.IPullResponse} message PullResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PullResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.receivedMessages != null && message.receivedMessages.length) - for (var i = 0; i < message.receivedMessages.length; ++i) - $root.google.pubsub.v1.ReceivedMessage.encode(message.receivedMessages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified PullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.PullResponse - * @static - * @param {google.pubsub.v1.IPullResponse} message PullResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PullResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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()); + }; - /** - * Decodes a PullResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.PullResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.PullResponse} PullResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PullResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PullResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.receivedMessages && message.receivedMessages.length)) - message.receivedMessages = []; - message.receivedMessages.push($root.google.pubsub.v1.ReceivedMessage.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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; + }; - /** - * Decodes a PullResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.PullResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.PullResponse} PullResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PullResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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; + }; - /** - * Verifies a PullResponse message. - * @function verify - * @memberof google.pubsub.v1.PullResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PullResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.receivedMessages != null && message.hasOwnProperty("receivedMessages")) { - if (!Array.isArray(message.receivedMessages)) - return "receivedMessages: array expected"; - for (var i = 0; i < message.receivedMessages.length; ++i) { - var error = $root.google.pubsub.v1.ReceivedMessage.verify(message.receivedMessages[i]); - if (error) - return "receivedMessages." + error; - } - } - return null; - }; + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; - /** - * Creates a PullResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.PullResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.PullResponse} PullResponse - */ - PullResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.PullResponse) - return object; - var message = new $root.google.pubsub.v1.PullResponse(); - if (object.receivedMessages) { - if (!Array.isArray(object.receivedMessages)) - throw TypeError(".google.pubsub.v1.PullResponse.receivedMessages: array expected"); - message.receivedMessages = []; - for (var i = 0; i < object.receivedMessages.length; ++i) { - if (typeof object.receivedMessages[i] !== "object") - throw TypeError(".google.pubsub.v1.PullResponse.receivedMessages: object expected"); - message.receivedMessages[i] = $root.google.pubsub.v1.ReceivedMessage.fromObject(object.receivedMessages[i]); - } - } - return message; - }; + /** + * 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); + }; - /** - * Creates a plain object from a PullResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.PullResponse - * @static - * @param {google.pubsub.v1.PullResponse} message PullResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PullResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.receivedMessages = []; - if (message.receivedMessages && message.receivedMessages.length) { - object.receivedMessages = []; - for (var j = 0; j < message.receivedMessages.length; ++j) - object.receivedMessages[j] = $root.google.pubsub.v1.ReceivedMessage.toObject(message.receivedMessages[j], options); - } - return object; - }; + return OneofDescriptorProto; + })(); - /** - * Converts this PullResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.PullResponse - * @instance - * @returns {Object.} JSON object - */ - PullResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + protobuf.EnumDescriptorProto = (function() { - return PullResponse; - })(); + /** + * 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 + */ - v1.ModifyAckDeadlineRequest = (function() { + /** + * 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]]; + } - /** - * Properties of a ModifyAckDeadlineRequest. - * @memberof google.pubsub.v1 - * @interface IModifyAckDeadlineRequest - * @property {string|null} [subscription] ModifyAckDeadlineRequest subscription - * @property {Array.|null} [ackIds] ModifyAckDeadlineRequest ackIds - * @property {number|null} [ackDeadlineSeconds] ModifyAckDeadlineRequest ackDeadlineSeconds - */ + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; - /** - * Constructs a new ModifyAckDeadlineRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ModifyAckDeadlineRequest. - * @implements IModifyAckDeadlineRequest - * @constructor - * @param {google.pubsub.v1.IModifyAckDeadlineRequest=} [properties] Properties to set - */ - function ModifyAckDeadlineRequest(properties) { - this.ackIds = []; - if (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 value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; - /** - * ModifyAckDeadlineRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @instance - */ - ModifyAckDeadlineRequest.prototype.subscription = ""; + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; - /** - * ModifyAckDeadlineRequest ackIds. - * @member {Array.} ackIds - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @instance - */ - ModifyAckDeadlineRequest.prototype.ackIds = $util.emptyArray; + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - /** - * ModifyAckDeadlineRequest ackDeadlineSeconds. - * @member {number} ackDeadlineSeconds - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @instance - */ - ModifyAckDeadlineRequest.prototype.ackDeadlineSeconds = 0; + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - /** - * Creates a new ModifyAckDeadlineRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @static - * @param {google.pubsub.v1.IModifyAckDeadlineRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest instance - */ - ModifyAckDeadlineRequest.create = function create(properties) { - return new ModifyAckDeadlineRequest(properties); - }; + /** + * 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 ModifyAckDeadlineRequest message. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @static - * @param {google.pubsub.v1.IModifyAckDeadlineRequest} message ModifyAckDeadlineRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModifyAckDeadlineRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && message.hasOwnProperty("subscription")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); - if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ackDeadlineSeconds); - if (message.ackIds != null && message.ackIds.length) - for (var i = 0; i < message.ackIds.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ackIds[i]); - return writer; - }; + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; - /** - * Encodes the specified ModifyAckDeadlineRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @static - * @param {google.pubsub.v1.IModifyAckDeadlineRequest} message ModifyAckDeadlineRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModifyAckDeadlineRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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 a ModifyAckDeadlineRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModifyAckDeadlineRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ModifyAckDeadlineRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.subscription = reader.string(); - break; - case 4: - if (!(message.ackIds && message.ackIds.length)) - message.ackIds = []; - message.ackIds.push(reader.string()); - break; - case 3: - message.ackDeadlineSeconds = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModifyAckDeadlineRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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 a ModifyAckDeadlineRequest message. - * @function verify - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ModifyAckDeadlineRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string expected"; - if (message.ackIds != null && message.hasOwnProperty("ackIds")) { - if (!Array.isArray(message.ackIds)) - return "ackIds: array expected"; - for (var i = 0; i < message.ackIds.length; ++i) - if (!$util.isString(message.ackIds[i])) - return "ackIds: string[] expected"; + /** + * 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.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) - if (!$util.isInteger(message.ackDeadlineSeconds)) - return "ackDeadlineSeconds: integer expected"; - return null; - }; - - /** - * Creates a ModifyAckDeadlineRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest - */ - ModifyAckDeadlineRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ModifyAckDeadlineRequest) - return object; - var message = new $root.google.pubsub.v1.ModifyAckDeadlineRequest(); - if (object.subscription != null) - message.subscription = String(object.subscription); - if (object.ackIds) { - if (!Array.isArray(object.ackIds)) - throw TypeError(".google.pubsub.v1.ModifyAckDeadlineRequest.ackIds: array expected"); - message.ackIds = []; - for (var i = 0; i < object.ackIds.length; ++i) - message.ackIds[i] = String(object.ackIds[i]); + } + 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 (object.ackDeadlineSeconds != null) - message.ackDeadlineSeconds = object.ackDeadlineSeconds | 0; - return message; - }; + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; - /** - * Creates a plain object from a ModifyAckDeadlineRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @static - * @param {google.pubsub.v1.ModifyAckDeadlineRequest} message ModifyAckDeadlineRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ModifyAckDeadlineRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ackIds = []; - if (options.defaults) { - object.subscription = ""; - object.ackDeadlineSeconds = 0; + /** + * 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 (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) - object.ackDeadlineSeconds = message.ackDeadlineSeconds; - if (message.ackIds && message.ackIds.length) { - object.ackIds = []; - for (var j = 0; j < message.ackIds.length; ++j) - object.ackIds[j] = message.ackIds[j]; + } + 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]); } - return object; - }; + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; - /** - * Converts this ModifyAckDeadlineRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ModifyAckDeadlineRequest - * @instance - * @returns {Object.} JSON object - */ - ModifyAckDeadlineRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; - return ModifyAckDeadlineRequest; - })(); + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - v1.AcknowledgeRequest = (function() { + EnumDescriptorProto.EnumReservedRange = (function() { /** - * Properties of an AcknowledgeRequest. - * @memberof google.pubsub.v1 - * @interface IAcknowledgeRequest - * @property {string|null} [subscription] AcknowledgeRequest subscription - * @property {Array.|null} [ackIds] AcknowledgeRequest ackIds + * 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 AcknowledgeRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents an AcknowledgeRequest. - * @implements IAcknowledgeRequest + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange * @constructor - * @param {google.pubsub.v1.IAcknowledgeRequest=} [properties] Properties to set + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set */ - function AcknowledgeRequest(properties) { - this.ackIds = []; + function EnumReservedRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7665,91 +7511,88 @@ } /** - * AcknowledgeRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.AcknowledgeRequest + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance */ - AcknowledgeRequest.prototype.subscription = ""; + EnumReservedRange.prototype.start = 0; /** - * AcknowledgeRequest ackIds. - * @member {Array.} ackIds - * @memberof google.pubsub.v1.AcknowledgeRequest + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance */ - AcknowledgeRequest.prototype.ackIds = $util.emptyArray; + EnumReservedRange.prototype.end = 0; /** - * Creates a new AcknowledgeRequest instance using the specified properties. + * Creates a new EnumReservedRange instance using the specified properties. * @function create - * @memberof google.pubsub.v1.AcknowledgeRequest + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static - * @param {google.pubsub.v1.IAcknowledgeRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest instance + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance */ - AcknowledgeRequest.create = function create(properties) { - return new AcknowledgeRequest(properties); + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); }; /** - * Encodes the specified AcknowledgeRequest message. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. * @function encode - * @memberof google.pubsub.v1.AcknowledgeRequest + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static - * @param {google.pubsub.v1.IAcknowledgeRequest} message AcknowledgeRequest message or plain object to encode + * @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 */ - AcknowledgeRequest.encode = function encode(message, writer) { + EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.subscription != null && message.hasOwnProperty("subscription")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); - if (message.ackIds != null && message.ackIds.length) - for (var i = 0; i < message.ackIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ackIds[i]); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; /** - * Encodes the specified AcknowledgeRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. * @function encodeDelimited - * @memberof google.pubsub.v1.AcknowledgeRequest + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static - * @param {google.pubsub.v1.IAcknowledgeRequest} message AcknowledgeRequest message or plain object to encode + * @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 */ - AcknowledgeRequest.encodeDelimited = function encodeDelimited(message, writer) { + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AcknowledgeRequest message from the specified reader or buffer. + * Decodes an EnumReservedRange message from the specified reader or buffer. * @function decode - * @memberof google.pubsub.v1.AcknowledgeRequest + * @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.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest + * @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 */ - AcknowledgeRequest.decode = function decode(reader, length) { + EnumReservedRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.AcknowledgeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.subscription = reader.string(); + message.start = reader.int32(); break; case 2: - if (!(message.ackIds && message.ackIds.length)) - message.ackIds = []; - message.ackIds.push(reader.string()); + message.end = reader.int32(); break; default: reader.skipType(tag & 7); @@ -7760,2723 +7603,3465 @@ }; /** - * Decodes an AcknowledgeRequest message from the specified reader or buffer, length delimited. + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.pubsub.v1.AcknowledgeRequest + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest + * @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 */ - AcknowledgeRequest.decodeDelimited = function decodeDelimited(reader) { + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AcknowledgeRequest message. + * Verifies an EnumReservedRange message. * @function verify - * @memberof google.pubsub.v1.AcknowledgeRequest + * @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 */ - AcknowledgeRequest.verify = function verify(message) { + EnumReservedRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string expected"; - if (message.ackIds != null && message.hasOwnProperty("ackIds")) { - if (!Array.isArray(message.ackIds)) - return "ackIds: array expected"; - for (var i = 0; i < message.ackIds.length; ++i) - if (!$util.isString(message.ackIds[i])) - return "ackIds: string[] 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 AcknowledgeRequest message from a plain object. Also converts values to their respective internal types. + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.pubsub.v1.AcknowledgeRequest + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {Object.} object Plain object - * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange */ - AcknowledgeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.AcknowledgeRequest) + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) return object; - var message = new $root.google.pubsub.v1.AcknowledgeRequest(); - if (object.subscription != null) - message.subscription = String(object.subscription); - if (object.ackIds) { - if (!Array.isArray(object.ackIds)) - throw TypeError(".google.pubsub.v1.AcknowledgeRequest.ackIds: array expected"); - message.ackIds = []; - for (var i = 0; i < object.ackIds.length; ++i) - message.ackIds[i] = String(object.ackIds[i]); - } + 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 AcknowledgeRequest message. Also converts values to other types if specified. + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. * @function toObject - * @memberof google.pubsub.v1.AcknowledgeRequest + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static - * @param {google.pubsub.v1.AcknowledgeRequest} message AcknowledgeRequest + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AcknowledgeRequest.toObject = function toObject(message, options) { + EnumReservedRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.ackIds = []; - if (options.defaults) - object.subscription = ""; - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - if (message.ackIds && message.ackIds.length) { - object.ackIds = []; - for (var j = 0; j < message.ackIds.length; ++j) - object.ackIds[j] = message.ackIds[j]; + 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 AcknowledgeRequest to JSON. + * Converts this EnumReservedRange to JSON. * @function toJSON - * @memberof google.pubsub.v1.AcknowledgeRequest + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance * @returns {Object.} JSON object */ - AcknowledgeRequest.prototype.toJSON = function toJSON() { + EnumReservedRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AcknowledgeRequest; + return EnumReservedRange; })(); - v1.StreamingPullRequest = (function() { + return EnumDescriptorProto; + })(); - /** - * Properties of a StreamingPullRequest. - * @memberof google.pubsub.v1 - * @interface IStreamingPullRequest - * @property {string|null} [subscription] StreamingPullRequest subscription - * @property {Array.|null} [ackIds] StreamingPullRequest ackIds - * @property {Array.|null} [modifyDeadlineSeconds] StreamingPullRequest modifyDeadlineSeconds - * @property {Array.|null} [modifyDeadlineAckIds] StreamingPullRequest modifyDeadlineAckIds - * @property {number|null} [streamAckDeadlineSeconds] StreamingPullRequest streamAckDeadlineSeconds - * @property {string|null} [clientId] StreamingPullRequest clientId - */ + protobuf.EnumValueDescriptorProto = (function() { - /** - * Constructs a new StreamingPullRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a StreamingPullRequest. - * @implements IStreamingPullRequest - * @constructor - * @param {google.pubsub.v1.IStreamingPullRequest=} [properties] Properties to set - */ - function StreamingPullRequest(properties) { - this.ackIds = []; - this.modifyDeadlineSeconds = []; - this.modifyDeadlineAckIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an 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 + */ - /** - * StreamingPullRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.StreamingPullRequest - * @instance - */ - StreamingPullRequest.prototype.subscription = ""; + /** + * 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]]; + } - /** - * StreamingPullRequest ackIds. - * @member {Array.} ackIds - * @memberof google.pubsub.v1.StreamingPullRequest - * @instance - */ - StreamingPullRequest.prototype.ackIds = $util.emptyArray; + /** + * 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * StreamingPullRequest modifyDeadlineSeconds. - * @member {Array.} modifyDeadlineSeconds - * @memberof google.pubsub.v1.StreamingPullRequest - * @instance - */ - StreamingPullRequest.prototype.modifyDeadlineSeconds = $util.emptyArray; + /** + * 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()); + }; - /** - * StreamingPullRequest modifyDeadlineAckIds. - * @member {Array.} modifyDeadlineAckIds - * @memberof google.pubsub.v1.StreamingPullRequest - * @instance - */ - StreamingPullRequest.prototype.modifyDeadlineAckIds = $util.emptyArray; + /** + * 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; + }; - /** - * StreamingPullRequest streamAckDeadlineSeconds. - * @member {number} streamAckDeadlineSeconds - * @memberof google.pubsub.v1.StreamingPullRequest - * @instance - */ - StreamingPullRequest.prototype.streamAckDeadlineSeconds = 0; + /** + * 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; + }; - /** - * StreamingPullRequest clientId. - * @member {string} clientId - * @memberof google.pubsub.v1.StreamingPullRequest - * @instance - */ - StreamingPullRequest.prototype.clientId = ""; + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; - /** - * Creates a new StreamingPullRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.StreamingPullRequest - * @static - * @param {google.pubsub.v1.IStreamingPullRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest instance - */ - StreamingPullRequest.create = function create(properties) { - return new StreamingPullRequest(properties); - }; + /** + * 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); + }; - /** - * Encodes the specified StreamingPullRequest message. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.StreamingPullRequest - * @static - * @param {google.pubsub.v1.IStreamingPullRequest} message StreamingPullRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingPullRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && message.hasOwnProperty("subscription")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); - if (message.ackIds != null && message.ackIds.length) - for (var i = 0; i < message.ackIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ackIds[i]); - if (message.modifyDeadlineSeconds != null && message.modifyDeadlineSeconds.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.modifyDeadlineSeconds.length; ++i) - writer.int32(message.modifyDeadlineSeconds[i]); - writer.ldelim(); - } - if (message.modifyDeadlineAckIds != null && message.modifyDeadlineAckIds.length) - for (var i = 0; i < message.modifyDeadlineAckIds.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.modifyDeadlineAckIds[i]); - if (message.streamAckDeadlineSeconds != null && message.hasOwnProperty("streamAckDeadlineSeconds")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.streamAckDeadlineSeconds); - if (message.clientId != null && message.hasOwnProperty("clientId")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.clientId); - return writer; - }; + return EnumValueDescriptorProto; + })(); - /** - * Encodes the specified StreamingPullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.StreamingPullRequest - * @static - * @param {google.pubsub.v1.IStreamingPullRequest} message StreamingPullRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingPullRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + protobuf.ServiceDescriptorProto = (function() { - /** - * Decodes a StreamingPullRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.StreamingPullRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingPullRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.StreamingPullRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.subscription = reader.string(); - break; - case 2: - if (!(message.ackIds && message.ackIds.length)) - message.ackIds = []; - message.ackIds.push(reader.string()); - break; - case 3: - if (!(message.modifyDeadlineSeconds && message.modifyDeadlineSeconds.length)) - message.modifyDeadlineSeconds = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.modifyDeadlineSeconds.push(reader.int32()); - } else - message.modifyDeadlineSeconds.push(reader.int32()); - break; - case 4: - if (!(message.modifyDeadlineAckIds && message.modifyDeadlineAckIds.length)) - message.modifyDeadlineAckIds = []; - message.modifyDeadlineAckIds.push(reader.string()); - break; - case 5: - message.streamAckDeadlineSeconds = reader.int32(); - break; - case 6: - message.clientId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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]]; + } - /** - * Decodes a StreamingPullRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.StreamingPullRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingPullRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; - /** - * Verifies a StreamingPullRequest message. - * @function verify - * @memberof google.pubsub.v1.StreamingPullRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StreamingPullRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string expected"; - if (message.ackIds != null && message.hasOwnProperty("ackIds")) { - if (!Array.isArray(message.ackIds)) - return "ackIds: array expected"; - for (var i = 0; i < message.ackIds.length; ++i) - if (!$util.isString(message.ackIds[i])) - return "ackIds: string[] expected"; - } - if (message.modifyDeadlineSeconds != null && message.hasOwnProperty("modifyDeadlineSeconds")) { - if (!Array.isArray(message.modifyDeadlineSeconds)) - return "modifyDeadlineSeconds: array expected"; - for (var i = 0; i < message.modifyDeadlineSeconds.length; ++i) - if (!$util.isInteger(message.modifyDeadlineSeconds[i])) - return "modifyDeadlineSeconds: integer[] expected"; - } - if (message.modifyDeadlineAckIds != null && message.hasOwnProperty("modifyDeadlineAckIds")) { - if (!Array.isArray(message.modifyDeadlineAckIds)) - return "modifyDeadlineAckIds: array expected"; - for (var i = 0; i < message.modifyDeadlineAckIds.length; ++i) - if (!$util.isString(message.modifyDeadlineAckIds[i])) - return "modifyDeadlineAckIds: string[] expected"; - } - if (message.streamAckDeadlineSeconds != null && message.hasOwnProperty("streamAckDeadlineSeconds")) - if (!$util.isInteger(message.streamAckDeadlineSeconds)) - return "streamAckDeadlineSeconds: integer expected"; - if (message.clientId != null && message.hasOwnProperty("clientId")) - if (!$util.isString(message.clientId)) - return "clientId: string expected"; - return null; - }; + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; - /** - * Creates a StreamingPullRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.StreamingPullRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest - */ - StreamingPullRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.StreamingPullRequest) - return object; - var message = new $root.google.pubsub.v1.StreamingPullRequest(); - if (object.subscription != null) - message.subscription = String(object.subscription); - if (object.ackIds) { - if (!Array.isArray(object.ackIds)) - throw TypeError(".google.pubsub.v1.StreamingPullRequest.ackIds: array expected"); - message.ackIds = []; - for (var i = 0; i < object.ackIds.length; ++i) - message.ackIds[i] = String(object.ackIds[i]); - } - if (object.modifyDeadlineSeconds) { - if (!Array.isArray(object.modifyDeadlineSeconds)) - throw TypeError(".google.pubsub.v1.StreamingPullRequest.modifyDeadlineSeconds: array expected"); - message.modifyDeadlineSeconds = []; - for (var i = 0; i < object.modifyDeadlineSeconds.length; ++i) - message.modifyDeadlineSeconds[i] = object.modifyDeadlineSeconds[i] | 0; - } - if (object.modifyDeadlineAckIds) { - if (!Array.isArray(object.modifyDeadlineAckIds)) - throw TypeError(".google.pubsub.v1.StreamingPullRequest.modifyDeadlineAckIds: array expected"); - message.modifyDeadlineAckIds = []; - for (var i = 0; i < object.modifyDeadlineAckIds.length; ++i) - message.modifyDeadlineAckIds[i] = String(object.modifyDeadlineAckIds[i]); - } - if (object.streamAckDeadlineSeconds != null) - message.streamAckDeadlineSeconds = object.streamAckDeadlineSeconds | 0; - if (object.clientId != null) - message.clientId = String(object.clientId); - return message; - }; + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; - /** - * Creates a plain object from a StreamingPullRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.StreamingPullRequest - * @static - * @param {google.pubsub.v1.StreamingPullRequest} message StreamingPullRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StreamingPullRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ackIds = []; - object.modifyDeadlineSeconds = []; - object.modifyDeadlineAckIds = []; - } - if (options.defaults) { - object.subscription = ""; - object.streamAckDeadlineSeconds = 0; - object.clientId = ""; - } - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - if (message.ackIds && message.ackIds.length) { - object.ackIds = []; - for (var j = 0; j < message.ackIds.length; ++j) - object.ackIds[j] = message.ackIds[j]; - } - if (message.modifyDeadlineSeconds && message.modifyDeadlineSeconds.length) { - object.modifyDeadlineSeconds = []; - for (var j = 0; j < message.modifyDeadlineSeconds.length; ++j) - object.modifyDeadlineSeconds[j] = message.modifyDeadlineSeconds[j]; + /** + * 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.modifyDeadlineAckIds && message.modifyDeadlineAckIds.length) { - object.modifyDeadlineAckIds = []; - for (var j = 0; j < message.modifyDeadlineAckIds.length; ++j) - object.modifyDeadlineAckIds[j] = message.modifyDeadlineAckIds[j]; + } + 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.streamAckDeadlineSeconds != null && message.hasOwnProperty("streamAckDeadlineSeconds")) - object.streamAckDeadlineSeconds = message.streamAckDeadlineSeconds; - if (message.clientId != null && message.hasOwnProperty("clientId")) - object.clientId = message.clientId; + } + 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; + }; - /** - * Converts this StreamingPullRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.StreamingPullRequest - * @instance - * @returns {Object.} JSON object - */ - StreamingPullRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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; + }; - return StreamingPullRequest; - })(); + /** + * 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); + }; - v1.StreamingPullResponse = (function() { + return ServiceDescriptorProto; + })(); - /** - * Properties of a StreamingPullResponse. - * @memberof google.pubsub.v1 - * @interface IStreamingPullResponse - * @property {Array.|null} [receivedMessages] StreamingPullResponse receivedMessages - */ + protobuf.MethodDescriptorProto = (function() { - /** - * Constructs a new StreamingPullResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a StreamingPullResponse. - * @implements IStreamingPullResponse - * @constructor - * @param {google.pubsub.v1.IStreamingPullResponse=} [properties] Properties to set - */ - function StreamingPullResponse(properties) { - this.receivedMessages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a 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 + */ - /** - * StreamingPullResponse receivedMessages. - * @member {Array.} receivedMessages - * @memberof google.pubsub.v1.StreamingPullResponse - * @instance - */ - StreamingPullResponse.prototype.receivedMessages = $util.emptyArray; + /** + * 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]]; + } - /** - * Creates a new StreamingPullResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.StreamingPullResponse - * @static - * @param {google.pubsub.v1.IStreamingPullResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse instance - */ - StreamingPullResponse.create = function create(properties) { - return new StreamingPullResponse(properties); - }; + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; - /** - * Encodes the specified StreamingPullResponse message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.StreamingPullResponse - * @static - * @param {google.pubsub.v1.IStreamingPullResponse} message StreamingPullResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingPullResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.receivedMessages != null && message.receivedMessages.length) - for (var i = 0; i < message.receivedMessages.length; ++i) - $root.google.pubsub.v1.ReceivedMessage.encode(message.receivedMessages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * 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; - /** - * Encodes the specified StreamingPullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.StreamingPullResponse - * @static - * @param {google.pubsub.v1.IStreamingPullResponse} message StreamingPullResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingPullResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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); + }; - /** - * Decodes a StreamingPullResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.StreamingPullResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingPullResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.StreamingPullResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.receivedMessages && message.receivedMessages.length)) - message.receivedMessages = []; - message.receivedMessages.push($root.google.pubsub.v1.ReceivedMessage.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && message.hasOwnProperty("inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && message.hasOwnProperty("outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; - /** - * Decodes a StreamingPullResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.StreamingPullResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingPullResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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(); + }; - /** - * Verifies a StreamingPullResponse message. - * @function verify - * @memberof google.pubsub.v1.StreamingPullResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StreamingPullResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.receivedMessages != null && message.hasOwnProperty("receivedMessages")) { - if (!Array.isArray(message.receivedMessages)) - return "receivedMessages: array expected"; - for (var i = 0; i < message.receivedMessages.length; ++i) { - var error = $root.google.pubsub.v1.ReceivedMessage.verify(message.receivedMessages[i]); - if (error) - return "receivedMessages." + error; - } + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; } - return null; - }; + } + return message; + }; - /** - * Creates a StreamingPullResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.StreamingPullResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse - */ - StreamingPullResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.StreamingPullResponse) - return object; - var message = new $root.google.pubsub.v1.StreamingPullResponse(); - if (object.receivedMessages) { - if (!Array.isArray(object.receivedMessages)) - throw TypeError(".google.pubsub.v1.StreamingPullResponse.receivedMessages: array expected"); - message.receivedMessages = []; - for (var i = 0; i < object.receivedMessages.length; ++i) { - if (typeof object.receivedMessages[i] !== "object") - throw TypeError(".google.pubsub.v1.StreamingPullResponse.receivedMessages: object expected"); - message.receivedMessages[i] = $root.google.pubsub.v1.ReceivedMessage.fromObject(object.receivedMessages[i]); - } - } - 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()); + }; - /** - * Creates a plain object from a StreamingPullResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.StreamingPullResponse - * @static - * @param {google.pubsub.v1.StreamingPullResponse} message StreamingPullResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StreamingPullResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.receivedMessages = []; - if (message.receivedMessages && message.receivedMessages.length) { - object.receivedMessages = []; - for (var j = 0; j < message.receivedMessages.length; ++j) - object.receivedMessages[j] = $root.google.pubsub.v1.ReceivedMessage.toObject(message.receivedMessages[j], options); - } + /** + * 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; + }; - /** - * Converts this StreamingPullResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.StreamingPullResponse - * @instance - * @returns {Object.} JSON object - */ - StreamingPullResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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; + }; - return StreamingPullResponse; - })(); + /** + * 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); + }; - v1.CreateSnapshotRequest = (function() { + return MethodDescriptorProto; + })(); - /** - * Properties of a CreateSnapshotRequest. - * @memberof google.pubsub.v1 - * @interface ICreateSnapshotRequest - * @property {string|null} [name] CreateSnapshotRequest name - * @property {string|null} [subscription] CreateSnapshotRequest subscription - * @property {Object.|null} [labels] CreateSnapshotRequest labels - */ + protobuf.FileOptions = (function() { - /** - * Constructs a new CreateSnapshotRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a CreateSnapshotRequest. - * @implements ICreateSnapshotRequest - * @constructor - * @param {google.pubsub.v1.ICreateSnapshotRequest=} [properties] Properties to set - */ - function CreateSnapshotRequest(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]]; - } + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ - /** - * CreateSnapshotRequest name. - * @member {string} name - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @instance - */ - CreateSnapshotRequest.prototype.name = ""; + /** + * 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]]; + } - /** - * CreateSnapshotRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @instance - */ - CreateSnapshotRequest.prototype.subscription = ""; + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; - /** - * CreateSnapshotRequest labels. - * @member {Object.} labels - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @instance - */ - CreateSnapshotRequest.prototype.labels = $util.emptyObject; + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; - /** - * Creates a new CreateSnapshotRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @static - * @param {google.pubsub.v1.ICreateSnapshotRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest instance - */ - CreateSnapshotRequest.create = function create(properties) { - return new CreateSnapshotRequest(properties); - }; + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; - /** - * Encodes the specified CreateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @static - * @param {google.pubsub.v1.ICreateSnapshotRequest} message CreateSnapshotRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSnapshotRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.subscription != null && message.hasOwnProperty("subscription")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subscription); - if (message.labels != null && message.hasOwnProperty("labels")) - for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); - return writer; - }; + /** + * 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; - /** - * Encodes the specified CreateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @static - * @param {google.pubsub.v1.ICreateSnapshotRequest} message CreateSnapshotRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; - /** - * Decodes a CreateSnapshotRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSnapshotRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.CreateSnapshotRequest(), key; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.subscription = reader.string(); - break; - case 3: - reader.skip().pos++; - if (message.labels === $util.emptyObject) - message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; - /** - * Decodes a CreateSnapshotRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; - /** - * Verifies a CreateSnapshotRequest message. - * @function verify - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSnapshotRequest.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.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: 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; - }; + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; - /** - * Creates a CreateSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest - */ - CreateSnapshotRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.CreateSnapshotRequest) - return object; - var message = new $root.google.pubsub.v1.CreateSnapshotRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.subscription != null) - message.subscription = String(object.subscription); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.pubsub.v1.CreateSnapshotRequest.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; - }; + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; - /** - * Creates a plain object from a CreateSnapshotRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @static - * @param {google.pubsub.v1.CreateSnapshotRequest} message CreateSnapshotRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSnapshotRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.subscription = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - 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; - }; + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; - /** - * Converts this CreateSnapshotRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.CreateSnapshotRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSnapshotRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = false; - return CreateSnapshotRequest; - })(); + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; - v1.UpdateSnapshotRequest = (function() { + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; - /** - * Properties of an UpdateSnapshotRequest. - * @memberof google.pubsub.v1 - * @interface IUpdateSnapshotRequest - * @property {google.pubsub.v1.ISnapshot|null} [snapshot] UpdateSnapshotRequest snapshot - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSnapshotRequest updateMask - */ + /** + * 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 = ""; - /** - * Constructs a new UpdateSnapshotRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents an UpdateSnapshotRequest. - * @implements IUpdateSnapshotRequest - * @constructor - * @param {google.pubsub.v1.IUpdateSnapshotRequest=} [properties] Properties to set - */ - function UpdateSnapshotRequest(properties) { - if (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 phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; - /** - * UpdateSnapshotRequest snapshot. - * @member {google.pubsub.v1.ISnapshot|null|undefined} snapshot - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @instance - */ - UpdateSnapshotRequest.prototype.snapshot = null; + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; - /** - * UpdateSnapshotRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @instance - */ - UpdateSnapshotRequest.prototype.updateMask = null; + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Creates a new UpdateSnapshotRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @static - * @param {google.pubsub.v1.IUpdateSnapshotRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest instance - */ - UpdateSnapshotRequest.create = function create(properties) { - return new UpdateSnapshotRequest(properties); - }; + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - /** - * Encodes the specified UpdateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @static - * @param {google.pubsub.v1.IUpdateSnapshotRequest} message UpdateSnapshotRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSnapshotRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.snapshot != null && message.hasOwnProperty("snapshot")) - $root.google.pubsub.v1.Snapshot.encode(message.snapshot, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * 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 UpdateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @static - * @param {google.pubsub.v1.IUpdateSnapshotRequest} message UpdateSnapshotRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; - /** - * Decodes an UpdateSnapshotRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSnapshotRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.UpdateSnapshotRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.snapshot = $root.google.pubsub.v1.Snapshot.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32(); + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1053: + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes an UpdateSnapshotRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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 an UpdateSnapshotRequest message. - * @function verify - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateSnapshotRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.snapshot != null && message.hasOwnProperty("snapshot")) { - var error = $root.google.pubsub.v1.Snapshot.verify(message.snapshot); + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) - return "snapshot." + error; + return "uninterpretedOption." + error; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + } + 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 "updateMask." + error; + return ".google.api.resourceDefinition." + error; } - return null; - }; + } + return null; + }; - /** - * Creates an UpdateSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest - */ - UpdateSnapshotRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.UpdateSnapshotRequest) - return object; - var message = new $root.google.pubsub.v1.UpdateSnapshotRequest(); - if (object.snapshot != null) { - if (typeof object.snapshot !== "object") - throw TypeError(".google.pubsub.v1.UpdateSnapshotRequest.snapshot: object expected"); - message.snapshot = $root.google.pubsub.v1.Snapshot.fromObject(object.snapshot); + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.pubsub.v1.UpdateSnapshotRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + 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; - }; + } + return message; + }; - /** - * Creates a plain object from an UpdateSnapshotRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @static - * @param {google.pubsub.v1.UpdateSnapshotRequest} message UpdateSnapshotRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateSnapshotRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.snapshot = null; - object.updateMask = null; - } - if (message.snapshot != null && message.hasOwnProperty("snapshot")) - object.snapshot = $root.google.pubsub.v1.Snapshot.toObject(message.snapshot, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = false; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; - /** - * Converts this UpdateSnapshotRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.UpdateSnapshotRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateSnapshotRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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); + }; - return UpdateSnapshotRequest; + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {string} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; })(); - v1.Snapshot = (function() { - - /** - * Properties of a Snapshot. - * @memberof google.pubsub.v1 - * @interface ISnapshot - * @property {string|null} [name] Snapshot name - * @property {string|null} [topic] Snapshot topic - * @property {google.protobuf.ITimestamp|null} [expireTime] Snapshot expireTime - * @property {Object.|null} [labels] Snapshot labels - */ - - /** - * Constructs a new Snapshot. - * @memberof google.pubsub.v1 - * @classdesc Represents a Snapshot. - * @implements ISnapshot - * @constructor - * @param {google.pubsub.v1.ISnapshot=} [properties] Properties to set - */ - function Snapshot(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]]; - } + return FileOptions; + })(); - /** - * Snapshot name. - * @member {string} name - * @memberof google.pubsub.v1.Snapshot - * @instance - */ - Snapshot.prototype.name = ""; + protobuf.MessageOptions = (function() { - /** - * Snapshot topic. - * @member {string} topic - * @memberof google.pubsub.v1.Snapshot - * @instance - */ - Snapshot.prototype.topic = ""; + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ - /** - * Snapshot expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.pubsub.v1.Snapshot - * @instance - */ - Snapshot.prototype.expireTime = null; + /** + * 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]]; + } - /** - * Snapshot labels. - * @member {Object.} labels - * @memberof google.pubsub.v1.Snapshot - * @instance - */ - Snapshot.prototype.labels = $util.emptyObject; + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; - /** - * Creates a new Snapshot instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.Snapshot - * @static - * @param {google.pubsub.v1.ISnapshot=} [properties] Properties to set - * @returns {google.pubsub.v1.Snapshot} Snapshot instance - */ - Snapshot.create = function create(properties) { - return new Snapshot(properties); - }; + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; - /** - * Encodes the specified Snapshot message. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.Snapshot - * @static - * @param {google.pubsub.v1.ISnapshot} message Snapshot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Snapshot.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.topic != null && message.hasOwnProperty("topic")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.topic); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.labels != null && message.hasOwnProperty("labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - return writer; - }; + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; - /** - * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.Snapshot - * @static - * @param {google.pubsub.v1.ISnapshot} message Snapshot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Snapshot.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; - /** - * Decodes a Snapshot message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.Snapshot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.Snapshot} Snapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Snapshot.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.Snapshot(), key; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.topic = reader.string(); - break; - case 3: - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 4: - reader.skip().pos++; - if (message.labels === $util.emptyObject) - message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Decodes a Snapshot message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.Snapshot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.Snapshot} Snapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Snapshot.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; - /** - * Verifies a Snapshot message. - * @function verify - * @memberof google.pubsub.v1.Snapshot - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Snapshot.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.topic != null && message.hasOwnProperty("topic")) - if (!$util.isString(message.topic)) - return "topic: string expected"; - 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"; - } - return 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); + }; - /** - * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.Snapshot - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.Snapshot} Snapshot - */ - Snapshot.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.Snapshot) - return object; - var message = new $root.google.pubsub.v1.Snapshot(); - if (object.name != null) - message.name = String(object.name); - if (object.topic != null) - message.topic = String(object.topic); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.pubsub.v1.Snapshot.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.pubsub.v1.Snapshot.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; - }; + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; - /** - * Creates a plain object from a Snapshot message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.Snapshot - * @static - * @param {google.pubsub.v1.Snapshot} message Snapshot - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Snapshot.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.topic = ""; - object.expireTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.topic != null && message.hasOwnProperty("topic")) - object.topic = message.topic; - 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]]; - } - return object; - }; + /** + * 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(); + }; - /** - * Converts this Snapshot to JSON. - * @function toJSON - * @memberof google.pubsub.v1.Snapshot - * @instance - * @returns {Object.} JSON object - */ - Snapshot.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1053: + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - return Snapshot; - })(); + /** + * 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()); + }; - v1.GetSnapshotRequest = (function() { + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; - /** - * Properties of a GetSnapshotRequest. - * @memberof google.pubsub.v1 - * @interface IGetSnapshotRequest - * @property {string|null} [snapshot] GetSnapshotRequest snapshot - */ + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; - /** - * Constructs a new GetSnapshotRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a GetSnapshotRequest. - * @implements IGetSnapshotRequest - * @constructor - * @param {google.pubsub.v1.IGetSnapshotRequest=} [properties] Properties to set - */ - function GetSnapshotRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; - /** - * GetSnapshotRequest snapshot. - * @member {string} snapshot - * @memberof google.pubsub.v1.GetSnapshotRequest - * @instance - */ - GetSnapshotRequest.prototype.snapshot = ""; - - /** - * Creates a new GetSnapshotRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.GetSnapshotRequest - * @static - * @param {google.pubsub.v1.IGetSnapshotRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest instance - */ - GetSnapshotRequest.create = function create(properties) { - return new GetSnapshotRequest(properties); - }; + /** + * 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); + }; - /** - * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.GetSnapshotRequest - * @static - * @param {google.pubsub.v1.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSnapshotRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.snapshot != null && message.hasOwnProperty("snapshot")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshot); - return writer; - }; + return MessageOptions; + })(); - /** - * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.GetSnapshotRequest - * @static - * @param {google.pubsub.v1.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + protobuf.FieldOptions = (function() { - /** - * Decodes a GetSnapshotRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.GetSnapshotRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSnapshotRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.GetSnapshotRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.snapshot = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ - /** - * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.GetSnapshotRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Verifies a GetSnapshotRequest message. - * @function verify - * @memberof google.pubsub.v1.GetSnapshotRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetSnapshotRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.snapshot != null && message.hasOwnProperty("snapshot")) - if (!$util.isString(message.snapshot)) - return "snapshot: string expected"; - return null; - }; + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; - /** - * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.GetSnapshotRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest - */ - GetSnapshotRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.GetSnapshotRequest) - return object; - var message = new $root.google.pubsub.v1.GetSnapshotRequest(); - if (object.snapshot != null) - message.snapshot = String(object.snapshot); - return message; - }; + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; - /** - * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.GetSnapshotRequest - * @static - * @param {google.pubsub.v1.GetSnapshotRequest} message GetSnapshotRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetSnapshotRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.snapshot = ""; - if (message.snapshot != null && message.hasOwnProperty("snapshot")) - object.snapshot = message.snapshot; - return object; - }; + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; - /** - * Converts this GetSnapshotRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.GetSnapshotRequest - * @instance - * @returns {Object.} JSON object - */ - GetSnapshotRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; - return GetSnapshotRequest; - })(); + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; - v1.ListSnapshotsRequest = (function() { + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; - /** - * Properties of a ListSnapshotsRequest. - * @memberof google.pubsub.v1 - * @interface IListSnapshotsRequest - * @property {string|null} [project] ListSnapshotsRequest project - * @property {number|null} [pageSize] ListSnapshotsRequest pageSize - * @property {string|null} [pageToken] ListSnapshotsRequest pageToken - */ + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Constructs a new ListSnapshotsRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListSnapshotsRequest. - * @implements IListSnapshotsRequest - * @constructor - * @param {google.pubsub.v1.IListSnapshotsRequest=} [properties] Properties to set - */ - function ListSnapshotsRequest(properties) { - if (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 .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - /** - * ListSnapshotsRequest project. - * @member {string} project - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @instance - */ - ListSnapshotsRequest.prototype.project = ""; + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; - /** - * ListSnapshotsRequest pageSize. - * @member {number} pageSize - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @instance - */ - ListSnapshotsRequest.prototype.pageSize = 0; + /** + * 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); + }; - /** - * ListSnapshotsRequest pageToken. - * @member {string} pageToken - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @instance - */ - ListSnapshotsRequest.prototype.pageToken = ""; + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && message.hasOwnProperty("ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && message.hasOwnProperty("packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && message.hasOwnProperty("lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && message.hasOwnProperty("jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && message.hasOwnProperty("weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; - /** - * Creates a new ListSnapshotsRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @static - * @param {google.pubsub.v1.IListSnapshotsRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest instance - */ - ListSnapshotsRequest.create = function create(properties) { - return new ListSnapshotsRequest(properties); - }; + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @static - * @param {google.pubsub.v1.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSnapshotsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.project != null && message.hasOwnProperty("project")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32(); + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32(); + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1052: + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + case 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @static - * @param {google.pubsub.v1.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a ListSnapshotsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSnapshotsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSnapshotsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: case 1: - message.project = reader.string(); - break; case 2: - message.pageSize = reader.int32(); - break; case 3: - message.pageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); + case 4: + case 5: break; } - } - return message; - }; - - /** - * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSnapshotsRequest message. - * @function verify - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSnapshotsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: 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 ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest - */ - ListSnapshotsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListSnapshotsRequest) - return object; - var message = new $root.google.pubsub.v1.ListSnapshotsRequest(); - if (object.project != null) - message.project = String(object.project); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; - /** - * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @static - * @param {google.pubsub.v1.ListSnapshotsRequest} message ListSnapshotsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSnapshotsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.project = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; + /** + * 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; - }; - - /** - * Converts this ListSnapshotsRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListSnapshotsRequest - * @instance - * @returns {Object.} JSON object - */ - ListSnapshotsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ListSnapshotsRequest; - })(); - - v1.ListSnapshotsResponse = (function() { - - /** - * Properties of a ListSnapshotsResponse. - * @memberof google.pubsub.v1 - * @interface IListSnapshotsResponse - * @property {Array.|null} [snapshots] ListSnapshotsResponse snapshots - * @property {string|null} [nextPageToken] ListSnapshotsResponse nextPageToken - */ + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; - /** - * Constructs a new ListSnapshotsResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a ListSnapshotsResponse. - * @implements IListSnapshotsResponse - * @constructor - * @param {google.pubsub.v1.IListSnapshotsResponse=} [properties] Properties to set - */ - function ListSnapshotsResponse(properties) { - this.snapshots = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; - /** - * ListSnapshotsResponse snapshots. - * @member {Array.} snapshots - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @instance - */ - ListSnapshotsResponse.prototype.snapshots = $util.emptyArray; + /** + * 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); + }; - /** - * ListSnapshotsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @instance - */ - ListSnapshotsResponse.prototype.nextPageToken = ""; + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {string} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); - /** - * Creates a new ListSnapshotsResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @static - * @param {google.pubsub.v1.IListSnapshotsResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse instance - */ - ListSnapshotsResponse.create = function create(properties) { - return new ListSnapshotsResponse(properties); - }; + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {string} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); - /** - * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @static - * @param {google.pubsub.v1.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSnapshotsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.snapshots != null && message.snapshots.length) - for (var i = 0; i < message.snapshots.length; ++i) - $root.google.pubsub.v1.Snapshot.encode(message.snapshots[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; + return FieldOptions; + })(); - /** - * Encodes the specified ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @static - * @param {google.pubsub.v1.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + protobuf.OneofOptions = (function() { - /** - * Decodes a ListSnapshotsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSnapshotsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSnapshotsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.snapshots && message.snapshots.length)) - message.snapshots = []; - message.snapshots.push($root.google.pubsub.v1.Snapshot.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ - /** - * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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]]; + } - /** - * Verifies a ListSnapshotsResponse message. - * @function verify - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSnapshotsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.snapshots != null && message.hasOwnProperty("snapshots")) { - if (!Array.isArray(message.snapshots)) - return "snapshots: array expected"; - for (var i = 0; i < message.snapshots.length; ++i) { - var error = $root.google.pubsub.v1.Snapshot.verify(message.snapshots[i]); - if (error) - return "snapshots." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse - */ - ListSnapshotsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.ListSnapshotsResponse) - return object; - var message = new $root.google.pubsub.v1.ListSnapshotsResponse(); - if (object.snapshots) { - if (!Array.isArray(object.snapshots)) - throw TypeError(".google.pubsub.v1.ListSnapshotsResponse.snapshots: array expected"); - message.snapshots = []; - for (var i = 0; i < object.snapshots.length; ++i) { - if (typeof object.snapshots[i] !== "object") - throw TypeError(".google.pubsub.v1.ListSnapshotsResponse.snapshots: object expected"); - message.snapshots[i] = $root.google.pubsub.v1.Snapshot.fromObject(object.snapshots[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; + /** + * 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); + }; - /** - * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @static - * @param {google.pubsub.v1.ListSnapshotsResponse} message ListSnapshotsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSnapshotsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.snapshots = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.snapshots && message.snapshots.length) { - object.snapshots = []; - for (var j = 0; j < message.snapshots.length; ++j) - object.snapshots[j] = $root.google.pubsub.v1.Snapshot.toObject(message.snapshots[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; - /** - * Converts this ListSnapshotsResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.ListSnapshotsResponse - * @instance - * @returns {Object.} JSON object - */ - ListSnapshotsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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(); + }; - return ListSnapshotsResponse; - })(); + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - v1.DeleteSnapshotRequest = (function() { + /** + * 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()); + }; - /** - * Properties of a DeleteSnapshotRequest. - * @memberof google.pubsub.v1 - * @interface IDeleteSnapshotRequest - * @property {string|null} [snapshot] DeleteSnapshotRequest snapshot - */ + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; - /** - * Constructs a new DeleteSnapshotRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a DeleteSnapshotRequest. - * @implements IDeleteSnapshotRequest - * @constructor - * @param {google.pubsub.v1.IDeleteSnapshotRequest=} [properties] Properties to set - */ - function DeleteSnapshotRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } + return object; + }; - /** - * DeleteSnapshotRequest snapshot. - * @member {string} snapshot - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @instance - */ - DeleteSnapshotRequest.prototype.snapshot = ""; + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new DeleteSnapshotRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @static - * @param {google.pubsub.v1.IDeleteSnapshotRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest instance - */ - DeleteSnapshotRequest.create = function create(properties) { - return new DeleteSnapshotRequest(properties); - }; + return OneofOptions; + })(); - /** - * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @static - * @param {google.pubsub.v1.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSnapshotRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.snapshot != null && message.hasOwnProperty("snapshot")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshot); - return writer; - }; + protobuf.EnumOptions = (function() { - /** - * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @static - * @param {google.pubsub.v1.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ - /** - * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSnapshotRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeleteSnapshotRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.snapshot = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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]]; + } - /** - * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; - /** - * Verifies a DeleteSnapshotRequest message. - * @function verify - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteSnapshotRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.snapshot != null && message.hasOwnProperty("snapshot")) - if (!$util.isString(message.snapshot)) - return "snapshot: string expected"; - return null; - }; + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; - /** - * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest - */ - DeleteSnapshotRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.DeleteSnapshotRequest) - return object; - var message = new $root.google.pubsub.v1.DeleteSnapshotRequest(); - if (object.snapshot != null) - message.snapshot = String(object.snapshot); - return message; - }; + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @static - * @param {google.pubsub.v1.DeleteSnapshotRequest} message DeleteSnapshotRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteSnapshotRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.snapshot = ""; - if (message.snapshot != null && message.hasOwnProperty("snapshot")) - object.snapshot = message.snapshot; - return object; - }; + /** + * 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); + }; - /** - * Converts this DeleteSnapshotRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.DeleteSnapshotRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteSnapshotRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; - return DeleteSnapshotRequest; - })(); + /** + * 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(); + }; - v1.SeekRequest = (function() { + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a SeekRequest. - * @memberof google.pubsub.v1 - * @interface ISeekRequest - * @property {string|null} [subscription] SeekRequest subscription - * @property {google.protobuf.ITimestamp|null} [time] SeekRequest time - * @property {string|null} [snapshot] SeekRequest snapshot - */ + /** + * 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()); + }; - /** - * Constructs a new SeekRequest. - * @memberof google.pubsub.v1 - * @classdesc Represents a SeekRequest. - * @implements ISeekRequest - * @constructor - * @param {google.pubsub.v1.ISeekRequest=} [properties] Properties to set - */ - function SeekRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } } + return null; + }; - /** - * SeekRequest subscription. - * @member {string} subscription - * @memberof google.pubsub.v1.SeekRequest - * @instance - */ - SeekRequest.prototype.subscription = ""; + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; - /** - * SeekRequest time. - * @member {google.protobuf.ITimestamp|null|undefined} time - * @memberof google.pubsub.v1.SeekRequest - * @instance - */ - SeekRequest.prototype.time = null; + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; - /** - * SeekRequest snapshot. - * @member {string} snapshot - * @memberof google.pubsub.v1.SeekRequest - * @instance - */ - SeekRequest.prototype.snapshot = ""; + /** + * 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); + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + return EnumOptions; + })(); - /** - * SeekRequest target. - * @member {"time"|"snapshot"|undefined} target - * @memberof google.pubsub.v1.SeekRequest - * @instance - */ - Object.defineProperty(SeekRequest.prototype, "target", { - get: $util.oneOfGetter($oneOfFields = ["time", "snapshot"]), - set: $util.oneOfSetter($oneOfFields) - }); + protobuf.EnumValueOptions = (function() { - /** - * Creates a new SeekRequest instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.SeekRequest - * @static - * @param {google.pubsub.v1.ISeekRequest=} [properties] Properties to set - * @returns {google.pubsub.v1.SeekRequest} SeekRequest instance - */ - SeekRequest.create = function create(properties) { - return new SeekRequest(properties); - }; + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ - /** - * Encodes the specified SeekRequest message. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.SeekRequest - * @static - * @param {google.pubsub.v1.ISeekRequest} message SeekRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SeekRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.subscription != null && message.hasOwnProperty("subscription")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); - if (message.time != null && message.hasOwnProperty("time")) - $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.snapshot != null && message.hasOwnProperty("snapshot")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.snapshot); - return writer; - }; + /** + * 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]]; + } - /** - * Encodes the specified SeekRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.SeekRequest - * @static - * @param {google.pubsub.v1.ISeekRequest} message SeekRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SeekRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; - /** - * Decodes a SeekRequest message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.SeekRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.SeekRequest} SeekRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SeekRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.SeekRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.subscription = reader.string(); - break; - case 2: - message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.snapshot = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Decodes a SeekRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.SeekRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.SeekRequest} SeekRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SeekRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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); + }; - /** - * Verifies a SeekRequest message. - * @function verify - * @memberof google.pubsub.v1.SeekRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SeekRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.subscription != null && message.hasOwnProperty("subscription")) - if (!$util.isString(message.subscription)) - return "subscription: string expected"; - if (message.time != null && message.hasOwnProperty("time")) { - properties.target = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.time); - if (error) - return "time." + error; - } - } - if (message.snapshot != null && message.hasOwnProperty("snapshot")) { - if (properties.target === 1) - return "target: multiple values"; - properties.target = 1; - if (!$util.isString(message.snapshot)) - return "snapshot: string expected"; - } - return null; - }; + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; - /** - * Creates a SeekRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.SeekRequest - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.SeekRequest} SeekRequest - */ - SeekRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.SeekRequest) - return object; - var message = new $root.google.pubsub.v1.SeekRequest(); - if (object.subscription != null) - message.subscription = String(object.subscription); - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".google.pubsub.v1.SeekRequest.time: object expected"); - message.time = $root.google.protobuf.Timestamp.fromObject(object.time); - } - if (object.snapshot != null) - message.snapshot = String(object.snapshot); - return message; - }; + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from a SeekRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.SeekRequest - * @static - * @param {google.pubsub.v1.SeekRequest} message SeekRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SeekRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.subscription = ""; - if (message.subscription != null && message.hasOwnProperty("subscription")) - object.subscription = message.subscription; - if (message.time != null && message.hasOwnProperty("time")) { - object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); - if (options.oneofs) - object.target = "time"; + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.snapshot != null && message.hasOwnProperty("snapshot")) { - object.snapshot = message.snapshot; - if (options.oneofs) - object.target = "snapshot"; + } + 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.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.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; + }; - /** - * Converts this SeekRequest to JSON. - * @function toJSON - * @memberof google.pubsub.v1.SeekRequest - * @instance - * @returns {Object.} JSON object - */ - SeekRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; - return SeekRequest; - })(); + /** + * 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); + }; - v1.SeekResponse = (function() { + return EnumValueOptions; + })(); - /** - * Properties of a SeekResponse. - * @memberof google.pubsub.v1 - * @interface ISeekResponse - */ + protobuf.ServiceOptions = (function() { - /** - * Constructs a new SeekResponse. - * @memberof google.pubsub.v1 - * @classdesc Represents a SeekResponse. - * @implements ISeekResponse - * @constructor - * @param {google.pubsub.v1.ISeekResponse=} [properties] Properties to set - */ - function SeekResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ - /** - * Creates a new SeekResponse instance using the specified properties. - * @function create - * @memberof google.pubsub.v1.SeekResponse - * @static - * @param {google.pubsub.v1.ISeekResponse=} [properties] Properties to set - * @returns {google.pubsub.v1.SeekResponse} SeekResponse instance - */ - SeekResponse.create = function create(properties) { - return new SeekResponse(properties); - }; + /** + * 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]]; + } - /** - * Encodes the specified SeekResponse message. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. - * @function encode - * @memberof google.pubsub.v1.SeekResponse - * @static - * @param {google.pubsub.v1.ISeekResponse} message SeekResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SeekResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; - /** - * Encodes the specified SeekResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.pubsub.v1.SeekResponse - * @static - * @param {google.pubsub.v1.ISeekResponse} message SeekResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SeekResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Decodes a SeekResponse message from the specified reader or buffer. - * @function decode - * @memberof google.pubsub.v1.SeekResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.pubsub.v1.SeekResponse} SeekResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SeekResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.SeekResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; - /** - * Decodes a SeekResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.pubsub.v1.SeekResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.pubsub.v1.SeekResponse} SeekResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SeekResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; - /** - * Verifies a SeekResponse message. - * @function verify - * @memberof google.pubsub.v1.SeekResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SeekResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; - /** - * Creates a SeekResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.pubsub.v1.SeekResponse - * @static - * @param {Object.} object Plain object - * @returns {google.pubsub.v1.SeekResponse} SeekResponse - */ - SeekResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.pubsub.v1.SeekResponse) - return object; - return new $root.google.pubsub.v1.SeekResponse(); - }; + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from a SeekResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.pubsub.v1.SeekResponse - * @static - * @param {google.pubsub.v1.SeekResponse} message SeekResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SeekResponse.toObject = function toObject() { - return {}; - }; + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1049: + message[".google.api.defaultHost"] = reader.string(); + break; + case 1050: + message[".google.api.oauthScopes"] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this SeekResponse to JSON. - * @function toJSON - * @memberof google.pubsub.v1.SeekResponse - * @instance - * @returns {Object.} JSON object - */ - SeekResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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()); + }; - return SeekResponse; - })(); + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; - return v1; - })(); + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; - return pubsub; - })(); + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; - google.api = (function() { + /** + * 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); + }; - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; + return ServiceOptions; + })(); - api.Http = (function() { + protobuf.MethodOptions = (function() { /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature */ /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions * @constructor - * @param {google.api.IHttp=} [properties] Properties to set + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set */ - function Http(properties) { - this.rules = []; + 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) @@ -10484,91 +11069,133 @@ } /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions * @instance */ - Http.prototype.rules = $util.emptyArray; + MethodOptions.prototype.deprecated = false; /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions * @instance */ - Http.prototype.fullyDecodeReservedExpansion = false; + MethodOptions.prototype.idempotencyLevel = 0; /** - * Creates a new Http instance using the specified properties. + * 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; + + /** + * Creates a new MethodOptions instance using the specified properties. * @function create - * @memberof google.api.Http + * @memberof google.protobuf.MethodOptions * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance */ - Http.create = function create(properties) { - return new Http(properties); + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); }; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encode - * @memberof google.api.Http + * @memberof google.protobuf.MethodOptions * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer) { + MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); return writer; }; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Http + * @memberof google.protobuf.MethodOptions * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encodeDelimited = function encodeDelimited(message, writer) { + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a MethodOptions message from the specified reader or buffer. * @function decode - * @memberof google.api.Http + * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http + * @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 */ - Http.decode = function decode(reader, length) { + MethodOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + case 33: + message.deprecated = reader.bool(); break; - case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + case 34: + message.idempotencyLevel = reader.int32(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 72295728: + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + case 1051: + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); break; default: reader.skipType(tag & 7); @@ -10579,143 +11206,217 @@ }; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Http + * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http + * @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 */ - Http.decodeDelimited = function decodeDelimited(reader) { + MethodOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Http message. + * Verifies a MethodOptions message. * @function verify - * @memberof google.api.Http + * @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 */ - Http.verify = function verify(message) { + MethodOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) - return "rules." + error; + return "uninterpretedOption." + error; } } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } return null; }; /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Http + * @memberof google.protobuf.MethodOptions * @static * @param {Object.} object Plain object - * @returns {google.api.Http} Http + * @returns {google.protobuf.MethodOptions} MethodOptions */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } return message; }; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Http + * @memberof google.protobuf.MethodOptions * @static - * @param {google.api.Http} message Http + * @param {google.protobuf.MethodOptions} message MethodOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Http.toObject = function toObject(message, options) { + MethodOptions.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 (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); return object; }; /** - * Converts this Http to JSON. + * Converts this MethodOptions to JSON. * @function toJSON - * @memberof google.api.Http + * @memberof google.protobuf.MethodOptions * @instance * @returns {Object.} JSON object */ - Http.prototype.toJSON = function toJSON() { + MethodOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Http; + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {string} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; })(); - api.HttpRule = (function() { + protobuf.UninterpretedOption = (function() { /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + * Properties of 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 HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set */ - function HttpRule(properties) { - this.additionalBindings = []; + function UninterpretedOption(properties) { + this.name = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10723,209 +11424,156 @@ } /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = ""; - - /** - * HttpRule put. - * @member {string} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = ""; - - /** - * HttpRule post. - * @member {string} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = ""; - - /** - * HttpRule delete. - * @member {string} delete - * @memberof google.api.HttpRule + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption * @instance */ - HttpRule.prototype["delete"] = ""; + UninterpretedOption.prototype.name = $util.emptyArray; /** - * HttpRule patch. - * @member {string} patch - * @memberof google.api.HttpRule + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - HttpRule.prototype.patch = ""; + UninterpretedOption.prototype.identifierValue = ""; /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - HttpRule.prototype.custom = null; + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - HttpRule.prototype.body = ""; + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - HttpRule.prototype.responseBody = ""; + UninterpretedOption.prototype.doubleValue = 0; /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + UninterpretedOption.prototype.aggregateValue = ""; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new UninterpretedOption 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 + * @memberof google.protobuf.UninterpretedOption * @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 + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + 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 && message.hasOwnProperty("identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes an UninterpretedOption message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule + * @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 */ - HttpRule.decode = function decode(reader, length) { + UninterpretedOption.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.selector = reader.string(); - break; case 2: - message.get = reader.string(); + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); break; case 3: - message.put = reader.string(); + message.identifierValue = reader.string(); break; case 4: - message.post = reader.string(); + message.positiveIntValue = reader.uint64(); break; case 5: - message["delete"] = reader.string(); + message.negativeIntValue = reader.int64(); break; case 6: - message.patch = reader.string(); - break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + message.doubleValue = reader.double(); break; case 7: - message.body = reader.string(); - break; - case 12: - message.responseBody = reader.string(); + message.stringValue = reader.bytes(); break; - case 11: - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + case 8: + message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); @@ -10936,240 +11584,422 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @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 */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpRule message. + * Verifies an UninterpretedOption message. * @function verify - * @memberof google.api.HttpRule + * @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 */ - HttpRule.verify = function verify(message) { + UninterpretedOption.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (message.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 "custom." + error; + return "name." + error; } } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; + if (message.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) + 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 = ""; } - return null; + 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; }; /** - * 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 + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object */ - 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); + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + 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]]; } - 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]); + + /** + * 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * 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; } - } - return message; - }; + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; - /** - * Creates a plain object from a 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 NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this 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); - }; + return NamePart; + })(); - return HttpRule; + return UninterpretedOption; })(); - api.CustomHttpPattern = (function() { + protobuf.SourceCodeInfo = (function() { /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location */ /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function SourceCodeInfo(properties) { + this.location = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11177,88 +12007,78 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo * @instance */ - CustomHttpPattern.prototype.path = ""; + SourceCodeInfo.prototype.location = $util.emptyArray; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new SourceCodeInfo instance using the specified properties. * @function create - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + SourceCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.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 CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a SourceCodeInfo message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decode = function decode(reader, length) { + SourceCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.kind = reader.string(); - break; - case 2: - message.path = reader.string(); + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -11269,488 +12089,467 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies a SourceCodeInfo message. * @function verify - * @memberof google.api.CustomHttpPattern + * @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 */ - CustomHttpPattern.verify = function verify(message) { + SourceCodeInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; + if (message.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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); + var message = new $root.google.protobuf.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 CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + SourceCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; + 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); } - 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. + * Converts this SourceCodeInfo to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.SourceCodeInfo * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + SourceCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; - })(); - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {string} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - return values; - })(); - - 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 - */ + SourceCodeInfo.Location = (function() { - /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a 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 + */ - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; + /** + * 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]]; + } - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $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); - }; + /** + * 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 ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && message.hasOwnProperty("nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - return writer; - }; + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; - /** - * 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(); - }; + /** + * 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 ResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - case 3: - message.nameField = reader.string(); - break; - case 4: - message.history = reader.int32(); - break; - case 5: - message.plural = reader.string(); - break; - case 6: - message.singular = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + 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()); - }; + /** + * 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 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; + /** + * 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 (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - return null; - }; + 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 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) + /** + * 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; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - return message; - }; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.pattern = []; - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - return object; - }; + }; - /** - * 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); - }; + /** + * 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); + }; - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {string} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; + return Location; })(); - return ResourceDescriptor; + return SourceCodeInfo; })(); - api.ResourceReference = (function() { + protobuf.GeneratedCodeInfo = (function() { /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation */ /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set */ - function ResourceReference(properties) { + function GeneratedCodeInfo(properties) { + this.annotation = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11758,221 +12557,486 @@ } /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo * @instance */ - ResourceReference.prototype.childType = ""; + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; /** - * Creates a new ResourceReference instance using the specified properties. + * Creates a new GeneratedCodeInfo instance using the specified properties. * @function create - * @memberof google.api.ResourceReference + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); }; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encode - * @memberof google.api.ResourceReference + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer) { + GeneratedCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + 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 ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceReference + * @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.api.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decode = function decode(reader, length) { + GeneratedCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type = reader.string(); - break; - case 2: - message.childType = reader.string(); + 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; - }; + } + 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); + }; + + 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 + */ + + /** + * 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; + + /** + * 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 && message.hasOwnProperty("sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && message.hasOwnProperty("begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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()); - }; + /** + * 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 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; - }; + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; - /** - * Creates 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) + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; return object; - 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 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); + }; - /** - * 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); - }; + return Annotation; + })(); - return ResourceReference; + return GeneratedCodeInfo; })(); - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { + protobuf.Duration = (function() { /** - * Properties of a FileDescriptorSet. + * Properties of a Duration. * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos */ /** - * Constructs a new FileDescriptorSet. + * Constructs a new Duration. * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet + * @classdesc Represents a Duration. + * @implements IDuration * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @param {google.protobuf.IDuration=} [properties] Properties to set */ - function FileDescriptorSet(properties) { - this.file = []; + function Duration(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11980,78 +13044,88 @@ } /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration * @instance */ - FileDescriptorSet.prototype.file = $util.emptyArray; + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new FileDescriptorSet instance using the specified properties. + * 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.FileDescriptorSet + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); + Duration.create = function create(properties) { + return new Duration(properties); }; /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encode = function encode(message, writer) { + Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.seconds != null && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + Duration.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. + * Decodes a Duration message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileDescriptorSet + * @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.FileDescriptorSet} FileDescriptorSet + * @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 */ - FileDescriptorSet.decode = function decode(reader, length) { + Duration.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); break; default: reader.skipType(tag & 7); @@ -12062,393 +13136,193 @@ }; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * Decodes a Duration message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.Duration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @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 */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + Duration.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a 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); - }; - - return FileDescriptorSet; - })(); - - 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} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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 messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance + * 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 */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; + 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; + }; /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance + * 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 */ - FileDescriptorProto.prototype.service = $util.emptyArray; + 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; + }; /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance + * 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 */ - FileDescriptorProto.prototype.extension = $util.emptyArray; + 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; + }; /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration * @instance + * @returns {Object.} JSON object */ - FileDescriptorProto.prototype.options = null; + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Duration; + })(); + + protobuf.Empty = (function() { /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty */ - FileDescriptorProto.prototype.sourceCodeInfo = null; /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set */ - FileDescriptorProto.prototype.syntax = ""; + 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 FileDescriptorProto instance using the specified properties. + * Creates a new Empty instance using the specified properties. * @function create - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); + Empty.create = function create(properties) { + return new Empty(properties); }; /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorProto.encode = function encode(message, writer) { + Empty.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && message.hasOwnProperty("package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && message.hasOwnProperty("syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); return writer; }; /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + Empty.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. + * Decodes an Empty message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileDescriptorProto + * @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.FileDescriptorProto} FileDescriptorProto + * @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 */ - FileDescriptorProto.decode = function decode(reader, length) { + Empty.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message["package"] = reader.string(); - break; - case 3: - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - case 10: - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - case 11: - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - case 4: - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 8: - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - case 9: - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - case 12: - message.syntax = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -12458,329 +13332,95 @@ }; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an Empty message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.Empty * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @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 */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + Empty.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FileDescriptorProto message. + * Verifies an Empty message. * @function verify - * @memberof google.protobuf.FileDescriptorProto + * @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 */ - FileDescriptorProto.verify = function verify(message) { + Empty.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; return null; }; /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. + * 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.FileDescriptorProto + * @memberof google.protobuf.Empty * @instance * @returns {Object.} JSON object */ - FileDescriptorProto.prototype.toJSON = function toJSON() { + Empty.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FileDescriptorProto; + return Empty; })(); - protobuf.DescriptorProto = (function() { + protobuf.FieldMask = (function() { /** - * Properties of a DescriptorProto. + * Properties of a FieldMask. * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths */ /** - * Constructs a new DescriptorProto. + * Constructs a new FieldMask. * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto + * @classdesc Represents a FieldMask. + * @implements IFieldMask * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IFieldMask=} [properties] Properties to set */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; + function FieldMask(properties) { + this.paths = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12788,216 +13428,291 @@ } /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask * @instance */ - DescriptorProto.prototype.name = ""; + FieldMask.prototype.paths = $util.emptyArray; /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance + * 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 */ - DescriptorProto.prototype.field = $util.emptyArray; + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance + * 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 */ - DescriptorProto.prototype.extension = $util.emptyArray; + 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; + }; /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance + * 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 */ - DescriptorProto.prototype.nestedType = $util.emptyArray; + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance + * 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 */ - DescriptorProto.prototype.enumType = $util.emptyArray; + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto + * 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 */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FieldMask; + })(); + + protobuf.Timestamp = (function() { /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set */ - DescriptorProto.prototype.options = null; + 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]]; + } /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp * @instance */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp * @instance */ - DescriptorProto.prototype.reservedName = $util.emptyArray; + Timestamp.prototype.nanos = 0; /** - * Creates a new DescriptorProto instance using the specified properties. + * Creates a new Timestamp instance using the specified properties. * @function create - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); + Timestamp.create = function create(properties) { + return new Timestamp(properties); }; /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encode - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DescriptorProto.encode = function encode(message, writer) { + Timestamp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.seconds != null && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DescriptorProto message from the specified reader or buffer. + * Decodes a Timestamp message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.Timestamp * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @returns {google.protobuf.Timestamp} Timestamp * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DescriptorProto.decode = function decode(reader, length) { + Timestamp.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.seconds = reader.int64(); break; case 2: - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - case 8: - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - case 10: - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); + message.nanos = reader.int32(); break; default: reader.skipType(tag & 7); @@ -13008,2091 +13723,1655 @@ }; /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.Timestamp * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @returns {google.protobuf.Timestamp} Timestamp * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + Timestamp.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DescriptorProto message. - * @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"; - } + * 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 DescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.Timestamp * @static * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @returns {google.protobuf.Timestamp} Timestamp */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } + 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 DescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {google.protobuf.Timestamp} message Timestamp * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DescriptorProto.toObject = function toObject(message, options) { + Timestamp.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; return object; }; /** - * Converts this DescriptorProto to JSON. + * Converts this Timestamp to JSON. * @function toJSON - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.Timestamp * @instance * @returns {Object.} JSON object */ - DescriptorProto.prototype.toJSON = function toJSON() { + Timestamp.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - DescriptorProto.ExtensionRange = (function() { + return Timestamp; + })(); - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ + return protobuf; + })(); + + google.pubsub = (function() { + + /** + * Namespace pubsub. + * @memberof google + * @namespace + */ + var pubsub = {}; + + pubsub.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.pubsub + * @namespace + */ + var v1 = {}; + + v1.Publisher = (function() { /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange + * Constructs a new Publisher service. + * @memberof google.pubsub.v1 + * @classdesc Represents a Publisher + * @extends $protobuf.rpc.Service * @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]]; + * @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 Publisher(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } + (Publisher.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Publisher; + /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance + * Creates new Publisher service using the specified rpc implementation. + * @function create + * @memberof google.pubsub.v1.Publisher + * @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 {Publisher} RPC service. Useful where requests and/or responses are streamed. */ - ExtensionRange.prototype.start = 0; + Publisher.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance + * Callback as used by {@link google.pubsub.v1.Publisher#createTopic}. + * @memberof google.pubsub.v1.Publisher + * @typedef CreateTopicCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Topic} [response] Topic */ - ExtensionRange.prototype.end = 0; /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * Calls CreateTopic. + * @function createTopic + * @memberof google.pubsub.v1.Publisher * @instance + * @param {google.pubsub.v1.ITopic} request Topic message or plain object + * @param {google.pubsub.v1.Publisher.CreateTopicCallback} callback Node-style callback called with the error, if any, and Topic + * @returns {undefined} + * @variation 1 */ - ExtensionRange.prototype.options = null; + Object.defineProperty(Publisher.prototype.createTopic = function createTopic(request, callback) { + return this.rpcCall(createTopic, $root.google.pubsub.v1.Topic, $root.google.pubsub.v1.Topic, request, callback); + }, "name", { value: "CreateTopic" }); /** - * 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 + * Calls CreateTopic. + * @function createTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.ITopic} request Topic message or plain object + * @returns {Promise} Promise + * @variation 2 */ - 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 + * Callback as used by {@link google.pubsub.v1.Publisher#updateTopic}. + * @memberof google.pubsub.v1.Publisher + * @typedef UpdateTopicCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Topic} [response] Topic */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; /** - * Encodes the specified 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 + * Calls UpdateTopic. + * @function updateTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IUpdateTopicRequest} request UpdateTopicRequest message or plain object + * @param {google.pubsub.v1.Publisher.UpdateTopicCallback} callback Node-style callback called with the error, if any, and Topic + * @returns {undefined} + * @variation 1 */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(Publisher.prototype.updateTopic = function updateTopic(request, callback) { + return this.rpcCall(updateTopic, $root.google.pubsub.v1.UpdateTopicRequest, $root.google.pubsub.v1.Topic, request, callback); + }, "name", { value: "UpdateTopic" }); /** - * 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 + * Calls UpdateTopic. + * @function updateTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IUpdateTopicRequest} request UpdateTopicRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ExtensionRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * 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 + * Callback as used by {@link google.pubsub.v1.Publisher#publish}. + * @memberof google.pubsub.v1.Publisher + * @typedef PublishCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.PublishResponse} [response] PublishResponse */ - 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 + * Calls Publish. + * @function publish + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IPublishRequest} request PublishRequest message or plain object + * @param {google.pubsub.v1.Publisher.PublishCallback} callback Node-style callback called with the error, if any, and PublishResponse + * @returns {undefined} + * @variation 1 */ - 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; - }; + Object.defineProperty(Publisher.prototype.publish = function publish(request, callback) { + return this.rpcCall(publish, $root.google.pubsub.v1.PublishRequest, $root.google.pubsub.v1.PublishResponse, request, callback); + }, "name", { value: "Publish" }); /** - * 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 + * Calls Publish. + * @function publish + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IPublishRequest} request PublishRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - 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; - }; + * Callback as used by {@link google.pubsub.v1.Publisher#getTopic}. + * @memberof google.pubsub.v1.Publisher + * @typedef GetTopicCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Topic} [response] Topic + */ /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * Calls GetTopic. + * @function getTopic + * @memberof google.pubsub.v1.Publisher * @instance - * @returns {Object.} JSON object + * @param {google.pubsub.v1.IGetTopicRequest} request GetTopicRequest message or plain object + * @param {google.pubsub.v1.Publisher.GetTopicCallback} callback Node-style callback called with the error, if any, and Topic + * @returns {undefined} + * @variation 1 */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { + Object.defineProperty(Publisher.prototype.getTopic = function getTopic(request, callback) { + return this.rpcCall(getTopic, $root.google.pubsub.v1.GetTopicRequest, $root.google.pubsub.v1.Topic, request, callback); + }, "name", { value: "GetTopic" }); /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end + * Calls GetTopic. + * @function getTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IGetTopicRequest} request GetTopicRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * Callback as used by {@link google.pubsub.v1.Publisher#listTopics}. + * @memberof google.pubsub.v1.Publisher + * @typedef ListTopicsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListTopicsResponse} [response] ListTopicsResponse */ - 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 + * Calls ListTopics. + * @function listTopics + * @memberof google.pubsub.v1.Publisher * @instance + * @param {google.pubsub.v1.IListTopicsRequest} request ListTopicsRequest message or plain object + * @param {google.pubsub.v1.Publisher.ListTopicsCallback} callback Node-style callback called with the error, if any, and ListTopicsResponse + * @returns {undefined} + * @variation 1 */ - ReservedRange.prototype.start = 0; + Object.defineProperty(Publisher.prototype.listTopics = function listTopics(request, callback) { + return this.rpcCall(listTopics, $root.google.pubsub.v1.ListTopicsRequest, $root.google.pubsub.v1.ListTopicsResponse, request, callback); + }, "name", { value: "ListTopics" }); /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange + * Calls ListTopics. + * @function listTopics + * @memberof google.pubsub.v1.Publisher * @instance + * @param {google.pubsub.v1.IListTopicsRequest} request ListTopicsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - 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 + * Callback as used by {@link google.pubsub.v1.Publisher#listTopicSubscriptions}. + * @memberof google.pubsub.v1.Publisher + * @typedef ListTopicSubscriptionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListTopicSubscriptionsResponse} [response] ListTopicSubscriptionsResponse */ - 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 + * Calls ListTopicSubscriptions. + * @function listTopicSubscriptions + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} request ListTopicSubscriptionsRequest message or plain object + * @param {google.pubsub.v1.Publisher.ListTopicSubscriptionsCallback} callback Node-style callback called with the error, if any, and ListTopicSubscriptionsResponse + * @returns {undefined} + * @variation 1 */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; + Object.defineProperty(Publisher.prototype.listTopicSubscriptions = function listTopicSubscriptions(request, callback) { + return this.rpcCall(listTopicSubscriptions, $root.google.pubsub.v1.ListTopicSubscriptionsRequest, $root.google.pubsub.v1.ListTopicSubscriptionsResponse, request, callback); + }, "name", { value: "ListTopicSubscriptions" }); /** - * 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 + * Calls ListTopicSubscriptions. + * @function listTopicSubscriptions + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} request ListTopicSubscriptionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - 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 + * Callback as used by {@link google.pubsub.v1.Publisher#listTopicSnapshots}. + * @memberof google.pubsub.v1.Publisher + * @typedef ListTopicSnapshotsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListTopicSnapshotsResponse} [response] ListTopicSnapshotsResponse */ - ReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * 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 + * Calls ListTopicSnapshots. + * @function listTopicSnapshots + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IListTopicSnapshotsRequest} request ListTopicSnapshotsRequest message or plain object + * @param {google.pubsub.v1.Publisher.ListTopicSnapshotsCallback} callback Node-style callback called with the error, if any, and ListTopicSnapshotsResponse + * @returns {undefined} + * @variation 1 */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(Publisher.prototype.listTopicSnapshots = function listTopicSnapshots(request, callback) { + return this.rpcCall(listTopicSnapshots, $root.google.pubsub.v1.ListTopicSnapshotsRequest, $root.google.pubsub.v1.ListTopicSnapshotsResponse, request, callback); + }, "name", { value: "ListTopicSnapshots" }); /** - * 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 + * Calls ListTopicSnapshots. + * @function listTopicSnapshots + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IListTopicSnapshotsRequest} request ListTopicSnapshotsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - 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 + * Callback as used by {@link google.pubsub.v1.Publisher#deleteTopic}. + * @memberof google.pubsub.v1.Publisher + * @typedef DeleteTopicCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty */ - 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 + * Calls DeleteTopic. + * @function deleteTopic + * @memberof google.pubsub.v1.Publisher + * @instance + * @param {google.pubsub.v1.IDeleteTopicRequest} request DeleteTopicRequest message or plain object + * @param {google.pubsub.v1.Publisher.DeleteTopicCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 */ - 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; - }; + Object.defineProperty(Publisher.prototype.deleteTopic = function deleteTopic(request, callback) { + return this.rpcCall(deleteTopic, $root.google.pubsub.v1.DeleteTopicRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTopic" }); /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange + * Calls DeleteTopic. + * @function deleteTopic + * @memberof google.pubsub.v1.Publisher * @instance - * @returns {Object.} JSON object + * @param {google.pubsub.v1.IDeleteTopicRequest} request DeleteTopicRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return ReservedRange; + return Publisher; })(); - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * 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.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + v1.MessageStoragePolicy = (function() { - /** - * 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()); - }; + /** + * Properties of a MessageStoragePolicy. + * @memberof google.pubsub.v1 + * @interface IMessageStoragePolicy + * @property {Array.|null} [allowedPersistenceRegions] MessageStoragePolicy allowedPersistenceRegions + */ - /** - * 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; - } + /** + * Constructs a new MessageStoragePolicy. + * @memberof google.pubsub.v1 + * @classdesc Represents a MessageStoragePolicy. + * @implements IMessageStoragePolicy + * @constructor + * @param {google.pubsub.v1.IMessageStoragePolicy=} [properties] Properties to set + */ + function MessageStoragePolicy(properties) { + this.allowedPersistenceRegions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return null; - }; - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; + /** + * MessageStoragePolicy allowedPersistenceRegions. + * @member {Array.} allowedPersistenceRegions + * @memberof google.pubsub.v1.MessageStoragePolicy + * @instance + */ + MessageStoragePolicy.prototype.allowedPersistenceRegions = $util.emptyArray; - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; + /** + * Creates a new MessageStoragePolicy instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {google.pubsub.v1.IMessageStoragePolicy=} [properties] Properties to set + * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy instance + */ + MessageStoragePolicy.create = function create(properties) { + return new MessageStoragePolicy(properties); + }; - /** - * 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); - }; + /** + * Encodes the specified MessageStoragePolicy message. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {google.pubsub.v1.IMessageStoragePolicy} message MessageStoragePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageStoragePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedPersistenceRegions != null && message.allowedPersistenceRegions.length) + for (var i = 0; i < message.allowedPersistenceRegions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedPersistenceRegions[i]); + return writer; + }; - return ExtensionRangeOptions; - })(); + /** + * Encodes the specified MessageStoragePolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {google.pubsub.v1.IMessageStoragePolicy} message MessageStoragePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageStoragePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - protobuf.FieldDescriptorProto = (function() { + /** + * Decodes a MessageStoragePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageStoragePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.MessageStoragePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.allowedPersistenceRegions && message.allowedPersistenceRegions.length)) + message.allowedPersistenceRegions = []; + message.allowedPersistenceRegions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - */ + /** + * Decodes a MessageStoragePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageStoragePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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]]; - } + /** + * Verifies a MessageStoragePolicy message. + * @function verify + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageStoragePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedPersistenceRegions != null && message.hasOwnProperty("allowedPersistenceRegions")) { + if (!Array.isArray(message.allowedPersistenceRegions)) + return "allowedPersistenceRegions: array expected"; + for (var i = 0; i < message.allowedPersistenceRegions.length; ++i) + if (!$util.isString(message.allowedPersistenceRegions[i])) + return "allowedPersistenceRegions: string[] expected"; + } + return null; + }; - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; + /** + * Creates a MessageStoragePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy + */ + MessageStoragePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.MessageStoragePolicy) + return object; + var message = new $root.google.pubsub.v1.MessageStoragePolicy(); + if (object.allowedPersistenceRegions) { + if (!Array.isArray(object.allowedPersistenceRegions)) + throw TypeError(".google.pubsub.v1.MessageStoragePolicy.allowedPersistenceRegions: array expected"); + message.allowedPersistenceRegions = []; + for (var i = 0; i < object.allowedPersistenceRegions.length; ++i) + message.allowedPersistenceRegions[i] = String(object.allowedPersistenceRegions[i]); + } + return message; + }; - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; + /** + * Creates a plain object from a MessageStoragePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.MessageStoragePolicy + * @static + * @param {google.pubsub.v1.MessageStoragePolicy} message MessageStoragePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageStoragePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedPersistenceRegions = []; + if (message.allowedPersistenceRegions && message.allowedPersistenceRegions.length) { + object.allowedPersistenceRegions = []; + for (var j = 0; j < message.allowedPersistenceRegions.length; ++j) + object.allowedPersistenceRegions[j] = message.allowedPersistenceRegions[j]; + } + return object; + }; - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; + /** + * Converts this MessageStoragePolicy to JSON. + * @function toJSON + * @memberof google.pubsub.v1.MessageStoragePolicy + * @instance + * @returns {Object.} JSON object + */ + MessageStoragePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; + return MessageStoragePolicy; + })(); - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; + v1.Topic = (function() { - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; + /** + * Properties of a Topic. + * @memberof google.pubsub.v1 + * @interface ITopic + * @property {string|null} [name] Topic name + * @property {Object.|null} [labels] Topic labels + * @property {google.pubsub.v1.IMessageStoragePolicy|null} [messageStoragePolicy] Topic messageStoragePolicy + * @property {string|null} [kmsKeyName] Topic kmsKeyName + */ + + /** + * Constructs a new Topic. + * @memberof google.pubsub.v1 + * @classdesc Represents a Topic. + * @implements ITopic + * @constructor + * @param {google.pubsub.v1.ITopic=} [properties] Properties to set + */ + function Topic(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; + /** + * Topic name. + * @member {string} name + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.name = ""; - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; + /** + * Topic labels. + * @member {Object.} labels + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.labels = $util.emptyObject; - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; + /** + * Topic messageStoragePolicy. + * @member {google.pubsub.v1.IMessageStoragePolicy|null|undefined} messageStoragePolicy + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.messageStoragePolicy = null; - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; + /** + * Topic kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.kmsKeyName = ""; - /** - * 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); - }; + /** + * Creates a new Topic instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.Topic + * @static + * @param {google.pubsub.v1.ITopic=} [properties] Properties to set + * @returns {google.pubsub.v1.Topic} Topic instance + */ + Topic.create = function create(properties) { + return new Topic(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 && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && message.hasOwnProperty("extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && message.hasOwnProperty("number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && message.hasOwnProperty("label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && message.hasOwnProperty("typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - return writer; - }; + /** + * Encodes the specified Topic message. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.Topic + * @static + * @param {google.pubsub.v1.ITopic} message Topic message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Topic.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.labels != null && message.hasOwnProperty("labels")) + for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); + if (message.messageStoragePolicy != null && message.hasOwnProperty("messageStoragePolicy")) + $root.google.pubsub.v1.MessageStoragePolicy.encode(message.messageStoragePolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.kmsKeyName); + 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(); - }; + /** + * Encodes the specified Topic message, length delimited. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.Topic + * @static + * @param {google.pubsub.v1.ITopic} message Topic message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Topic.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.number = reader.int32(); - break; - case 4: - message.label = reader.int32(); - break; - case 5: - message.type = reader.int32(); - break; - case 6: - message.typeName = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.defaultValue = reader.string(); - break; - case 9: - message.oneofIndex = reader.int32(); - break; - case 10: - message.jsonName = reader.string(); - break; - case 8: - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a Topic message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.Topic + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.Topic} Topic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Topic.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.Topic(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + break; + case 3: + message.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.decode(reader, reader.uint32()); + break; + case 5: + message.kmsKeyName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + 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()); - }; + /** + * Decodes a Topic message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.Topic + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.Topic} Topic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Topic.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 2: - case 3: - break; + /** + * Verifies a Topic message. + * @function verify + * @memberof google.pubsub.v1.Topic + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Topic.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.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.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.messageStoragePolicy != null && message.hasOwnProperty("messageStoragePolicy")) { + var error = $root.google.pubsub.v1.MessageStoragePolicy.verify(message.messageStoragePolicy); + if (error) + return "messageStoragePolicy." + error; } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - } - switch (object.type) { - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - return message; - }; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + return null; + }; - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - return object; - }; + /** + * Creates a Topic message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.Topic + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.Topic} Topic + */ + Topic.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.Topic) + return object; + var message = new $root.google.pubsub.v1.Topic(); + if (object.name != null) + message.name = String(object.name); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.pubsub.v1.Topic.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.messageStoragePolicy != null) { + if (typeof object.messageStoragePolicy !== "object") + throw TypeError(".google.pubsub.v1.Topic.messageStoragePolicy: object expected"); + message.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.fromObject(object.messageStoragePolicy); + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + return message; + }; - /** - * 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); - }; + /** + * Creates a plain object from a Topic message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.Topic + * @static + * @param {google.pubsub.v1.Topic} message Topic + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Topic.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.messageStoragePolicy = null; + object.kmsKeyName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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.messageStoragePolicy != null && message.hasOwnProperty("messageStoragePolicy")) + object.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.toObject(message.messageStoragePolicy, options); + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + return object; + }; - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {string} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; + /** + * Converts this Topic to JSON. + * @function toJSON + * @memberof google.pubsub.v1.Topic + * @instance + * @returns {Object.} JSON object + */ + Topic.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Topic; })(); - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {string} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - return values; - })(); + v1.PubsubMessage = (function() { + + /** + * Properties of a PubsubMessage. + * @memberof google.pubsub.v1 + * @interface IPubsubMessage + * @property {Uint8Array|null} [data] PubsubMessage data + * @property {Object.|null} [attributes] PubsubMessage attributes + * @property {string|null} [messageId] PubsubMessage messageId + * @property {google.protobuf.ITimestamp|null} [publishTime] PubsubMessage publishTime + * @property {string|null} [orderingKey] PubsubMessage orderingKey + */ + + /** + * Constructs a new PubsubMessage. + * @memberof google.pubsub.v1 + * @classdesc Represents a PubsubMessage. + * @implements IPubsubMessage + * @constructor + * @param {google.pubsub.v1.IPubsubMessage=} [properties] Properties to set + */ + function PubsubMessage(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]]; + } + + /** + * PubsubMessage data. + * @member {Uint8Array} data + * @memberof google.pubsub.v1.PubsubMessage + * @instance + */ + PubsubMessage.prototype.data = $util.newBuffer([]); + + /** + * PubsubMessage attributes. + * @member {Object.} attributes + * @memberof google.pubsub.v1.PubsubMessage + * @instance + */ + PubsubMessage.prototype.attributes = $util.emptyObject; + + /** + * PubsubMessage messageId. + * @member {string} messageId + * @memberof google.pubsub.v1.PubsubMessage + * @instance + */ + PubsubMessage.prototype.messageId = ""; + + /** + * PubsubMessage publishTime. + * @member {google.protobuf.ITimestamp|null|undefined} publishTime + * @memberof google.pubsub.v1.PubsubMessage + * @instance + */ + PubsubMessage.prototype.publishTime = null; + + /** + * PubsubMessage orderingKey. + * @member {string} orderingKey + * @memberof google.pubsub.v1.PubsubMessage + * @instance + */ + PubsubMessage.prototype.orderingKey = ""; + + /** + * Creates a new PubsubMessage instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {google.pubsub.v1.IPubsubMessage=} [properties] Properties to set + * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage instance + */ + PubsubMessage.create = function create(properties) { + return new PubsubMessage(properties); + }; + + /** + * Encodes the specified PubsubMessage message. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {google.pubsub.v1.IPubsubMessage} message PubsubMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.data != null && message.hasOwnProperty("data")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data); + if (message.attributes != null && message.hasOwnProperty("attributes")) + for (var keys = Object.keys(message.attributes), 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.attributes[keys[i]]).ldelim(); + if (message.messageId != null && message.hasOwnProperty("messageId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.messageId); + if (message.publishTime != null && message.hasOwnProperty("publishTime")) + $root.google.protobuf.Timestamp.encode(message.publishTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.orderingKey != null && message.hasOwnProperty("orderingKey")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderingKey); + return writer; + }; - return FieldDescriptorProto; - })(); + /** + * Encodes the specified PubsubMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {google.pubsub.v1.IPubsubMessage} message PubsubMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - protobuf.OneofDescriptorProto = (function() { + /** + * Decodes a PubsubMessage message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PubsubMessage(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + reader.skip().pos++; + if (message.attributes === $util.emptyObject) + message.attributes = {}; + key = reader.string(); + reader.pos++; + message.attributes[key] = reader.string(); + break; + case 3: + message.messageId = reader.string(); + break; + case 4: + message.publishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.orderingKey = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ + /** + * Decodes a PubsubMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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]]; - } + /** + * Verifies a PubsubMessage message. + * @function verify + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubsubMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.attributes[key[i]])) + return "attributes: string{k:string} expected"; + } + if (message.messageId != null && message.hasOwnProperty("messageId")) + if (!$util.isString(message.messageId)) + return "messageId: string expected"; + if (message.publishTime != null && message.hasOwnProperty("publishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.publishTime); + if (error) + return "publishTime." + error; + } + if (message.orderingKey != null && message.hasOwnProperty("orderingKey")) + if (!$util.isString(message.orderingKey)) + return "orderingKey: string expected"; + return null; + }; - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; + /** + * Creates a PubsubMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage + */ + PubsubMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PubsubMessage) + return object; + var message = new $root.google.pubsub.v1.PubsubMessage(); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.pubsub.v1.PubsubMessage.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) + message.attributes[keys[i]] = String(object.attributes[keys[i]]); + } + if (object.messageId != null) + message.messageId = String(object.messageId); + if (object.publishTime != null) { + if (typeof object.publishTime !== "object") + throw TypeError(".google.pubsub.v1.PubsubMessage.publishTime: object expected"); + message.publishTime = $root.google.protobuf.Timestamp.fromObject(object.publishTime); + } + if (object.orderingKey != null) + message.orderingKey = String(object.orderingKey); + return message; + }; + + /** + * Creates a plain object from a PubsubMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PubsubMessage + * @static + * @param {google.pubsub.v1.PubsubMessage} message PubsubMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubsubMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.messageId = ""; + object.publishTime = null; + object.orderingKey = ""; + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = message.attributes[keys2[j]]; + } + if (message.messageId != null && message.hasOwnProperty("messageId")) + object.messageId = message.messageId; + if (message.publishTime != null && message.hasOwnProperty("publishTime")) + object.publishTime = $root.google.protobuf.Timestamp.toObject(message.publishTime, options); + if (message.orderingKey != null && message.hasOwnProperty("orderingKey")) + object.orderingKey = message.orderingKey; + return object; + }; - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; + /** + * Converts this PubsubMessage to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PubsubMessage + * @instance + * @returns {Object.} JSON object + */ + PubsubMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + return PubsubMessage; + })(); - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + v1.GetTopicRequest = (function() { - /** - * 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(); - }; + /** + * Properties of a GetTopicRequest. + * @memberof google.pubsub.v1 + * @interface IGetTopicRequest + * @property {string|null} [topic] GetTopicRequest topic + */ - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Constructs a new GetTopicRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a GetTopicRequest. + * @implements IGetTopicRequest + * @constructor + * @param {google.pubsub.v1.IGetTopicRequest=} [properties] Properties to set + */ + function GetTopicRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return message; - }; - /** - * Decodes an 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()); - }; + /** + * GetTopicRequest topic. + * @member {string} topic + * @memberof google.pubsub.v1.GetTopicRequest + * @instance + */ + GetTopicRequest.prototype.topic = ""; - /** - * 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 a new GetTopicRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {google.pubsub.v1.IGetTopicRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest instance + */ + GetTopicRequest.create = function create(properties) { + return new GetTopicRequest(properties); + }; - /** - * 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; - }; + /** + * Encodes the specified GetTopicRequest message. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {google.pubsub.v1.IGetTopicRequest} message GetTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTopicRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && message.hasOwnProperty("topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + return writer; + }; - /** - * 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; - }; + /** + * Encodes the specified GetTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {google.pubsub.v1.IGetTopicRequest} message GetTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTopicRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTopicRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTopicRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.GetTopicRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.topic = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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); - }; + /** + * Decodes a GetTopicRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTopicRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return OneofDescriptorProto; - })(); + /** + * Verifies a GetTopicRequest message. + * @function verify + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTopicRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + return null; + }; - protobuf.EnumDescriptorProto = (function() { + /** + * Creates a GetTopicRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest + */ + GetTopicRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.GetTopicRequest) + return object; + var message = new $root.google.pubsub.v1.GetTopicRequest(); + if (object.topic != null) + message.topic = String(object.topic); + return message; + }; - /** - * 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 - */ + /** + * Creates a plain object from a GetTopicRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.GetTopicRequest + * @static + * @param {google.pubsub.v1.GetTopicRequest} message GetTopicRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTopicRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + return object; + }; - /** - * 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]]; - } + /** + * Converts this GetTopicRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.GetTopicRequest + * @instance + * @returns {Object.} JSON object + */ + GetTopicRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; + return GetTopicRequest; + })(); - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; + v1.UpdateTopicRequest = (function() { - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; + /** + * Properties of an UpdateTopicRequest. + * @memberof google.pubsub.v1 + * @interface IUpdateTopicRequest + * @property {google.pubsub.v1.ITopic|null} [topic] UpdateTopicRequest topic + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTopicRequest updateMask + */ - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + /** + * Constructs a new UpdateTopicRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents an UpdateTopicRequest. + * @implements IUpdateTopicRequest + * @constructor + * @param {google.pubsub.v1.IUpdateTopicRequest=} [properties] Properties to set + */ + function UpdateTopicRequest(properties) { + if (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 reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * UpdateTopicRequest topic. + * @member {google.pubsub.v1.ITopic|null|undefined} topic + * @memberof google.pubsub.v1.UpdateTopicRequest + * @instance + */ + UpdateTopicRequest.prototype.topic = null; - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; + /** + * UpdateTopicRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.pubsub.v1.UpdateTopicRequest + * @instance + */ + UpdateTopicRequest.prototype.updateMask = null; - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; + /** + * Creates a new UpdateTopicRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {google.pubsub.v1.IUpdateTopicRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest instance + */ + UpdateTopicRequest.create = function create(properties) { + return new UpdateTopicRequest(properties); + }; + + /** + * Encodes the specified UpdateTopicRequest message. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {google.pubsub.v1.IUpdateTopicRequest} message UpdateTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTopicRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && message.hasOwnProperty("topic")) + $root.google.pubsub.v1.Topic.encode(message.topic, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * 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(); - }; + /** + * Encodes the specified UpdateTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {google.pubsub.v1.IUpdateTopicRequest} message UpdateTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTopicRequest.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes an UpdateTopicRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTopicRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.UpdateTopicRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.topic = $root.google.pubsub.v1.Topic.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return 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()); - }; + /** + * Decodes an UpdateTopicRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTopicRequest.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]); + /** + * Verifies an UpdateTopicRequest message. + * @function verify + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTopicRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) { + var error = $root.google.pubsub.v1.Topic.verify(message.topic); if (error) - return "value." + error; + return "topic." + 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 (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) - return "reservedRange." + error; + return "updateMask." + error; } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; + 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]); + /** + * Creates an UpdateTopicRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest + */ + UpdateTopicRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.UpdateTopicRequest) + return object; + var message = new $root.google.pubsub.v1.UpdateTopicRequest(); + if (object.topic != null) { + if (typeof object.topic !== "object") + throw TypeError(".google.pubsub.v1.UpdateTopicRequest.topic: object expected"); + message.topic = $root.google.pubsub.v1.Topic.fromObject(object.topic); } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.pubsub.v1.UpdateTopicRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + 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; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; + /** + * Creates a plain object from an UpdateTopicRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.UpdateTopicRequest + * @static + * @param {google.pubsub.v1.UpdateTopicRequest} message UpdateTopicRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTopicRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topic = null; + object.updateMask = null; + } + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = $root.google.pubsub.v1.Topic.toObject(message.topic, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + 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); - }; + /** + * Converts this UpdateTopicRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.UpdateTopicRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTopicRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - EnumDescriptorProto.EnumReservedRange = (function() { + return UpdateTopicRequest; + })(); + + v1.PublishRequest = (function() { /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end + * Properties of a PublishRequest. + * @memberof google.pubsub.v1 + * @interface IPublishRequest + * @property {string|null} [topic] PublishRequest topic + * @property {Array.|null} [messages] PublishRequest messages */ /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange + * Constructs a new PublishRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a PublishRequest. + * @implements IPublishRequest * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @param {google.pubsub.v1.IPublishRequest=} [properties] Properties to set */ - function EnumReservedRange(properties) { + function PublishRequest(properties) { + this.messages = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15100,88 +15379,91 @@ } /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * PublishRequest topic. + * @member {string} topic + * @memberof google.pubsub.v1.PublishRequest * @instance */ - EnumReservedRange.prototype.start = 0; + PublishRequest.prototype.topic = ""; /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * PublishRequest messages. + * @member {Array.} messages + * @memberof google.pubsub.v1.PublishRequest * @instance */ - EnumReservedRange.prototype.end = 0; + PublishRequest.prototype.messages = $util.emptyArray; /** - * Creates a new EnumReservedRange instance using the specified properties. + * Creates a new PublishRequest instance using the specified properties. * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.pubsub.v1.PublishRequest * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + * @param {google.pubsub.v1.IPublishRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.PublishRequest} PublishRequest instance */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); + PublishRequest.create = function create(properties) { + return new PublishRequest(properties); }; /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * Encodes the specified PublishRequest message. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.pubsub.v1.PublishRequest * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {google.pubsub.v1.IPublishRequest} message PublishRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumReservedRange.encode = function encode(message, writer) { + PublishRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.topic != null && message.hasOwnProperty("topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.pubsub.v1.PubsubMessage.encode(message.messages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * Encodes the specified PublishRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.pubsub.v1.PublishRequest * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {google.pubsub.v1.IPublishRequest} message PublishRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + PublishRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumReservedRange message from the specified reader or buffer. + * Decodes a PublishRequest message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.pubsub.v1.PublishRequest * @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 + * @returns {google.pubsub.v1.PublishRequest} PublishRequest * @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) { + PublishRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PublishRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.start = reader.int32(); + message.topic = reader.string(); break; case 2: - message.end = reader.int32(); + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.pubsub.v1.PubsubMessage.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -15192,4190 +15474,4698 @@ }; /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * Decodes a PublishRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.pubsub.v1.PublishRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @returns {google.pubsub.v1.PublishRequest} PublishRequest * @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) { + PublishRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumReservedRange message. + * Verifies a PublishRequest message. * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.pubsub.v1.PublishRequest * @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) { + PublishRequest.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.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.pubsub.v1.PubsubMessage.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } return null; }; /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * Creates a PublishRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.pubsub.v1.PublishRequest * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @returns {google.pubsub.v1.PublishRequest} PublishRequest */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + PublishRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PublishRequest) 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; + var message = new $root.google.pubsub.v1.PublishRequest(); + if (object.topic != null) + message.topic = String(object.topic); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.pubsub.v1.PublishRequest.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.pubsub.v1.PublishRequest.messages: object expected"); + message.messages[i] = $root.google.pubsub.v1.PubsubMessage.fromObject(object.messages[i]); + } + } return message; }; /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * Creates a plain object from a PublishRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.pubsub.v1.PublishRequest * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {google.pubsub.v1.PublishRequest} message PublishRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumReservedRange.toObject = function toObject(message, options) { + PublishRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.pubsub.v1.PubsubMessage.toObject(message.messages[j], options); } - 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. + * Converts this PublishRequest to JSON. * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.pubsub.v1.PublishRequest * @instance * @returns {Object.} JSON object */ - EnumReservedRange.prototype.toJSON = function toJSON() { + PublishRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return EnumReservedRange; + return PublishRequest; })(); - 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]]; - } + v1.PublishResponse = (function() { - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; + /** + * Properties of a PublishResponse. + * @memberof google.pubsub.v1 + * @interface IPublishResponse + * @property {Array.|null} [messageIds] PublishResponse messageIds + */ - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; + /** + * Constructs a new PublishResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a PublishResponse. + * @implements IPublishResponse + * @constructor + * @param {google.pubsub.v1.IPublishResponse=} [properties] Properties to set + */ + function PublishResponse(properties) { + this.messageIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; + /** + * PublishResponse messageIds. + * @member {Array.} messageIds + * @memberof google.pubsub.v1.PublishResponse + * @instance + */ + PublishResponse.prototype.messageIds = $util.emptyArray; - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; + /** + * Creates a new PublishResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {google.pubsub.v1.IPublishResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.PublishResponse} PublishResponse instance + */ + PublishResponse.create = function create(properties) { + return new PublishResponse(properties); + }; - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && message.hasOwnProperty("number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified PublishResponse message. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {google.pubsub.v1.IPublishResponse} message PublishResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageIds != null && message.messageIds.length) + for (var i = 0; i < message.messageIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.messageIds[i]); + return writer; + }; - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified PublishResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {google.pubsub.v1.IPublishResponse} message PublishResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.number = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a PublishResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PublishResponse} PublishResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PublishResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.messageIds && message.messageIds.length)) + message.messageIds = []; + message.messageIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a PublishResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PublishResponse} PublishResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; + /** + * Verifies a PublishResponse message. + * @function verify + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublishResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageIds != null && message.hasOwnProperty("messageIds")) { + if (!Array.isArray(message.messageIds)) + return "messageIds: array expected"; + for (var i = 0; i < message.messageIds.length; ++i) + if (!$util.isString(message.messageIds[i])) + return "messageIds: string[] expected"; + } + return null; + }; - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; + /** + * Creates a PublishResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PublishResponse} PublishResponse + */ + PublishResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PublishResponse) + return object; + var message = new $root.google.pubsub.v1.PublishResponse(); + if (object.messageIds) { + if (!Array.isArray(object.messageIds)) + throw TypeError(".google.pubsub.v1.PublishResponse.messageIds: array expected"); + message.messageIds = []; + for (var i = 0; i < object.messageIds.length; ++i) + message.messageIds[i] = String(object.messageIds[i]); + } + return message; + }; - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; + /** + * Creates a plain object from a PublishResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PublishResponse + * @static + * @param {google.pubsub.v1.PublishResponse} message PublishResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublishResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messageIds = []; + if (message.messageIds && message.messageIds.length) { + object.messageIds = []; + for (var j = 0; j < message.messageIds.length; ++j) + object.messageIds[j] = message.messageIds[j]; + } + return object; + }; - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this PublishResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PublishResponse + * @instance + * @returns {Object.} JSON object + */ + PublishResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return EnumValueDescriptorProto; - })(); + return PublishResponse; + })(); - protobuf.ServiceDescriptorProto = (function() { + v1.ListTopicsRequest = (function() { - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ + /** + * Properties of a ListTopicsRequest. + * @memberof google.pubsub.v1 + * @interface IListTopicsRequest + * @property {string|null} [project] ListTopicsRequest project + * @property {number|null} [pageSize] ListTopicsRequest pageSize + * @property {string|null} [pageToken] ListTopicsRequest pageToken + */ - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new ListTopicsRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicsRequest. + * @implements IListTopicsRequest + * @constructor + * @param {google.pubsub.v1.IListTopicsRequest=} [properties] Properties to set + */ + function ListTopicsRequest(properties) { + if (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 = ""; + /** + * ListTopicsRequest project. + * @member {string} project + * @memberof google.pubsub.v1.ListTopicsRequest + * @instance + */ + ListTopicsRequest.prototype.project = ""; - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; + /** + * ListTopicsRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListTopicsRequest + * @instance + */ + ListTopicsRequest.prototype.pageSize = 0; - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; + /** + * ListTopicsRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListTopicsRequest + * @instance + */ + ListTopicsRequest.prototype.pageToken = ""; - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; + /** + * Creates a new ListTopicsRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {google.pubsub.v1.IListTopicsRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest instance + */ + ListTopicsRequest.create = function create(properties) { + return new ListTopicsRequest(properties); + }; - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified ListTopicsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {google.pubsub.v1.IListTopicsRequest} message ListTopicsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && message.hasOwnProperty("project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ListTopicsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {google.pubsub.v1.IListTopicsRequest} message ListTopicsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a ListTopicsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.project = 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; - }; + return message; + }; - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a ListTopicsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTopicsRequest message. + * @function verify + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: 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 ListTopicsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest + */ + ListTopicsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicsRequest) + return object; + var message = new $root.google.pubsub.v1.ListTopicsRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; - /** - * 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; + /** + * Creates a plain object from a ListTopicsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicsRequest + * @static + * @param {google.pubsub.v1.ListTopicsRequest} message ListTopicsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.pageSize = 0; + object.pageToken = ""; } - } - 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) + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; 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); - }; + /** + * Converts this ListTopicsRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTopicsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ServiceDescriptorProto; - })(); + return ListTopicsRequest; + })(); - protobuf.MethodDescriptorProto = (function() { + v1.ListTopicsResponse = (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 - */ + /** + * Properties of a ListTopicsResponse. + * @memberof google.pubsub.v1 + * @interface IListTopicsResponse + * @property {Array.|null} [topics] ListTopicsResponse topics + * @property {string|null} [nextPageToken] ListTopicsResponse nextPageToken + */ - /** - * 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]]; - } + /** + * Constructs a new ListTopicsResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicsResponse. + * @implements IListTopicsResponse + * @constructor + * @param {google.pubsub.v1.IListTopicsResponse=} [properties] Properties to set + */ + function ListTopicsResponse(properties) { + this.topics = []; + if (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 = ""; + /** + * ListTopicsResponse topics. + * @member {Array.} topics + * @memberof google.pubsub.v1.ListTopicsResponse + * @instance + */ + ListTopicsResponse.prototype.topics = $util.emptyArray; - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; + /** + * ListTopicsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListTopicsResponse + * @instance + */ + ListTopicsResponse.prototype.nextPageToken = ""; - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; + /** + * Creates a new ListTopicsResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {google.pubsub.v1.IListTopicsResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse instance + */ + ListTopicsResponse.create = function create(properties) { + return new ListTopicsResponse(properties); + }; - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; + /** + * Encodes the specified ListTopicsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {google.pubsub.v1.IListTopicsResponse} message ListTopicsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topics != null && message.topics.length) + for (var i = 0; i < message.topics.length; ++i) + $root.google.pubsub.v1.Topic.encode(message.topics[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; + /** + * Encodes the specified ListTopicsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {google.pubsub.v1.IListTopicsResponse} message ListTopicsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; + /** + * Decodes a ListTopicsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.topics && message.topics.length)) + message.topics = []; + message.topics.push($root.google.pubsub.v1.Topic.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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); - }; + /** + * Decodes a ListTopicsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && message.hasOwnProperty("inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && message.hasOwnProperty("outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; + /** + * Verifies a ListTopicsResponse message. + * @function verify + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topics != null && message.hasOwnProperty("topics")) { + if (!Array.isArray(message.topics)) + return "topics: array expected"; + for (var i = 0; i < message.topics.length; ++i) { + var error = $root.google.pubsub.v1.Topic.verify(message.topics[i]); + if (error) + return "topics." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; - /** - * 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(); - }; + /** + * Creates a ListTopicsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse + */ + ListTopicsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicsResponse) + return object; + var message = new $root.google.pubsub.v1.ListTopicsResponse(); + if (object.topics) { + if (!Array.isArray(object.topics)) + throw TypeError(".google.pubsub.v1.ListTopicsResponse.topics: array expected"); + message.topics = []; + for (var i = 0; i < object.topics.length; ++i) { + if (typeof object.topics[i] !== "object") + throw TypeError(".google.pubsub.v1.ListTopicsResponse.topics: object expected"); + message.topics[i] = $root.google.pubsub.v1.Topic.fromObject(object.topics[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.inputType = reader.string(); - break; - case 3: - message.outputType = reader.string(); - break; - case 4: - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.clientStreaming = reader.bool(); - break; - case 6: - message.serverStreaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Creates a plain object from a ListTopicsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicsResponse + * @static + * @param {google.pubsub.v1.ListTopicsResponse} message ListTopicsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.topics = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.topics && message.topics.length) { + object.topics = []; + for (var j = 0; j < message.topics.length; ++j) + object.topics[j] = $root.google.pubsub.v1.Topic.toObject(message.topics[j], options); } - } - return message; - }; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTopicsResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTopicsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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()); - }; + return ListTopicsResponse; + })(); - /** - * 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; - }; + v1.ListTopicSubscriptionsRequest = (function() { - /** - * 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; - }; + /** + * Properties of a ListTopicSubscriptionsRequest. + * @memberof google.pubsub.v1 + * @interface IListTopicSubscriptionsRequest + * @property {string|null} [topic] ListTopicSubscriptionsRequest topic + * @property {number|null} [pageSize] ListTopicSubscriptionsRequest pageSize + * @property {string|null} [pageToken] ListTopicSubscriptionsRequest pageToken + */ - /** - * 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; + /** + * Constructs a new ListTopicSubscriptionsRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicSubscriptionsRequest. + * @implements IListTopicSubscriptionsRequest + * @constructor + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest=} [properties] Properties to set + */ + function ListTopicSubscriptionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - if (message.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); - }; + /** + * ListTopicSubscriptionsRequest topic. + * @member {string} topic + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @instance + */ + ListTopicSubscriptionsRequest.prototype.topic = ""; + + /** + * ListTopicSubscriptionsRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @instance + */ + ListTopicSubscriptionsRequest.prototype.pageSize = 0; + + /** + * ListTopicSubscriptionsRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @instance + */ + ListTopicSubscriptionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTopicSubscriptionsRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest instance + */ + ListTopicSubscriptionsRequest.create = function create(properties) { + return new ListTopicSubscriptionsRequest(properties); + }; + + /** + * Encodes the specified ListTopicSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSubscriptionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && message.hasOwnProperty("topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListTopicSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSubscriptionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSubscriptionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicSubscriptionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.topic = 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 ListTopicSubscriptionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSubscriptionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTopicSubscriptionsRequest message. + * @function verify + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicSubscriptionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: 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; + }; - return MethodDescriptorProto; - })(); + /** + * Creates a ListTopicSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest + */ + ListTopicSubscriptionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicSubscriptionsRequest) + return object; + var message = new $root.google.pubsub.v1.ListTopicSubscriptionsRequest(); + if (object.topic != null) + message.topic = String(object.topic); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; - protobuf.FileOptions = (function() { + /** + * Creates a plain object from a ListTopicSubscriptionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @static + * @param {google.pubsub.v1.ListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicSubscriptionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topic = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ + /** + * Converts this ListTopicSubscriptionsRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTopicSubscriptionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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]]; - } + return ListTopicSubscriptionsRequest; + })(); - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; + v1.ListTopicSubscriptionsResponse = (function() { - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; + /** + * Properties of a ListTopicSubscriptionsResponse. + * @memberof google.pubsub.v1 + * @interface IListTopicSubscriptionsResponse + * @property {Array.|null} [subscriptions] ListTopicSubscriptionsResponse subscriptions + * @property {string|null} [nextPageToken] ListTopicSubscriptionsResponse nextPageToken + */ - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; + /** + * Constructs a new ListTopicSubscriptionsResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicSubscriptionsResponse. + * @implements IListTopicSubscriptionsResponse + * @constructor + * @param {google.pubsub.v1.IListTopicSubscriptionsResponse=} [properties] Properties to set + */ + function ListTopicSubscriptionsResponse(properties) { + this.subscriptions = []; + if (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 javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; + /** + * ListTopicSubscriptionsResponse subscriptions. + * @member {Array.} subscriptions + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @instance + */ + ListTopicSubscriptionsResponse.prototype.subscriptions = $util.emptyArray; - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; + /** + * ListTopicSubscriptionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @instance + */ + ListTopicSubscriptionsResponse.prototype.nextPageToken = ""; - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; + /** + * Creates a new ListTopicSubscriptionsResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse instance + */ + ListTopicSubscriptionsResponse.create = function create(properties) { + return new ListTopicSubscriptionsResponse(properties); + }; + + /** + * Encodes the specified ListTopicSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSubscriptionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscriptions != null && message.subscriptions.length) + for (var i = 0; i < message.subscriptions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscriptions[i]); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListTopicSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {google.pubsub.v1.IListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSubscriptionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; + /** + * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSubscriptionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicSubscriptionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.subscriptions && message.subscriptions.length)) + message.subscriptions = []; + message.subscriptions.push(reader.string()); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; + /** + * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSubscriptionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; + /** + * Verifies a ListTopicSubscriptionsResponse message. + * @function verify + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicSubscriptionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscriptions != null && message.hasOwnProperty("subscriptions")) { + if (!Array.isArray(message.subscriptions)) + return "subscriptions: array expected"; + for (var i = 0; i < message.subscriptions.length; ++i) + if (!$util.isString(message.subscriptions[i])) + return "subscriptions: string[] expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; + /** + * Creates a ListTopicSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse + */ + ListTopicSubscriptionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicSubscriptionsResponse) + return object; + var message = new $root.google.pubsub.v1.ListTopicSubscriptionsResponse(); + if (object.subscriptions) { + if (!Array.isArray(object.subscriptions)) + throw TypeError(".google.pubsub.v1.ListTopicSubscriptionsResponse.subscriptions: array expected"); + message.subscriptions = []; + for (var i = 0; i < object.subscriptions.length; ++i) + message.subscriptions[i] = String(object.subscriptions[i]); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * FileOptions phpGenericServices. - * @member {boolean} phpGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpGenericServices = false; + /** + * Creates a plain object from a ListTopicSubscriptionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @static + * @param {google.pubsub.v1.ListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicSubscriptionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subscriptions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.subscriptions && message.subscriptions.length) { + object.subscriptions = []; + for (var j = 0; j < message.subscriptions.length; ++j) + object.subscriptions[j] = message.subscriptions[j]; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; + /** + * Converts this ListTopicSubscriptionsResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTopicSubscriptionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = false; + return ListTopicSubscriptionsResponse; + })(); - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; + v1.ListTopicSnapshotsRequest = (function() { - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; + /** + * Properties of a ListTopicSnapshotsRequest. + * @memberof google.pubsub.v1 + * @interface IListTopicSnapshotsRequest + * @property {string|null} [topic] ListTopicSnapshotsRequest topic + * @property {number|null} [pageSize] ListTopicSnapshotsRequest pageSize + * @property {string|null} [pageToken] ListTopicSnapshotsRequest pageToken + */ - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; + /** + * Constructs a new ListTopicSnapshotsRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicSnapshotsRequest. + * @implements IListTopicSnapshotsRequest + * @constructor + * @param {google.pubsub.v1.IListTopicSnapshotsRequest=} [properties] Properties to set + */ + function ListTopicSnapshotsRequest(properties) { + if (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 phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; + /** + * ListTopicSnapshotsRequest topic. + * @member {string} topic + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @instance + */ + ListTopicSnapshotsRequest.prototype.topic = ""; - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; + /** + * ListTopicSnapshotsRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @instance + */ + ListTopicSnapshotsRequest.prototype.pageSize = 0; - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; + /** + * ListTopicSnapshotsRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @instance + */ + ListTopicSnapshotsRequest.prototype.pageToken = ""; - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; + /** + * Creates a new ListTopicSnapshotsRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest instance + */ + ListTopicSnapshotsRequest.create = function create(properties) { + return new ListTopicSnapshotsRequest(properties); + }; - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Encodes the specified ListTopicSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsRequest} message ListTopicSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSnapshotsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && message.hasOwnProperty("topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + /** + * Encodes the specified ListTopicSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsRequest} message ListTopicSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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); - }; + /** + * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSnapshotsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicSnapshotsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.topic = 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; + }; - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; + /** + * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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(); - }; + /** + * Verifies a ListTopicSnapshotsRequest message. + * @function verify + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicSnapshotsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: 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 ListTopicSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest + */ + ListTopicSnapshotsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicSnapshotsRequest) + return object; + var message = new $root.google.pubsub.v1.ListTopicSnapshotsRequest(); + if (object.topic != null) + message.topic = String(object.topic); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.javaPackage = reader.string(); - break; - case 8: - message.javaOuterClassname = reader.string(); - break; - case 10: - message.javaMultipleFiles = reader.bool(); - break; - case 20: - message.javaGenerateEqualsAndHash = reader.bool(); - break; - case 27: - message.javaStringCheckUtf8 = reader.bool(); - break; - case 9: - message.optimizeFor = reader.int32(); - break; - case 11: - message.goPackage = reader.string(); - break; - case 16: - message.ccGenericServices = reader.bool(); - break; - case 17: - message.javaGenericServices = reader.bool(); - break; - case 18: - message.pyGenericServices = reader.bool(); - break; - case 42: - message.phpGenericServices = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.ccEnableArenas = reader.bool(); - break; - case 36: - message.objcClassPrefix = reader.string(); - break; - case 37: - message.csharpNamespace = reader.string(); - break; - case 39: - message.swiftPrefix = reader.string(); - break; - case 40: - message.phpClassPrefix = reader.string(); - break; - case 41: - message.phpNamespace = reader.string(); - break; - case 44: - message.phpMetadataNamespace = reader.string(); - break; - case 45: - message.rubyPackage = reader.string(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1053: - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Creates a plain object from a ListTopicSnapshotsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @static + * @param {google.pubsub.v1.ListTopicSnapshotsRequest} message ListTopicSnapshotsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicSnapshotsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topic = ""; + object.pageSize = 0; + object.pageToken = ""; } + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListTopicSnapshotsRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicSnapshotsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTopicSnapshotsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListTopicSnapshotsRequest; + })(); + + v1.ListTopicSnapshotsResponse = (function() { + + /** + * Properties of a ListTopicSnapshotsResponse. + * @memberof google.pubsub.v1 + * @interface IListTopicSnapshotsResponse + * @property {Array.|null} [snapshots] ListTopicSnapshotsResponse snapshots + * @property {string|null} [nextPageToken] ListTopicSnapshotsResponse nextPageToken + */ + + /** + * Constructs a new ListTopicSnapshotsResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListTopicSnapshotsResponse. + * @implements IListTopicSnapshotsResponse + * @constructor + * @param {google.pubsub.v1.IListTopicSnapshotsResponse=} [properties] Properties to set + */ + function ListTopicSnapshotsResponse(properties) { + this.snapshots = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return message; - }; - /** - * Decodes a 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()); - }; + /** + * ListTopicSnapshotsResponse snapshots. + * @member {Array.} snapshots + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @instance + */ + ListTopicSnapshotsResponse.prototype.snapshots = $util.emptyArray; - /** - * 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; + /** + * ListTopicSnapshotsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @instance + */ + ListTopicSnapshotsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTopicSnapshotsResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse instance + */ + ListTopicSnapshotsResponse.create = function create(properties) { + return new ListTopicSnapshotsResponse(properties); + }; + + /** + * Encodes the specified ListTopicSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsResponse} message ListTopicSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSnapshotsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshots != null && message.snapshots.length) + for (var i = 0; i < message.snapshots.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshots[i]); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListTopicSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {google.pubsub.v1.IListTopicSnapshotsResponse} message ListTopicSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTopicSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSnapshotsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicSnapshotsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.snapshots && message.snapshots.length)) + message.snapshots = []; + message.snapshots.push(reader.string()); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - if (typeof message.phpGenericServices !== "boolean") - return "phpGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; + return message; + }; + + /** + * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTopicSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTopicSnapshotsResponse message. + * @function verify + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTopicSnapshotsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshots != null && message.hasOwnProperty("snapshots")) { + if (!Array.isArray(message.snapshots)) + return "snapshots: array expected"; + for (var i = 0; i < message.snapshots.length; ++i) + if (!$util.isString(message.snapshots[i])) + return "snapshots: string[] expected"; } - } - 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; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTopicSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse + */ + ListTopicSnapshotsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListTopicSnapshotsResponse) + return object; + var message = new $root.google.pubsub.v1.ListTopicSnapshotsResponse(); + if (object.snapshots) { + if (!Array.isArray(object.snapshots)) + throw TypeError(".google.pubsub.v1.ListTopicSnapshotsResponse.snapshots: array expected"); + message.snapshots = []; + for (var i = 0; i < object.snapshots.length; ++i) + message.snapshots[i] = String(object.snapshots[i]); } - } - return null; - }; + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.phpGenericServices != null) - message.phpGenericServices = Boolean(object.phpGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + /** + * Creates a plain object from a ListTopicSnapshotsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @static + * @param {google.pubsub.v1.ListTopicSnapshotsResponse} message ListTopicSnapshotsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTopicSnapshotsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.snapshots = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.snapshots && message.snapshots.length) { + object.snapshots = []; + for (var j = 0; j < message.snapshots.length; ++j) + object.snapshots[j] = message.snapshots[j]; } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTopicSnapshotsResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ListTopicSnapshotsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTopicSnapshotsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListTopicSnapshotsResponse; + })(); + + v1.DeleteTopicRequest = (function() { + + /** + * Properties of a DeleteTopicRequest. + * @memberof google.pubsub.v1 + * @interface IDeleteTopicRequest + * @property {string|null} [topic] DeleteTopicRequest topic + */ + + /** + * Constructs a new DeleteTopicRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a DeleteTopicRequest. + * @implements IDeleteTopicRequest + * @constructor + * @param {google.pubsub.v1.IDeleteTopicRequest=} [properties] Properties to set + */ + function DeleteTopicRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - if (object[".google.api.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]); + + /** + * DeleteTopicRequest topic. + * @member {string} topic + * @memberof google.pubsub.v1.DeleteTopicRequest + * @instance + */ + DeleteTopicRequest.prototype.topic = ""; + + /** + * Creates a new DeleteTopicRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {google.pubsub.v1.IDeleteTopicRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest instance + */ + DeleteTopicRequest.create = function create(properties) { + return new DeleteTopicRequest(properties); + }; + + /** + * Encodes the specified DeleteTopicRequest message. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {google.pubsub.v1.IDeleteTopicRequest} message DeleteTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTopicRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && message.hasOwnProperty("topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + return writer; + }; + + /** + * Encodes the specified DeleteTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {google.pubsub.v1.IDeleteTopicRequest} message DeleteTopicRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTopicRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTopicRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTopicRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeleteTopicRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.topic = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + 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 = false; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpGenericServices = false; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - object.phpGenericServices = message.phpGenericServices; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; + /** + * Decodes a DeleteTopicRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTopicRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTopicRequest message. + * @function verify + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTopicRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + return null; + }; - /** - * 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); - }; + /** + * Creates a DeleteTopicRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest + */ + DeleteTopicRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DeleteTopicRequest) + return object; + var message = new $root.google.pubsub.v1.DeleteTopicRequest(); + if (object.topic != null) + message.topic = String(object.topic); + return message; + }; - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {string} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; + /** + * Creates a plain object from a DeleteTopicRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DeleteTopicRequest + * @static + * @param {google.pubsub.v1.DeleteTopicRequest} message DeleteTopicRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTopicRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + return object; + }; + + /** + * Converts this DeleteTopicRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DeleteTopicRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTopicRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteTopicRequest; })(); - return FileOptions; - })(); + v1.Subscriber = (function() { - protobuf.MessageOptions = (function() { + /** + * Constructs a new Subscriber service. + * @memberof google.pubsub.v1 + * @classdesc Represents a Subscriber + * @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 Subscriber(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ + (Subscriber.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Subscriber; - /** - * 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]]; - } + /** + * Creates new Subscriber service using the specified rpc implementation. + * @function create + * @memberof google.pubsub.v1.Subscriber + * @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 {Subscriber} RPC service. Useful where requests and/or responses are streamed. + */ + Subscriber.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#createSubscription}. + * @memberof google.pubsub.v1.Subscriber + * @typedef CreateSubscriptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Subscription} [response] Subscription + */ - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; + /** + * Calls CreateSubscription. + * @function createSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ISubscription} request Subscription message or plain object + * @param {google.pubsub.v1.Subscriber.CreateSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.createSubscription = function createSubscription(request, callback) { + return this.rpcCall(createSubscription, $root.google.pubsub.v1.Subscription, $root.google.pubsub.v1.Subscription, request, callback); + }, "name", { value: "CreateSubscription" }); - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; + /** + * Calls CreateSubscription. + * @function createSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ISubscription} request Subscription message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#getSubscription}. + * @memberof google.pubsub.v1.Subscriber + * @typedef GetSubscriptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Subscription} [response] Subscription + */ + + /** + * Calls GetSubscription. + * @function getSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IGetSubscriptionRequest} request GetSubscriptionRequest message or plain object + * @param {google.pubsub.v1.Subscriber.GetSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.getSubscription = function getSubscription(request, callback) { + return this.rpcCall(getSubscription, $root.google.pubsub.v1.GetSubscriptionRequest, $root.google.pubsub.v1.Subscription, request, callback); + }, "name", { value: "GetSubscription" }); + + /** + * Calls GetSubscription. + * @function getSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IGetSubscriptionRequest} request GetSubscriptionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#updateSubscription}. + * @memberof google.pubsub.v1.Subscriber + * @typedef UpdateSubscriptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Subscription} [response] Subscription + */ + + /** + * Calls UpdateSubscription. + * @function updateSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IUpdateSubscriptionRequest} request UpdateSubscriptionRequest message or plain object + * @param {google.pubsub.v1.Subscriber.UpdateSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.updateSubscription = function updateSubscription(request, callback) { + return this.rpcCall(updateSubscription, $root.google.pubsub.v1.UpdateSubscriptionRequest, $root.google.pubsub.v1.Subscription, request, callback); + }, "name", { value: "UpdateSubscription" }); + + /** + * Calls UpdateSubscription. + * @function updateSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IUpdateSubscriptionRequest} request UpdateSubscriptionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#listSubscriptions}. + * @memberof google.pubsub.v1.Subscriber + * @typedef ListSubscriptionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListSubscriptionsResponse} [response] ListSubscriptionsResponse + */ - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Calls ListSubscriptions. + * @function listSubscriptions + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IListSubscriptionsRequest} request ListSubscriptionsRequest message or plain object + * @param {google.pubsub.v1.Subscriber.ListSubscriptionsCallback} callback Node-style callback called with the error, if any, and ListSubscriptionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.listSubscriptions = function listSubscriptions(request, callback) { + return this.rpcCall(listSubscriptions, $root.google.pubsub.v1.ListSubscriptionsRequest, $root.google.pubsub.v1.ListSubscriptionsResponse, request, callback); + }, "name", { value: "ListSubscriptions" }); - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; + /** + * Calls ListSubscriptions. + * @function listSubscriptions + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IListSubscriptionsRequest} request ListSubscriptionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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); - }; + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#deleteSubscription}. + * @memberof google.pubsub.v1.Subscriber + * @typedef DeleteSubscriptionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; + /** + * Calls DeleteSubscription. + * @function deleteSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IDeleteSubscriptionRequest} request DeleteSubscriptionRequest message or plain object + * @param {google.pubsub.v1.Subscriber.DeleteSubscriptionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.deleteSubscription = function deleteSubscription(request, callback) { + return this.rpcCall(deleteSubscription, $root.google.pubsub.v1.DeleteSubscriptionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSubscription" }); - /** - * 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(); - }; + /** + * Calls DeleteSubscription. + * @function deleteSubscription + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IDeleteSubscriptionRequest} request DeleteSubscriptionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.messageSetWireFormat = reader.bool(); - break; - case 2: - message.noStandardDescriptorAccessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.mapEntry = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1053: - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#modifyAckDeadline}. + * @memberof google.pubsub.v1.Subscriber + * @typedef ModifyAckDeadlineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - /** - * 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()); - }; + /** + * Calls ModifyAckDeadline. + * @function modifyAckDeadline + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IModifyAckDeadlineRequest} request ModifyAckDeadlineRequest message or plain object + * @param {google.pubsub.v1.Subscriber.ModifyAckDeadlineCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.modifyAckDeadline = function modifyAckDeadline(request, callback) { + return this.rpcCall(modifyAckDeadline, $root.google.pubsub.v1.ModifyAckDeadlineRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "ModifyAckDeadline" }); - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; + /** + * Calls ModifyAckDeadline. + * @function modifyAckDeadline + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IModifyAckDeadlineRequest} request ModifyAckDeadlineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#acknowledge}. + * @memberof google.pubsub.v1.Subscriber + * @typedef AcknowledgeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; + /** + * Calls Acknowledge. + * @function acknowledge + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IAcknowledgeRequest} request AcknowledgeRequest message or plain object + * @param {google.pubsub.v1.Subscriber.AcknowledgeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.acknowledge = function acknowledge(request, callback) { + return this.rpcCall(acknowledge, $root.google.pubsub.v1.AcknowledgeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "Acknowledge" }); - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; + /** + * Calls Acknowledge. + * @function acknowledge + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IAcknowledgeRequest} request AcknowledgeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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); - }; + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#pull}. + * @memberof google.pubsub.v1.Subscriber + * @typedef PullCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.PullResponse} [response] PullResponse + */ - return MessageOptions; - })(); + /** + * Calls Pull. + * @function pull + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IPullRequest} request PullRequest message or plain object + * @param {google.pubsub.v1.Subscriber.PullCallback} callback Node-style callback called with the error, if any, and PullResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.pull = function pull(request, callback) { + return this.rpcCall(pull, $root.google.pubsub.v1.PullRequest, $root.google.pubsub.v1.PullResponse, request, callback); + }, "name", { value: "Pull" }); - protobuf.FieldOptions = (function() { + /** + * Calls Pull. + * @function pull + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IPullRequest} request PullRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#streamingPull}. + * @memberof google.pubsub.v1.Subscriber + * @typedef StreamingPullCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.StreamingPullResponse} [response] StreamingPullResponse + */ - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Calls StreamingPull. + * @function streamingPull + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IStreamingPullRequest} request StreamingPullRequest message or plain object + * @param {google.pubsub.v1.Subscriber.StreamingPullCallback} callback Node-style callback called with the error, if any, and StreamingPullResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.streamingPull = function streamingPull(request, callback) { + return this.rpcCall(streamingPull, $root.google.pubsub.v1.StreamingPullRequest, $root.google.pubsub.v1.StreamingPullResponse, request, callback); + }, "name", { value: "StreamingPull" }); - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; + /** + * Calls StreamingPull. + * @function streamingPull + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IStreamingPullRequest} request StreamingPullRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#modifyPushConfig}. + * @memberof google.pubsub.v1.Subscriber + * @typedef ModifyPushConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; + /** + * Calls ModifyPushConfig. + * @function modifyPushConfig + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IModifyPushConfigRequest} request ModifyPushConfigRequest message or plain object + * @param {google.pubsub.v1.Subscriber.ModifyPushConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.modifyPushConfig = function modifyPushConfig(request, callback) { + return this.rpcCall(modifyPushConfig, $root.google.pubsub.v1.ModifyPushConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "ModifyPushConfig" }); + + /** + * Calls ModifyPushConfig. + * @function modifyPushConfig + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IModifyPushConfigRequest} request ModifyPushConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#getSnapshot}. + * @memberof google.pubsub.v1.Subscriber + * @typedef GetSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Snapshot} [response] Snapshot + */ - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; + /** + * Calls GetSnapshot. + * @function getSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IGetSnapshotRequest} request GetSnapshotRequest message or plain object + * @param {google.pubsub.v1.Subscriber.GetSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.getSnapshot = function getSnapshot(request, callback) { + return this.rpcCall(getSnapshot, $root.google.pubsub.v1.GetSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback); + }, "name", { value: "GetSnapshot" }); - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; + /** + * Calls GetSnapshot. + * @function getSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IGetSnapshotRequest} request GetSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#listSnapshots}. + * @memberof google.pubsub.v1.Subscriber + * @typedef ListSnapshotsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.ListSnapshotsResponse} [response] ListSnapshotsResponse + */ - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object + * @param {google.pubsub.v1.Subscriber.ListSnapshotsCallback} callback Node-style callback called with the error, if any, and ListSnapshotsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.listSnapshots = function listSnapshots(request, callback) { + return this.rpcCall(listSnapshots, $root.google.pubsub.v1.ListSnapshotsRequest, $root.google.pubsub.v1.ListSnapshotsResponse, request, callback); + }, "name", { value: "ListSnapshots" }); - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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); - }; + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#createSnapshot}. + * @memberof google.pubsub.v1.Subscriber + * @typedef CreateSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Snapshot} [response] Snapshot + */ - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && message.hasOwnProperty("ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && message.hasOwnProperty("packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && message.hasOwnProperty("lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && message.hasOwnProperty("jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && message.hasOwnProperty("weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { - writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.int32(message[".google.api.fieldBehavior"][i]); - writer.ldelim(); - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - return writer; - }; + /** + * Calls CreateSnapshot. + * @function createSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ICreateSnapshotRequest} request CreateSnapshotRequest message or plain object + * @param {google.pubsub.v1.Subscriber.CreateSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.createSnapshot = function createSnapshot(request, callback) { + return this.rpcCall(createSnapshot, $root.google.pubsub.v1.CreateSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback); + }, "name", { value: "CreateSnapshot" }); - /** - * 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(); - }; + /** + * Calls CreateSnapshot. + * @function createSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ICreateSnapshotRequest} request CreateSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ctype = reader.int32(); - break; - case 2: - message.packed = reader.bool(); - break; - case 6: - message.jstype = reader.int32(); - break; - case 5: - message.lazy = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 10: - message.weak = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1052: - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - case 1055: - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#updateSnapshot}. + * @memberof google.pubsub.v1.Subscriber + * @typedef UpdateSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.Snapshot} [response] Snapshot + */ - /** - * 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()); - }; + /** + * Calls UpdateSnapshot. + * @function updateSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IUpdateSnapshotRequest} request UpdateSnapshotRequest message or plain object + * @param {google.pubsub.v1.Subscriber.UpdateSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.updateSnapshot = function updateSnapshot(request, callback) { + return this.rpcCall(updateSnapshot, $root.google.pubsub.v1.UpdateSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback); + }, "name", { value: "UpdateSnapshot" }); - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; + /** + * Calls UpdateSnapshot. + * @function updateSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IUpdateSnapshotRequest} request UpdateSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - } - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - return message; - }; + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#deleteSnapshot}. + * @memberof google.pubsub.v1.Subscriber + * @typedef DeleteSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSnapshot. + * @function deleteSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object + * @param {google.pubsub.v1.Subscriber.DeleteSnapshotCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.deleteSnapshot = function deleteSnapshot(request, callback) { + return this.rpcCall(deleteSnapshot, $root.google.pubsub.v1.DeleteSnapshotRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSnapshot" }); + + /** + * Calls DeleteSnapshot. + * @function deleteSnapshot + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.pubsub.v1.Subscriber#seek}. + * @memberof google.pubsub.v1.Subscriber + * @typedef SeekCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.pubsub.v1.SeekResponse} [response] SeekResponse + */ + + /** + * Calls Seek. + * @function seek + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ISeekRequest} request SeekRequest message or plain object + * @param {google.pubsub.v1.Subscriber.SeekCallback} callback Node-style callback called with the error, if any, and SeekResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subscriber.prototype.seek = function seek(request, callback) { + return this.rpcCall(seek, $root.google.pubsub.v1.SeekRequest, $root.google.pubsub.v1.SeekResponse, request, callback); + }, "name", { value: "Seek" }); - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object[".google.api.resourceReference"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + /** + * Calls Seek. + * @function seek + * @memberof google.pubsub.v1.Subscriber + * @instance + * @param {google.pubsub.v1.ISeekRequest} request SeekRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Subscriber; + })(); + + v1.Subscription = (function() { + + /** + * Properties of a Subscription. + * @memberof google.pubsub.v1 + * @interface ISubscription + * @property {string|null} [name] Subscription name + * @property {string|null} [topic] Subscription topic + * @property {google.pubsub.v1.IPushConfig|null} [pushConfig] Subscription pushConfig + * @property {number|null} [ackDeadlineSeconds] Subscription ackDeadlineSeconds + * @property {boolean|null} [retainAckedMessages] Subscription retainAckedMessages + * @property {google.protobuf.IDuration|null} [messageRetentionDuration] Subscription messageRetentionDuration + * @property {Object.|null} [labels] Subscription labels + * @property {boolean|null} [enableMessageOrdering] Subscription enableMessageOrdering + * @property {google.pubsub.v1.IExpirationPolicy|null} [expirationPolicy] Subscription expirationPolicy + * @property {string|null} [filter] Subscription filter + * @property {google.pubsub.v1.IDeadLetterPolicy|null} [deadLetterPolicy] Subscription deadLetterPolicy + * @property {google.pubsub.v1.IRetryPolicy|null} [retryPolicy] Subscription retryPolicy + */ + + /** + * Constructs a new Subscription. + * @memberof google.pubsub.v1 + * @classdesc Represents a Subscription. + * @implements ISubscription + * @constructor + * @param {google.pubsub.v1.ISubscription=} [properties] Properties to set + */ + function Subscription(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]]; } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - return object; - }; - /** - * Converts this 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); - }; + /** + * Subscription name. + * @member {string} name + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.name = ""; - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {string} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); + /** + * Subscription topic. + * @member {string} topic + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.topic = ""; - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {string} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); + /** + * Subscription pushConfig. + * @member {google.pubsub.v1.IPushConfig|null|undefined} pushConfig + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.pushConfig = null; + + /** + * Subscription ackDeadlineSeconds. + * @member {number} ackDeadlineSeconds + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.ackDeadlineSeconds = 0; + + /** + * Subscription retainAckedMessages. + * @member {boolean} retainAckedMessages + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.retainAckedMessages = false; + + /** + * Subscription messageRetentionDuration. + * @member {google.protobuf.IDuration|null|undefined} messageRetentionDuration + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.messageRetentionDuration = null; + + /** + * Subscription labels. + * @member {Object.} labels + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.labels = $util.emptyObject; + + /** + * Subscription enableMessageOrdering. + * @member {boolean} enableMessageOrdering + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.enableMessageOrdering = false; + + /** + * Subscription expirationPolicy. + * @member {google.pubsub.v1.IExpirationPolicy|null|undefined} expirationPolicy + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.expirationPolicy = null; + + /** + * Subscription filter. + * @member {string} filter + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.filter = ""; + + /** + * Subscription deadLetterPolicy. + * @member {google.pubsub.v1.IDeadLetterPolicy|null|undefined} deadLetterPolicy + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.deadLetterPolicy = null; + + /** + * Subscription retryPolicy. + * @member {google.pubsub.v1.IRetryPolicy|null|undefined} retryPolicy + * @memberof google.pubsub.v1.Subscription + * @instance + */ + Subscription.prototype.retryPolicy = null; + + /** + * Creates a new Subscription instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.Subscription + * @static + * @param {google.pubsub.v1.ISubscription=} [properties] Properties to set + * @returns {google.pubsub.v1.Subscription} Subscription instance + */ + Subscription.create = function create(properties) { + return new Subscription(properties); + }; + + /** + * Encodes the specified Subscription message. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.Subscription + * @static + * @param {google.pubsub.v1.ISubscription} message Subscription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subscription.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.topic != null && message.hasOwnProperty("topic")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.topic); + if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) + $root.google.pubsub.v1.PushConfig.encode(message.pushConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.ackDeadlineSeconds); + if (message.retainAckedMessages != null && message.hasOwnProperty("retainAckedMessages")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.retainAckedMessages); + if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) + $root.google.protobuf.Duration.encode(message.messageRetentionDuration, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.labels != null && message.hasOwnProperty("labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 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(); + if (message.enableMessageOrdering != null && message.hasOwnProperty("enableMessageOrdering")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.enableMessageOrdering); + if (message.expirationPolicy != null && message.hasOwnProperty("expirationPolicy")) + $root.google.pubsub.v1.ExpirationPolicy.encode(message.expirationPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.filter); + if (message.deadLetterPolicy != null && message.hasOwnProperty("deadLetterPolicy")) + $root.google.pubsub.v1.DeadLetterPolicy.encode(message.deadLetterPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.retryPolicy != null && message.hasOwnProperty("retryPolicy")) + $root.google.pubsub.v1.RetryPolicy.encode(message.retryPolicy, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; - return FieldOptions; - })(); + /** + * Encodes the specified Subscription message, length delimited. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.Subscription + * @static + * @param {google.pubsub.v1.ISubscription} message Subscription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subscription.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - protobuf.OneofOptions = (function() { + /** + * Decodes a Subscription message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.Subscription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.Subscription} Subscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subscription.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.Subscription(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.topic = reader.string(); + break; + case 4: + message.pushConfig = $root.google.pubsub.v1.PushConfig.decode(reader, reader.uint32()); + break; + case 5: + message.ackDeadlineSeconds = reader.int32(); + break; + case 7: + message.retainAckedMessages = reader.bool(); + break; + case 8: + message.messageRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 9: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + break; + case 10: + message.enableMessageOrdering = reader.bool(); + break; + case 11: + message.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.decode(reader, reader.uint32()); + break; + case 12: + message.filter = reader.string(); + break; + case 13: + message.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.decode(reader, reader.uint32()); + break; + case 14: + message.retryPolicy = $root.google.pubsub.v1.RetryPolicy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ + /** + * Decodes a Subscription message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.Subscription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.Subscription} Subscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subscription.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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]]; - } + /** + * Verifies a Subscription message. + * @function verify + * @memberof google.pubsub.v1.Subscription + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Subscription.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.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) { + var error = $root.google.pubsub.v1.PushConfig.verify(message.pushConfig); + if (error) + return "pushConfig." + error; + } + if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) + if (!$util.isInteger(message.ackDeadlineSeconds)) + return "ackDeadlineSeconds: integer expected"; + if (message.retainAckedMessages != null && message.hasOwnProperty("retainAckedMessages")) + if (typeof message.retainAckedMessages !== "boolean") + return "retainAckedMessages: boolean expected"; + if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) { + var error = $root.google.protobuf.Duration.verify(message.messageRetentionDuration); + if (error) + return "messageRetentionDuration." + 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.enableMessageOrdering != null && message.hasOwnProperty("enableMessageOrdering")) + if (typeof message.enableMessageOrdering !== "boolean") + return "enableMessageOrdering: boolean expected"; + if (message.expirationPolicy != null && message.hasOwnProperty("expirationPolicy")) { + var error = $root.google.pubsub.v1.ExpirationPolicy.verify(message.expirationPolicy); + if (error) + return "expirationPolicy." + error; + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.deadLetterPolicy != null && message.hasOwnProperty("deadLetterPolicy")) { + var error = $root.google.pubsub.v1.DeadLetterPolicy.verify(message.deadLetterPolicy); + if (error) + return "deadLetterPolicy." + error; + } + if (message.retryPolicy != null && message.hasOwnProperty("retryPolicy")) { + var error = $root.google.pubsub.v1.RetryPolicy.verify(message.retryPolicy); + if (error) + return "retryPolicy." + error; + } + return null; + }; - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Creates a Subscription message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.Subscription + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.Subscription} Subscription + */ + Subscription.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.Subscription) + return object; + var message = new $root.google.pubsub.v1.Subscription(); + if (object.name != null) + message.name = String(object.name); + if (object.topic != null) + message.topic = String(object.topic); + if (object.pushConfig != null) { + if (typeof object.pushConfig !== "object") + throw TypeError(".google.pubsub.v1.Subscription.pushConfig: object expected"); + message.pushConfig = $root.google.pubsub.v1.PushConfig.fromObject(object.pushConfig); + } + if (object.ackDeadlineSeconds != null) + message.ackDeadlineSeconds = object.ackDeadlineSeconds | 0; + if (object.retainAckedMessages != null) + message.retainAckedMessages = Boolean(object.retainAckedMessages); + if (object.messageRetentionDuration != null) { + if (typeof object.messageRetentionDuration !== "object") + throw TypeError(".google.pubsub.v1.Subscription.messageRetentionDuration: object expected"); + message.messageRetentionDuration = $root.google.protobuf.Duration.fromObject(object.messageRetentionDuration); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.pubsub.v1.Subscription.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.enableMessageOrdering != null) + message.enableMessageOrdering = Boolean(object.enableMessageOrdering); + if (object.expirationPolicy != null) { + if (typeof object.expirationPolicy !== "object") + throw TypeError(".google.pubsub.v1.Subscription.expirationPolicy: object expected"); + message.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.fromObject(object.expirationPolicy); + } + if (object.filter != null) + message.filter = String(object.filter); + if (object.deadLetterPolicy != null) { + if (typeof object.deadLetterPolicy !== "object") + throw TypeError(".google.pubsub.v1.Subscription.deadLetterPolicy: object expected"); + message.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.fromObject(object.deadLetterPolicy); + } + if (object.retryPolicy != null) { + if (typeof object.retryPolicy !== "object") + throw TypeError(".google.pubsub.v1.Subscription.retryPolicy: object expected"); + message.retryPolicy = $root.google.pubsub.v1.RetryPolicy.fromObject(object.retryPolicy); + } + return message; + }; - /** - * 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); - }; + /** + * Creates a plain object from a Subscription message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.Subscription + * @static + * @param {google.pubsub.v1.Subscription} message Subscription + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Subscription.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.topic = ""; + object.pushConfig = null; + object.ackDeadlineSeconds = 0; + object.retainAckedMessages = false; + object.messageRetentionDuration = null; + object.enableMessageOrdering = false; + object.expirationPolicy = null; + object.filter = ""; + object.deadLetterPolicy = null; + object.retryPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) + object.pushConfig = $root.google.pubsub.v1.PushConfig.toObject(message.pushConfig, options); + if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) + object.ackDeadlineSeconds = message.ackDeadlineSeconds; + if (message.retainAckedMessages != null && message.hasOwnProperty("retainAckedMessages")) + object.retainAckedMessages = message.retainAckedMessages; + if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) + object.messageRetentionDuration = $root.google.protobuf.Duration.toObject(message.messageRetentionDuration, 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.enableMessageOrdering != null && message.hasOwnProperty("enableMessageOrdering")) + object.enableMessageOrdering = message.enableMessageOrdering; + if (message.expirationPolicy != null && message.hasOwnProperty("expirationPolicy")) + object.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.toObject(message.expirationPolicy, options); + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.deadLetterPolicy != null && message.hasOwnProperty("deadLetterPolicy")) + object.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.toObject(message.deadLetterPolicy, options); + if (message.retryPolicy != null && message.hasOwnProperty("retryPolicy")) + object.retryPolicy = $root.google.pubsub.v1.RetryPolicy.toObject(message.retryPolicy, options); + return object; + }; - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; + /** + * Converts this Subscription to JSON. + * @function toJSON + * @memberof google.pubsub.v1.Subscription + * @instance + * @returns {Object.} JSON object + */ + Subscription.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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(); - }; + return Subscription; + })(); - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + v1.RetryPolicy = (function() { - /** - * 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()); - }; + /** + * Properties of a RetryPolicy. + * @memberof google.pubsub.v1 + * @interface IRetryPolicy + * @property {google.protobuf.IDuration|null} [minimumBackoff] RetryPolicy minimumBackoff + * @property {google.protobuf.IDuration|null} [maximumBackoff] RetryPolicy maximumBackoff + */ - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } + /** + * Constructs a new RetryPolicy. + * @memberof google.pubsub.v1 + * @classdesc Represents a RetryPolicy. + * @implements IRetryPolicy + * @constructor + * @param {google.pubsub.v1.IRetryPolicy=} [properties] Properties to set + */ + function RetryPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return 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.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; - }; + /** + * RetryPolicy minimumBackoff. + * @member {google.protobuf.IDuration|null|undefined} minimumBackoff + * @memberof google.pubsub.v1.RetryPolicy + * @instance + */ + RetryPolicy.prototype.minimumBackoff = null; - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; + /** + * RetryPolicy maximumBackoff. + * @member {google.protobuf.IDuration|null|undefined} maximumBackoff + * @memberof google.pubsub.v1.RetryPolicy + * @instance + */ + RetryPolicy.prototype.maximumBackoff = null; - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new RetryPolicy instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {google.pubsub.v1.IRetryPolicy=} [properties] Properties to set + * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy instance + */ + RetryPolicy.create = function create(properties) { + return new RetryPolicy(properties); + }; + + /** + * Encodes the specified RetryPolicy message. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {google.pubsub.v1.IRetryPolicy} message RetryPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minimumBackoff != null && message.hasOwnProperty("minimumBackoff")) + $root.google.protobuf.Duration.encode(message.minimumBackoff, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maximumBackoff != null && message.hasOwnProperty("maximumBackoff")) + $root.google.protobuf.Duration.encode(message.maximumBackoff, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - return OneofOptions; - })(); + /** + * Encodes the specified RetryPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {google.pubsub.v1.IRetryPolicy} message RetryPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - protobuf.EnumOptions = (function() { + /** + * Decodes a RetryPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.RetryPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minimumBackoff = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 2: + message.maximumBackoff = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ + /** + * Decodes a RetryPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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]]; - } + /** + * Verifies a RetryPolicy message. + * @function verify + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetryPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minimumBackoff != null && message.hasOwnProperty("minimumBackoff")) { + var error = $root.google.protobuf.Duration.verify(message.minimumBackoff); + if (error) + return "minimumBackoff." + error; + } + if (message.maximumBackoff != null && message.hasOwnProperty("maximumBackoff")) { + var error = $root.google.protobuf.Duration.verify(message.maximumBackoff); + if (error) + return "maximumBackoff." + error; + } + return null; + }; - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; + /** + * Creates a RetryPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy + */ + RetryPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.RetryPolicy) + return object; + var message = new $root.google.pubsub.v1.RetryPolicy(); + if (object.minimumBackoff != null) { + if (typeof object.minimumBackoff !== "object") + throw TypeError(".google.pubsub.v1.RetryPolicy.minimumBackoff: object expected"); + message.minimumBackoff = $root.google.protobuf.Duration.fromObject(object.minimumBackoff); + } + if (object.maximumBackoff != null) { + if (typeof object.maximumBackoff !== "object") + throw TypeError(".google.pubsub.v1.RetryPolicy.maximumBackoff: object expected"); + message.maximumBackoff = $root.google.protobuf.Duration.fromObject(object.maximumBackoff); + } + return message; + }; - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; + /** + * Creates a plain object from a RetryPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.RetryPolicy + * @static + * @param {google.pubsub.v1.RetryPolicy} message RetryPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetryPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minimumBackoff = null; + object.maximumBackoff = null; + } + if (message.minimumBackoff != null && message.hasOwnProperty("minimumBackoff")) + object.minimumBackoff = $root.google.protobuf.Duration.toObject(message.minimumBackoff, options); + if (message.maximumBackoff != null && message.hasOwnProperty("maximumBackoff")) + object.maximumBackoff = $root.google.protobuf.Duration.toObject(message.maximumBackoff, options); + return object; + }; - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Converts this RetryPolicy to JSON. + * @function toJSON + * @memberof google.pubsub.v1.RetryPolicy + * @instance + * @returns {Object.} JSON object + */ + RetryPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + return RetryPolicy; + })(); - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; + v1.DeadLetterPolicy = (function() { - /** - * 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(); - }; + /** + * Properties of a DeadLetterPolicy. + * @memberof google.pubsub.v1 + * @interface IDeadLetterPolicy + * @property {string|null} [deadLetterTopic] DeadLetterPolicy deadLetterTopic + * @property {number|null} [maxDeliveryAttempts] DeadLetterPolicy maxDeliveryAttempts + */ - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allowAlias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Constructs a new DeadLetterPolicy. + * @memberof google.pubsub.v1 + * @classdesc Represents a DeadLetterPolicy. + * @implements IDeadLetterPolicy + * @constructor + * @param {google.pubsub.v1.IDeadLetterPolicy=} [properties] Properties to set + */ + function DeadLetterPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return message; - }; - /** - * Decodes an 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()); - }; + /** + * DeadLetterPolicy deadLetterTopic. + * @member {string} deadLetterTopic + * @memberof google.pubsub.v1.DeadLetterPolicy + * @instance + */ + DeadLetterPolicy.prototype.deadLetterTopic = ""; + + /** + * DeadLetterPolicy maxDeliveryAttempts. + * @member {number} maxDeliveryAttempts + * @memberof google.pubsub.v1.DeadLetterPolicy + * @instance + */ + DeadLetterPolicy.prototype.maxDeliveryAttempts = 0; + + /** + * Creates a new DeadLetterPolicy instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {google.pubsub.v1.IDeadLetterPolicy=} [properties] Properties to set + * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy instance + */ + DeadLetterPolicy.create = function create(properties) { + return new DeadLetterPolicy(properties); + }; + + /** + * Encodes the specified DeadLetterPolicy message. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {google.pubsub.v1.IDeadLetterPolicy} message DeadLetterPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeadLetterPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deadLetterTopic != null && message.hasOwnProperty("deadLetterTopic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.deadLetterTopic); + if (message.maxDeliveryAttempts != null && message.hasOwnProperty("maxDeliveryAttempts")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxDeliveryAttempts); + return writer; + }; - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; + /** + * Encodes the specified DeadLetterPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {google.pubsub.v1.IDeadLetterPolicy} message DeadLetterPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeadLetterPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + /** + * Decodes a DeadLetterPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeadLetterPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeadLetterPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deadLetterTopic = reader.string(); + break; + case 2: + message.maxDeliveryAttempts = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + 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; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; + /** + * Decodes a DeadLetterPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeadLetterPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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); - }; + /** + * Verifies a DeadLetterPolicy message. + * @function verify + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeadLetterPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deadLetterTopic != null && message.hasOwnProperty("deadLetterTopic")) + if (!$util.isString(message.deadLetterTopic)) + return "deadLetterTopic: string expected"; + if (message.maxDeliveryAttempts != null && message.hasOwnProperty("maxDeliveryAttempts")) + if (!$util.isInteger(message.maxDeliveryAttempts)) + return "maxDeliveryAttempts: integer expected"; + return null; + }; + + /** + * Creates a DeadLetterPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy + */ + DeadLetterPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DeadLetterPolicy) + return object; + var message = new $root.google.pubsub.v1.DeadLetterPolicy(); + if (object.deadLetterTopic != null) + message.deadLetterTopic = String(object.deadLetterTopic); + if (object.maxDeliveryAttempts != null) + message.maxDeliveryAttempts = object.maxDeliveryAttempts | 0; + return message; + }; + + /** + * Creates a plain object from a DeadLetterPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DeadLetterPolicy + * @static + * @param {google.pubsub.v1.DeadLetterPolicy} message DeadLetterPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeadLetterPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deadLetterTopic = ""; + object.maxDeliveryAttempts = 0; + } + if (message.deadLetterTopic != null && message.hasOwnProperty("deadLetterTopic")) + object.deadLetterTopic = message.deadLetterTopic; + if (message.maxDeliveryAttempts != null && message.hasOwnProperty("maxDeliveryAttempts")) + object.maxDeliveryAttempts = message.maxDeliveryAttempts; + return object; + }; - return EnumOptions; - })(); + /** + * Converts this DeadLetterPolicy to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DeadLetterPolicy + * @instance + * @returns {Object.} JSON object + */ + DeadLetterPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - protobuf.EnumValueOptions = (function() { + return DeadLetterPolicy; + })(); - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ + v1.ExpirationPolicy = (function() { - /** - * 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]]; - } + /** + * Properties of an ExpirationPolicy. + * @memberof google.pubsub.v1 + * @interface IExpirationPolicy + * @property {google.protobuf.IDuration|null} [ttl] ExpirationPolicy ttl + */ - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; + /** + * Constructs a new ExpirationPolicy. + * @memberof google.pubsub.v1 + * @classdesc Represents an ExpirationPolicy. + * @implements IExpirationPolicy + * @constructor + * @param {google.pubsub.v1.IExpirationPolicy=} [properties] Properties to set + */ + function ExpirationPolicy(properties) { + if (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 uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * ExpirationPolicy ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.pubsub.v1.ExpirationPolicy + * @instance + */ + ExpirationPolicy.prototype.ttl = null; - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; + /** + * Creates a new ExpirationPolicy instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {google.pubsub.v1.IExpirationPolicy=} [properties] Properties to set + * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy instance + */ + ExpirationPolicy.create = function create(properties) { + return new ExpirationPolicy(properties); + }; - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified ExpirationPolicy message. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {google.pubsub.v1.IExpirationPolicy} message ExpirationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpirationPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ttl != null && message.hasOwnProperty("ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 1, wireType 2 =*/10).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(); - }; + /** + * Encodes the specified ExpirationPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {google.pubsub.v1.IExpirationPolicy} message ExpirationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpirationPolicy.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes an ExpirationPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpirationPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ExpirationPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ttl = $root.google.protobuf.Duration.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.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]); + return message; + }; + + /** + * Decodes an ExpirationPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpirationPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExpirationPolicy message. + * @function verify + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExpirationPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ttl != null && message.hasOwnProperty("ttl")) { + var error = $root.google.protobuf.Duration.verify(message.ttl); if (error) - return "uninterpretedOption." + error; + return "ttl." + error; } - } - return null; - }; + 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.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]); + /** + * Creates an ExpirationPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy + */ + ExpirationPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ExpirationPolicy) + return object; + var message = new $root.google.pubsub.v1.ExpirationPolicy(); + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.pubsub.v1.ExpirationPolicy.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); } - } - return message; - }; + 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; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; + /** + * Creates a plain object from an ExpirationPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ExpirationPolicy + * @static + * @param {google.pubsub.v1.ExpirationPolicy} message ExpirationPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExpirationPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.ttl = null; + if (message.ttl != null && message.hasOwnProperty("ttl")) + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, 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); - }; + /** + * Converts this ExpirationPolicy to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ExpirationPolicy + * @instance + * @returns {Object.} JSON object + */ + ExpirationPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return EnumValueOptions; - })(); + return ExpirationPolicy; + })(); - protobuf.ServiceOptions = (function() { + v1.PushConfig = (function() { - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - */ + /** + * Properties of a PushConfig. + * @memberof google.pubsub.v1 + * @interface IPushConfig + * @property {string|null} [pushEndpoint] PushConfig pushEndpoint + * @property {Object.|null} [attributes] PushConfig attributes + * @property {google.pubsub.v1.PushConfig.IOidcToken|null} [oidcToken] PushConfig oidcToken + */ - /** - * 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]]; - } + /** + * Constructs a new PushConfig. + * @memberof google.pubsub.v1 + * @classdesc Represents a PushConfig. + * @implements IPushConfig + * @constructor + * @param {google.pubsub.v1.IPushConfig=} [properties] Properties to set + */ + function PushConfig(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]]; + } - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; + /** + * PushConfig pushEndpoint. + * @member {string} pushEndpoint + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + PushConfig.prototype.pushEndpoint = ""; - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * PushConfig attributes. + * @member {Object.} attributes + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + PushConfig.prototype.attributes = $util.emptyObject; + + /** + * PushConfig oidcToken. + * @member {google.pubsub.v1.PushConfig.IOidcToken|null|undefined} oidcToken + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + PushConfig.prototype.oidcToken = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PushConfig authenticationMethod. + * @member {"oidcToken"|undefined} authenticationMethod + * @memberof google.pubsub.v1.PushConfig + * @instance + */ + Object.defineProperty(PushConfig.prototype, "authenticationMethod", { + get: $util.oneOfGetter($oneOfFields = ["oidcToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PushConfig instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {google.pubsub.v1.IPushConfig=} [properties] Properties to set + * @returns {google.pubsub.v1.PushConfig} PushConfig instance + */ + PushConfig.create = function create(properties) { + return new PushConfig(properties); + }; - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; + /** + * Encodes the specified PushConfig message. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {google.pubsub.v1.IPushConfig} message PushConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PushConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pushEndpoint != null && message.hasOwnProperty("pushEndpoint")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pushEndpoint); + if (message.attributes != null && message.hasOwnProperty("attributes")) + for (var keys = Object.keys(message.attributes), 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.attributes[keys[i]]).ldelim(); + if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) + $root.google.pubsub.v1.PushConfig.OidcToken.encode(message.oidcToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + /** + * Encodes the specified PushConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {google.pubsub.v1.IPushConfig} message PushConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PushConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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); - }; + /** + * Decodes a PushConfig message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PushConfig} PushConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PushConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PushConfig(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pushEndpoint = reader.string(); + break; + case 2: + reader.skip().pos++; + if (message.attributes === $util.emptyObject) + message.attributes = {}; + key = reader.string(); + reader.pos++; + message.attributes[key] = reader.string(); + break; + case 3: + message.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - return writer; - }; + /** + * Decodes a PushConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PushConfig} PushConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PushConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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(); - }; + /** + * Verifies a PushConfig message. + * @function verify + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PushConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.pushEndpoint != null && message.hasOwnProperty("pushEndpoint")) + if (!$util.isString(message.pushEndpoint)) + return "pushEndpoint: string expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.attributes[key[i]])) + return "attributes: string{k:string} expected"; + } + if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) { + properties.authenticationMethod = 1; + { + var error = $root.google.pubsub.v1.PushConfig.OidcToken.verify(message.oidcToken); + if (error) + return "oidcToken." + error; + } + } + return null; + }; - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1049: - message[".google.api.defaultHost"] = reader.string(); - break; - case 1050: - message[".google.api.oauthScopes"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Creates a PushConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PushConfig} PushConfig + */ + PushConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PushConfig) + return object; + var message = new $root.google.pubsub.v1.PushConfig(); + if (object.pushEndpoint != null) + message.pushEndpoint = String(object.pushEndpoint); + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.pubsub.v1.PushConfig.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) + message.attributes[keys[i]] = String(object.attributes[keys[i]]); + } + if (object.oidcToken != null) { + if (typeof object.oidcToken !== "object") + throw TypeError(".google.pubsub.v1.PushConfig.oidcToken: object expected"); + message.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.fromObject(object.oidcToken); + } + return message; + }; + + /** + * Creates a plain object from a PushConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PushConfig + * @static + * @param {google.pubsub.v1.PushConfig} message PushConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PushConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) + object.pushEndpoint = ""; + if (message.pushEndpoint != null && message.hasOwnProperty("pushEndpoint")) + object.pushEndpoint = message.pushEndpoint; + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = message.attributes[keys2[j]]; } - } - return message; - }; + if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) { + object.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.toObject(message.oidcToken, options); + if (options.oneofs) + object.authenticationMethod = "oidcToken"; + } + return object; + }; - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this PushConfig to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PushConfig + * @instance + * @returns {Object.} JSON object + */ + PushConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - return null; - }; + PushConfig.OidcToken = (function() { - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + /** + * Properties of an OidcToken. + * @memberof google.pubsub.v1.PushConfig + * @interface IOidcToken + * @property {string|null} [serviceAccountEmail] OidcToken serviceAccountEmail + * @property {string|null} [audience] OidcToken audience + */ + + /** + * Constructs a new OidcToken. + * @memberof google.pubsub.v1.PushConfig + * @classdesc Represents an OidcToken. + * @implements IOidcToken + * @constructor + * @param {google.pubsub.v1.PushConfig.IOidcToken=} [properties] Properties to set + */ + function OidcToken(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - return message; - }; - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - return object; - }; + /** + * OidcToken serviceAccountEmail. + * @member {string} serviceAccountEmail + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @instance + */ + OidcToken.prototype.serviceAccountEmail = ""; + + /** + * OidcToken audience. + * @member {string} audience + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @instance + */ + OidcToken.prototype.audience = ""; + + /** + * Creates a new OidcToken instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {google.pubsub.v1.PushConfig.IOidcToken=} [properties] Properties to set + * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken instance + */ + OidcToken.create = function create(properties) { + return new OidcToken(properties); + }; + + /** + * Encodes the specified OidcToken message. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {google.pubsub.v1.PushConfig.IOidcToken} message OidcToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OidcToken.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccountEmail); + if (message.audience != null && message.hasOwnProperty("audience")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.audience); + return writer; + }; + + /** + * Encodes the specified OidcToken message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {google.pubsub.v1.PushConfig.IOidcToken} message OidcToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OidcToken.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OidcToken message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OidcToken.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PushConfig.OidcToken(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serviceAccountEmail = reader.string(); + break; + case 2: + message.audience = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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); - }; + /** + * Decodes an OidcToken message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OidcToken.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return ServiceOptions; - })(); + /** + * Verifies an OidcToken message. + * @function verify + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OidcToken.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + if (!$util.isString(message.serviceAccountEmail)) + return "serviceAccountEmail: string expected"; + if (message.audience != null && message.hasOwnProperty("audience")) + if (!$util.isString(message.audience)) + return "audience: string expected"; + return null; + }; - protobuf.MethodOptions = (function() { + /** + * Creates an OidcToken message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken + */ + OidcToken.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PushConfig.OidcToken) + return object; + var message = new $root.google.pubsub.v1.PushConfig.OidcToken(); + if (object.serviceAccountEmail != null) + message.serviceAccountEmail = String(object.serviceAccountEmail); + if (object.audience != null) + message.audience = String(object.audience); + return message; + }; - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - */ + /** + * Creates a plain object from an OidcToken message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @static + * @param {google.pubsub.v1.PushConfig.OidcToken} message OidcToken + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OidcToken.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceAccountEmail = ""; + object.audience = ""; + } + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + object.serviceAccountEmail = message.serviceAccountEmail; + if (message.audience != null && message.hasOwnProperty("audience")) + object.audience = message.audience; + return object; + }; - /** - * 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]]; - } + /** + * Converts this OidcToken to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PushConfig.OidcToken + * @instance + * @returns {Object.} JSON object + */ + OidcToken.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; + return OidcToken; + })(); - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; + return PushConfig; + })(); - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + v1.ReceivedMessage = (function() { - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; + /** + * Properties of a ReceivedMessage. + * @memberof google.pubsub.v1 + * @interface IReceivedMessage + * @property {string|null} [ackId] ReceivedMessage ackId + * @property {google.pubsub.v1.IPubsubMessage|null} [message] ReceivedMessage message + * @property {number|null} [deliveryAttempt] ReceivedMessage deliveryAttempt + */ - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + /** + * Constructs a new ReceivedMessage. + * @memberof google.pubsub.v1 + * @classdesc Represents a ReceivedMessage. + * @implements IReceivedMessage + * @constructor + * @param {google.pubsub.v1.IReceivedMessage=} [properties] Properties to set + */ + function ReceivedMessage(properties) { + if (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 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); - }; + /** + * ReceivedMessage ackId. + * @member {string} ackId + * @memberof google.pubsub.v1.ReceivedMessage + * @instance + */ + ReceivedMessage.prototype.ackId = ""; - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; + /** + * ReceivedMessage message. + * @member {google.pubsub.v1.IPubsubMessage|null|undefined} message + * @memberof google.pubsub.v1.ReceivedMessage + * @instance + */ + ReceivedMessage.prototype.message = null; + + /** + * ReceivedMessage deliveryAttempt. + * @member {number} deliveryAttempt + * @memberof google.pubsub.v1.ReceivedMessage + * @instance + */ + ReceivedMessage.prototype.deliveryAttempt = 0; + + /** + * Creates a new ReceivedMessage instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {google.pubsub.v1.IReceivedMessage=} [properties] Properties to set + * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage instance + */ + ReceivedMessage.create = function create(properties) { + return new ReceivedMessage(properties); + }; - /** - * 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(); - }; + /** + * Encodes the specified ReceivedMessage message. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {google.pubsub.v1.IReceivedMessage} message ReceivedMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceivedMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ackId != null && message.hasOwnProperty("ackId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ackId); + if (message.message != null && message.hasOwnProperty("message")) + $root.google.pubsub.v1.PubsubMessage.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deliveryAttempt != null && message.hasOwnProperty("deliveryAttempt")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.deliveryAttempt); + return writer; + }; - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotencyLevel = reader.int32(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 72295728: - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - case 1051: - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Encodes the specified ReceivedMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {google.pubsub.v1.IReceivedMessage} message ReceivedMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceivedMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReceivedMessage message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceivedMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ReceivedMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ackId = reader.string(); + break; + case 2: + message.message = $root.google.pubsub.v1.PubsubMessage.decode(reader, reader.uint32()); + break; + case 3: + message.deliveryAttempt = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + 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()); - }; + /** + * Decodes a ReceivedMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceivedMessage.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.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]); + /** + * Verifies a ReceivedMessage message. + * @function verify + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReceivedMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ackId != null && message.hasOwnProperty("ackId")) + if (!$util.isString(message.ackId)) + return "ackId: string expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.pubsub.v1.PubsubMessage.verify(message.message); if (error) - return "uninterpretedOption." + error; + return "message." + error; } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - return null; - }; + if (message.deliveryAttempt != null && message.hasOwnProperty("deliveryAttempt")) + if (!$util.isInteger(message.deliveryAttempt)) + return "deliveryAttempt: integer expected"; + 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) { - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + /** + * Creates a ReceivedMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage + */ + ReceivedMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ReceivedMessage) + return object; + var message = new $root.google.pubsub.v1.ReceivedMessage(); + if (object.ackId != null) + message.ackId = String(object.ackId); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.pubsub.v1.ReceivedMessage.message: object expected"); + message.message = $root.google.pubsub.v1.PubsubMessage.fromObject(object.message); } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - return message; - }; + if (object.deliveryAttempt != null) + message.deliveryAttempt = object.deliveryAttempt | 0; + return message; + }; - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; + /** + * Creates a plain object from a ReceivedMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ReceivedMessage + * @static + * @param {google.pubsub.v1.ReceivedMessage} message ReceivedMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReceivedMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ackId = ""; + object.message = null; + object.deliveryAttempt = 0; + } + if (message.ackId != null && message.hasOwnProperty("ackId")) + object.ackId = message.ackId; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.pubsub.v1.PubsubMessage.toObject(message.message, options); + if (message.deliveryAttempt != null && message.hasOwnProperty("deliveryAttempt")) + object.deliveryAttempt = message.deliveryAttempt; + 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); - }; + /** + * Converts this ReceivedMessage to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ReceivedMessage + * @instance + * @returns {Object.} JSON object + */ + ReceivedMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {string} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; + return ReceivedMessage; })(); - return MethodOptions; - })(); + v1.GetSubscriptionRequest = (function() { - protobuf.UninterpretedOption = (function() { + /** + * Properties of a GetSubscriptionRequest. + * @memberof google.pubsub.v1 + * @interface IGetSubscriptionRequest + * @property {string|null} [subscription] GetSubscriptionRequest subscription + */ + + /** + * Constructs a new GetSubscriptionRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a GetSubscriptionRequest. + * @implements IGetSubscriptionRequest + * @constructor + * @param {google.pubsub.v1.IGetSubscriptionRequest=} [properties] Properties to set + */ + function GetSubscriptionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSubscriptionRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @instance + */ + GetSubscriptionRequest.prototype.subscription = ""; + + /** + * Creates a new GetSubscriptionRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {google.pubsub.v1.IGetSubscriptionRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest instance + */ + GetSubscriptionRequest.create = function create(properties) { + return new GetSubscriptionRequest(properties); + }; + + /** + * Encodes the specified GetSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {google.pubsub.v1.IGetSubscriptionRequest} message GetSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSubscriptionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && message.hasOwnProperty("subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + return writer; + }; + + /** + * Encodes the specified GetSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {google.pubsub.v1.IGetSubscriptionRequest} message GetSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSubscriptionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSubscriptionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.GetSubscriptionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subscription = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSubscriptionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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 - */ + /** + * Verifies a GetSubscriptionRequest message. + * @function verify + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSubscriptionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + return null; + }; - /** - * 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]]; - } + /** + * Creates a GetSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest + */ + GetSubscriptionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.GetSubscriptionRequest) + return object; + var message = new $root.google.pubsub.v1.GetSubscriptionRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + return message; + }; - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; + /** + * Creates a plain object from a GetSubscriptionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @static + * @param {google.pubsub.v1.GetSubscriptionRequest} message GetSubscriptionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSubscriptionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.subscription = ""; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + return object; + }; - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; + /** + * Converts this GetSubscriptionRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.GetSubscriptionRequest + * @instance + * @returns {Object.} JSON object + */ + GetSubscriptionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + return GetSubscriptionRequest; + })(); - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + v1.UpdateSubscriptionRequest = (function() { - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; + /** + * Properties of an UpdateSubscriptionRequest. + * @memberof google.pubsub.v1 + * @interface IUpdateSubscriptionRequest + * @property {google.pubsub.v1.ISubscription|null} [subscription] UpdateSubscriptionRequest subscription + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSubscriptionRequest updateMask + */ - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + /** + * Constructs a new UpdateSubscriptionRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents an UpdateSubscriptionRequest. + * @implements IUpdateSubscriptionRequest + * @constructor + * @param {google.pubsub.v1.IUpdateSubscriptionRequest=} [properties] Properties to set + */ + function UpdateSubscriptionRequest(properties) { + if (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 aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; + /** + * UpdateSubscriptionRequest subscription. + * @member {google.pubsub.v1.ISubscription|null|undefined} subscription + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @instance + */ + UpdateSubscriptionRequest.prototype.subscription = null; - /** - * 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); - }; + /** + * UpdateSubscriptionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @instance + */ + UpdateSubscriptionRequest.prototype.updateMask = null; - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; + /** + * Creates a new UpdateSubscriptionRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {google.pubsub.v1.IUpdateSubscriptionRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest instance + */ + UpdateSubscriptionRequest.create = function create(properties) { + return new UpdateSubscriptionRequest(properties); + }; - /** - * 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(); - }; + /** + * Encodes the specified UpdateSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {google.pubsub.v1.IUpdateSubscriptionRequest} message UpdateSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSubscriptionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && message.hasOwnProperty("subscription")) + $root.google.pubsub.v1.Subscription.encode(message.subscription, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - case 3: - message.identifierValue = reader.string(); - break; - case 4: - message.positiveIntValue = reader.uint64(); - break; - case 5: - message.negativeIntValue = reader.int64(); - break; - case 6: - message.doubleValue = reader.double(); - break; - case 7: - message.stringValue = reader.bytes(); - break; - case 8: - message.aggregateValue = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Encodes the specified UpdateSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {google.pubsub.v1.IUpdateSubscriptionRequest} message UpdateSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSubscriptionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.UpdateSubscriptionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subscription = $root.google.pubsub.v1.Subscription.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return 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()); - }; + /** + * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSubscriptionRequest.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]); + /** + * Verifies an UpdateSubscriptionRequest message. + * @function verify + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSubscriptionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) { + var error = $root.google.pubsub.v1.Subscription.verify(message.subscription); if (error) - return "name." + error; + return "subscription." + 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; - }; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + 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]); + /** + * Creates an UpdateSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest + */ + UpdateSubscriptionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.UpdateSubscriptionRequest) + return object; + var message = new $root.google.pubsub.v1.UpdateSubscriptionRequest(); + if (object.subscription != null) { + if (typeof object.subscription !== "object") + throw TypeError(".google.pubsub.v1.UpdateSubscriptionRequest.subscription: object expected"); + message.subscription = $root.google.pubsub.v1.Subscription.fromObject(object.subscription); } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.pubsub.v1.UpdateSubscriptionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + 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); + /** + * Creates a plain object from an UpdateSubscriptionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @static + * @param {google.pubsub.v1.UpdateSubscriptionRequest} message UpdateSubscriptionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSubscriptionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subscription = null; + object.updateMask = null; } - 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; - }; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = $root.google.pubsub.v1.Subscription.toObject(message.subscription, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + 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); - }; + /** + * Converts this UpdateSubscriptionRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.UpdateSubscriptionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSubscriptionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - UninterpretedOption.NamePart = (function() { + return UpdateSubscriptionRequest; + })(); + + v1.ListSubscriptionsRequest = (function() { /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension + * Properties of a ListSubscriptionsRequest. + * @memberof google.pubsub.v1 + * @interface IListSubscriptionsRequest + * @property {string|null} [project] ListSubscriptionsRequest project + * @property {number|null} [pageSize] ListSubscriptionsRequest pageSize + * @property {string|null} [pageToken] ListSubscriptionsRequest pageToken */ /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart + * Constructs a new ListSubscriptionsRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSubscriptionsRequest. + * @implements IListSubscriptionsRequest * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @param {google.pubsub.v1.IListSubscriptionsRequest=} [properties] Properties to set */ - function NamePart(properties) { + function ListSubscriptionsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19383,423 +20173,231 @@ } /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart + * ListSubscriptionsRequest project. + * @member {string} project + * @memberof google.pubsub.v1.ListSubscriptionsRequest * @instance */ - NamePart.prototype.namePart = ""; + ListSubscriptionsRequest.prototype.project = ""; /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart + * ListSubscriptionsRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListSubscriptionsRequest * @instance */ - NamePart.prototype.isExtension = false; + ListSubscriptionsRequest.prototype.pageSize = 0; /** - * Creates a new NamePart instance using the specified properties. + * ListSubscriptionsRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListSubscriptionsRequest + * @instance + */ + ListSubscriptionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSubscriptionsRequest instance using the specified properties. * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.pubsub.v1.ListSubscriptionsRequest * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + * @param {google.pubsub.v1.IListSubscriptionsRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest instance */ - NamePart.create = function create(properties) { - return new NamePart(properties); + ListSubscriptionsRequest.create = function create(properties) { + return new ListSubscriptionsRequest(properties); }; /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * Encodes the specified ListSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.pubsub.v1.ListSubscriptionsRequest * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {google.pubsub.v1.IListSubscriptionsRequest} message ListSubscriptionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NamePart.encode = function encode(message, writer) { + ListSubscriptionsRequest.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); + if (message.project != null && message.hasOwnProperty("project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * Encodes the specified ListSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.pubsub.v1.ListSubscriptionsRequest * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {google.pubsub.v1.IListSubscriptionsRequest} message ListSubscriptionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { + ListSubscriptionsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NamePart message from the specified reader or buffer. + * Decodes a ListSubscriptionsRequest message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.pubsub.v1.ListSubscriptionsRequest * @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 + * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest * @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) { + ListSubscriptionsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSubscriptionsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.namePart = reader.string(); + message.project = reader.string(); break; case 2: - message.isExtension = reader.bool(); + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); break; } } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); return message; }; /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. + * Decodes a ListSubscriptionsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.pubsub.v1.ListSubscriptionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest * @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) { + ListSubscriptionsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NamePart message. + * Verifies a ListSubscriptionsRequest message. * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.pubsub.v1.ListSubscriptionsRequest * @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) { + ListSubscriptionsRequest.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"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: 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 NamePart message from a plain object. Also converts values to their respective internal types. + * Creates a ListSubscriptionsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.pubsub.v1.ListSubscriptionsRequest * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + ListSubscriptionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSubscriptionsRequest) 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); + var message = new $root.google.pubsub.v1.ListSubscriptionsRequest(); + if (object.project != null) + message.project = String(object.project); + 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 NamePart message. Also converts values to other types if specified. + * Creates a plain object from a ListSubscriptionsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.pubsub.v1.ListSubscriptionsRequest * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {google.pubsub.v1.ListSubscriptionsRequest} message ListSubscriptionsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NamePart.toObject = function toObject(message, options) { + ListSubscriptionsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.namePart = ""; - object.isExtension = false; + object.project = ""; + object.pageSize = 0; + object.pageToken = ""; } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this NamePart to JSON. + * Converts this ListSubscriptionsRequest to JSON. * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.pubsub.v1.ListSubscriptionsRequest * @instance * @returns {Object.} JSON object */ - NamePart.prototype.toJSON = function toJSON() { + ListSubscriptionsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return NamePart; + return ListSubscriptionsRequest; })(); - return UninterpretedOption; - })(); - - 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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a 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); - }; - - SourceCodeInfo.Location = (function() { + v1.ListSubscriptionsResponse = (function() { /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + * Properties of a ListSubscriptionsResponse. + * @memberof google.pubsub.v1 + * @interface IListSubscriptionsResponse + * @property {Array.|null} [subscriptions] ListSubscriptionsResponse subscriptions + * @property {string|null} [nextPageToken] ListSubscriptionsResponse nextPageToken */ /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation + * Constructs a new ListSubscriptionsResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSubscriptionsResponse. + * @implements IListSubscriptionsResponse * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @param {google.pubsub.v1.IListSubscriptionsResponse=} [properties] Properties to set */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; + function ListSubscriptionsResponse(properties) { + this.subscriptions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19807,152 +20405,91 @@ } /** - * 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 + * ListSubscriptionsResponse subscriptions. + * @member {Array.} subscriptions + * @memberof google.pubsub.v1.ListSubscriptionsResponse * @instance */ - Location.prototype.trailingComments = ""; + ListSubscriptionsResponse.prototype.subscriptions = $util.emptyArray; /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location + * ListSubscriptionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListSubscriptionsResponse * @instance */ - Location.prototype.leadingDetachedComments = $util.emptyArray; + ListSubscriptionsResponse.prototype.nextPageToken = ""; /** - * Creates a new Location instance using the specified properties. + * Creates a new ListSubscriptionsResponse instance using the specified properties. * @function create - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.pubsub.v1.ListSubscriptionsResponse * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + * @param {google.pubsub.v1.IListSubscriptionsResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse instance */ - Location.create = function create(properties) { - return new Location(properties); + ListSubscriptionsResponse.create = function create(properties) { + return new ListSubscriptionsResponse(properties); }; /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * Encodes the specified ListSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.pubsub.v1.ListSubscriptionsResponse * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {google.pubsub.v1.IListSubscriptionsResponse} message ListSubscriptionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Location.encode = function encode(message, writer) { + ListSubscriptionsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + if (message.subscriptions != null && message.subscriptions.length) + for (var i = 0; i < message.subscriptions.length; ++i) + $root.google.pubsub.v1.Subscription.encode(message.subscriptions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * Encodes the specified ListSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.pubsub.v1.ListSubscriptionsResponse * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {google.pubsub.v1.IListSubscriptionsResponse} message ListSubscriptionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Location.encodeDelimited = function encodeDelimited(message, writer) { + ListSubscriptionsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Location message from the specified reader or buffer. + * Decodes a ListSubscriptionsResponse message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.pubsub.v1.ListSubscriptionsResponse * @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 + * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse * @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) { + ListSubscriptionsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSubscriptionsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); + if (!(message.subscriptions && message.subscriptions.length)) + message.subscriptions = []; + message.subscriptions.push($root.google.pubsub.v1.Subscription.decode(reader, reader.uint32())); 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()); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -19963,390 +20500,321 @@ }; /** - * Decodes a Location message from the specified reader or buffer, length delimited. + * Decodes a ListSubscriptionsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.pubsub.v1.ListSubscriptionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse * @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) { + ListSubscriptionsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Location message. + * Verifies a ListSubscriptionsResponse message. * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.pubsub.v1.ListSubscriptionsResponse * @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) { + ListSubscriptionsResponse.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"; + if (message.subscriptions != null && message.hasOwnProperty("subscriptions")) { + if (!Array.isArray(message.subscriptions)) + return "subscriptions: array expected"; + for (var i = 0; i < message.subscriptions.length; ++i) { + var error = $root.google.pubsub.v1.Subscription.verify(message.subscriptions[i]); + if (error) + return "subscriptions." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. + * Creates a ListSubscriptionsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.pubsub.v1.ListSubscriptionsResponse * @static * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + ListSubscriptionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSubscriptionsResponse) 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]); + var message = new $root.google.pubsub.v1.ListSubscriptionsResponse(); + if (object.subscriptions) { + if (!Array.isArray(object.subscriptions)) + throw TypeError(".google.pubsub.v1.ListSubscriptionsResponse.subscriptions: array expected"); + message.subscriptions = []; + for (var i = 0; i < object.subscriptions.length; ++i) { + if (typeof object.subscriptions[i] !== "object") + throw TypeError(".google.pubsub.v1.ListSubscriptionsResponse.subscriptions: object expected"); + message.subscriptions[i] = $root.google.pubsub.v1.Subscription.fromObject(object.subscriptions[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a Location message. Also converts values to other types if specified. + * Creates a plain object from a ListSubscriptionsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.pubsub.v1.ListSubscriptionsResponse * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {google.pubsub.v1.ListSubscriptionsResponse} message ListSubscriptionsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Location.toObject = function toObject(message, options) { + ListSubscriptionsResponse.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]; + if (options.arrays || options.defaults) + object.subscriptions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.subscriptions && message.subscriptions.length) { + object.subscriptions = []; + for (var j = 0; j < message.subscriptions.length; ++j) + object.subscriptions[j] = $root.google.pubsub.v1.Subscription.toObject(message.subscriptions[j], options); } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this Location to JSON. + * Converts this ListSubscriptionsResponse to JSON. * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.pubsub.v1.ListSubscriptionsResponse * @instance * @returns {Object.} JSON object */ - Location.prototype.toJSON = function toJSON() { + ListSubscriptionsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Location; + return ListSubscriptionsResponse; })(); - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { + v1.DeleteSubscriptionRequest = (function() { - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ + /** + * Properties of a DeleteSubscriptionRequest. + * @memberof google.pubsub.v1 + * @interface IDeleteSubscriptionRequest + * @property {string|null} [subscription] DeleteSubscriptionRequest subscription + */ - /** - * 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]]; - } + /** + * Constructs a new DeleteSubscriptionRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a DeleteSubscriptionRequest. + * @implements IDeleteSubscriptionRequest + * @constructor + * @param {google.pubsub.v1.IDeleteSubscriptionRequest=} [properties] Properties to set + */ + function DeleteSubscriptionRequest(properties) { + if (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; + /** + * DeleteSubscriptionRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @instance + */ + DeleteSubscriptionRequest.prototype.subscription = ""; - /** - * 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); - }; + /** + * Creates a new DeleteSubscriptionRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {google.pubsub.v1.IDeleteSubscriptionRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest instance + */ + DeleteSubscriptionRequest.create = function create(properties) { + return new DeleteSubscriptionRequest(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 DeleteSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {google.pubsub.v1.IDeleteSubscriptionRequest} message DeleteSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSubscriptionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && message.hasOwnProperty("subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + 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(); - }; + /** + * Encodes the specified DeleteSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {google.pubsub.v1.IDeleteSubscriptionRequest} message DeleteSubscriptionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSubscriptionRequest.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSubscriptionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeleteSubscriptionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subscription = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; + + /** + * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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 DeleteSubscriptionRequest message. + * @function verify + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSubscriptionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + return null; + }; - /** - * 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 DeleteSubscriptionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest + */ + DeleteSubscriptionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DeleteSubscriptionRequest) + return object; + var message = new $root.google.pubsub.v1.DeleteSubscriptionRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + return message; + }; - /** - * 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) + /** + * Creates a plain object from a DeleteSubscriptionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @static + * @param {google.pubsub.v1.DeleteSubscriptionRequest} message DeleteSubscriptionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSubscriptionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.subscription = ""; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; 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 DeleteSubscriptionRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.DeleteSubscriptionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSubscriptionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + return DeleteSubscriptionRequest; + })(); - GeneratedCodeInfo.Annotation = (function() { + v1.ModifyPushConfigRequest = (function() { /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end + * Properties of a ModifyPushConfigRequest. + * @memberof google.pubsub.v1 + * @interface IModifyPushConfigRequest + * @property {string|null} [subscription] ModifyPushConfigRequest subscription + * @property {google.pubsub.v1.IPushConfig|null} [pushConfig] ModifyPushConfigRequest pushConfig */ /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation + * Constructs a new ModifyPushConfigRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ModifyPushConfigRequest. + * @implements IModifyPushConfigRequest * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @param {google.pubsub.v1.IModifyPushConfigRequest=} [properties] Properties to set */ - function Annotation(properties) { - this.path = []; + function ModifyPushConfigRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20354,125 +20822,88 @@ } /** - * 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 + * ModifyPushConfigRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.ModifyPushConfigRequest * @instance */ - Annotation.prototype.begin = 0; + ModifyPushConfigRequest.prototype.subscription = ""; /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * ModifyPushConfigRequest pushConfig. + * @member {google.pubsub.v1.IPushConfig|null|undefined} pushConfig + * @memberof google.pubsub.v1.ModifyPushConfigRequest * @instance */ - Annotation.prototype.end = 0; + ModifyPushConfigRequest.prototype.pushConfig = null; /** - * Creates a new Annotation instance using the specified properties. + * Creates a new ModifyPushConfigRequest instance using the specified properties. * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @memberof google.pubsub.v1.ModifyPushConfigRequest * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + * @param {google.pubsub.v1.IModifyPushConfigRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest instance */ - Annotation.create = function create(properties) { - return new Annotation(properties); + ModifyPushConfigRequest.create = function create(properties) { + return new ModifyPushConfigRequest(properties); }; /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * Encodes the specified ModifyPushConfigRequest message. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @memberof google.pubsub.v1.ModifyPushConfigRequest * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {google.pubsub.v1.IModifyPushConfigRequest} message ModifyPushConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Annotation.encode = function encode(message, writer) { + ModifyPushConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && message.hasOwnProperty("begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && message.hasOwnProperty("end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.subscription != null && message.hasOwnProperty("subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) + $root.google.pubsub.v1.PushConfig.encode(message.pushConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * Encodes the specified ModifyPushConfigRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @memberof google.pubsub.v1.ModifyPushConfigRequest * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {google.pubsub.v1.IModifyPushConfigRequest} message ModifyPushConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { + ModifyPushConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Annotation message from the specified reader or buffer. + * Decodes a ModifyPushConfigRequest message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @memberof google.pubsub.v1.ModifyPushConfigRequest * @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 + * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest * @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) { + ModifyPushConfigRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ModifyPushConfigRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); + message.subscription = reader.string(); break; case 2: - message.sourceFile = reader.string(); - break; - case 3: - message.begin = reader.int32(); - break; - case 4: - message.end = reader.int32(); + message.pushConfig = $root.google.pubsub.v1.PushConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -20483,1204 +20914,1202 @@ }; /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. + * Decodes a ModifyPushConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @memberof google.pubsub.v1.ModifyPushConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest * @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) { + ModifyPushConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Annotation message. + * Verifies a ModifyPushConfigRequest message. * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @memberof google.pubsub.v1.ModifyPushConfigRequest * @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) { + ModifyPushConfigRequest.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.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) { + var error = $root.google.pubsub.v1.PushConfig.verify(message.pushConfig); + if (error) + return "pushConfig." + error; } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; return null; }; /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * Creates a ModifyPushConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @memberof google.pubsub.v1.ModifyPushConfigRequest * @static * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Duration = (function() { - - /** - * 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 && message.hasOwnProperty("seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified 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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; + * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest + */ + ModifyPushConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ModifyPushConfigRequest) + return object; + var message = new $root.google.pubsub.v1.ModifyPushConfigRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.pushConfig != null) { + if (typeof object.pushConfig !== "object") + throw TypeError(".google.pubsub.v1.ModifyPushConfigRequest.pushConfig: object expected"); + message.pushConfig = $root.google.pubsub.v1.PushConfig.fromObject(object.pushConfig); } - } - return message; - }; + 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()); - }; + /** + * Creates a plain object from a ModifyPushConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @static + * @param {google.pubsub.v1.ModifyPushConfigRequest} message ModifyPushConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModifyPushConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subscription = ""; + object.pushConfig = null; + } + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) + object.pushConfig = $root.google.pubsub.v1.PushConfig.toObject(message.pushConfig, options); + return object; + }; - /** - * 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; - }; + /** + * Converts this ModifyPushConfigRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ModifyPushConfigRequest + * @instance + * @returns {Object.} JSON object + */ + ModifyPushConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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; - }; + return ModifyPushConfigRequest; + })(); - /** - * 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; - }; + v1.PullRequest = (function() { - /** - * 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); - }; + /** + * Properties of a PullRequest. + * @memberof google.pubsub.v1 + * @interface IPullRequest + * @property {string|null} [subscription] PullRequest subscription + * @property {boolean|null} [returnImmediately] PullRequest returnImmediately + * @property {number|null} [maxMessages] PullRequest maxMessages + */ - return Duration; - })(); + /** + * Constructs a new PullRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a PullRequest. + * @implements IPullRequest + * @constructor + * @param {google.pubsub.v1.IPullRequest=} [properties] Properties to set + */ + function PullRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - protobuf.Empty = (function() { + /** + * PullRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.PullRequest + * @instance + */ + PullRequest.prototype.subscription = ""; - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ + /** + * PullRequest returnImmediately. + * @member {boolean} returnImmediately + * @memberof google.pubsub.v1.PullRequest + * @instance + */ + PullRequest.prototype.returnImmediately = false; - /** - * 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]]; - } + /** + * PullRequest maxMessages. + * @member {number} maxMessages + * @memberof google.pubsub.v1.PullRequest + * @instance + */ + PullRequest.prototype.maxMessages = 0; - /** - * 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); - }; + /** + * Creates a new PullRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {google.pubsub.v1.IPullRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.PullRequest} PullRequest instance + */ + PullRequest.create = function create(properties) { + return new PullRequest(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 PullRequest message. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {google.pubsub.v1.IPullRequest} message PullRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PullRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && message.hasOwnProperty("subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.returnImmediately != null && message.hasOwnProperty("returnImmediately")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.returnImmediately); + if (message.maxMessages != null && message.hasOwnProperty("maxMessages")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxMessages); + 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(); - }; + /** + * Encodes the specified PullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {google.pubsub.v1.IPullRequest} message PullRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PullRequest.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) { - 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(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a PullRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PullRequest} PullRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PullRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PullRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subscription = reader.string(); + break; + case 2: + message.returnImmediately = reader.bool(); + break; + case 3: + message.maxMessages = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + 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()); - }; + /** + * Decodes a PullRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PullRequest} PullRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PullRequest.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; - }; + /** + * Verifies a PullRequest message. + * @function verify + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PullRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.returnImmediately != null && message.hasOwnProperty("returnImmediately")) + if (typeof message.returnImmediately !== "boolean") + return "returnImmediately: boolean expected"; + if (message.maxMessages != null && message.hasOwnProperty("maxMessages")) + if (!$util.isInteger(message.maxMessages)) + return "maxMessages: integer 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 PullRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PullRequest} PullRequest + */ + PullRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PullRequest) + return object; + var message = new $root.google.pubsub.v1.PullRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.returnImmediately != null) + message.returnImmediately = Boolean(object.returnImmediately); + if (object.maxMessages != null) + message.maxMessages = object.maxMessages | 0; + return message; + }; - /** - * 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 {}; - }; + /** + * Creates a plain object from a PullRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PullRequest + * @static + * @param {google.pubsub.v1.PullRequest} message PullRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PullRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subscription = ""; + object.returnImmediately = false; + object.maxMessages = 0; + } + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.returnImmediately != null && message.hasOwnProperty("returnImmediately")) + object.returnImmediately = message.returnImmediately; + if (message.maxMessages != null && message.hasOwnProperty("maxMessages")) + object.maxMessages = message.maxMessages; + return object; + }; - /** - * 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); - }; + /** + * Converts this PullRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PullRequest + * @instance + * @returns {Object.} JSON object + */ + PullRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Empty; - })(); + return PullRequest; + })(); - protobuf.FieldMask = (function() { + v1.PullResponse = (function() { - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ + /** + * Properties of a PullResponse. + * @memberof google.pubsub.v1 + * @interface IPullResponse + * @property {Array.|null} [receivedMessages] PullResponse receivedMessages + */ - /** - * 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]]; - } + /** + * Constructs a new PullResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a PullResponse. + * @implements IPullResponse + * @constructor + * @param {google.pubsub.v1.IPullResponse=} [properties] Properties to set + */ + function PullResponse(properties) { + this.receivedMessages = []; + if (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; + /** + * PullResponse receivedMessages. + * @member {Array.} receivedMessages + * @memberof google.pubsub.v1.PullResponse + * @instance + */ + PullResponse.prototype.receivedMessages = $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); - }; + /** + * Creates a new PullResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {google.pubsub.v1.IPullResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.PullResponse} PullResponse instance + */ + PullResponse.create = function create(properties) { + return new PullResponse(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 PullResponse message. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {google.pubsub.v1.IPullResponse} message PullResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PullResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.receivedMessages != null && message.receivedMessages.length) + for (var i = 0; i < message.receivedMessages.length; ++i) + $root.google.pubsub.v1.ReceivedMessage.encode(message.receivedMessages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified PullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {google.pubsub.v1.IPullResponse} message PullResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PullResponse.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a PullResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.PullResponse} PullResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PullResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PullResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.receivedMessages && message.receivedMessages.length)) + message.receivedMessages = []; + message.receivedMessages.push($root.google.pubsub.v1.ReceivedMessage.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + 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()); - }; + /** + * Decodes a PullResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.PullResponse} PullResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PullResponse.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; - }; + /** + * Verifies a PullResponse message. + * @function verify + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PullResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.receivedMessages != null && message.hasOwnProperty("receivedMessages")) { + if (!Array.isArray(message.receivedMessages)) + return "receivedMessages: array expected"; + for (var i = 0; i < message.receivedMessages.length; ++i) { + var error = $root.google.pubsub.v1.ReceivedMessage.verify(message.receivedMessages[i]); + if (error) + return "receivedMessages." + error; + } + } + 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) + /** + * Creates a PullResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.PullResponse} PullResponse + */ + PullResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.PullResponse) + return object; + var message = new $root.google.pubsub.v1.PullResponse(); + if (object.receivedMessages) { + if (!Array.isArray(object.receivedMessages)) + throw TypeError(".google.pubsub.v1.PullResponse.receivedMessages: array expected"); + message.receivedMessages = []; + for (var i = 0; i < object.receivedMessages.length; ++i) { + if (typeof object.receivedMessages[i] !== "object") + throw TypeError(".google.pubsub.v1.PullResponse.receivedMessages: object expected"); + message.receivedMessages[i] = $root.google.pubsub.v1.ReceivedMessage.fromObject(object.receivedMessages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PullResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.PullResponse + * @static + * @param {google.pubsub.v1.PullResponse} message PullResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PullResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.receivedMessages = []; + if (message.receivedMessages && message.receivedMessages.length) { + object.receivedMessages = []; + for (var j = 0; j < message.receivedMessages.length; ++j) + object.receivedMessages[j] = $root.google.pubsub.v1.ReceivedMessage.toObject(message.receivedMessages[j], options); + } 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 PullResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.PullResponse + * @instance + * @returns {Object.} JSON object + */ + PullResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + return PullResponse; + })(); - return FieldMask; - })(); + v1.ModifyAckDeadlineRequest = (function() { - protobuf.Timestamp = (function() { + /** + * Properties of a ModifyAckDeadlineRequest. + * @memberof google.pubsub.v1 + * @interface IModifyAckDeadlineRequest + * @property {string|null} [subscription] ModifyAckDeadlineRequest subscription + * @property {Array.|null} [ackIds] ModifyAckDeadlineRequest ackIds + * @property {number|null} [ackDeadlineSeconds] ModifyAckDeadlineRequest ackDeadlineSeconds + */ - /** - * 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 ModifyAckDeadlineRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ModifyAckDeadlineRequest. + * @implements IModifyAckDeadlineRequest + * @constructor + * @param {google.pubsub.v1.IModifyAckDeadlineRequest=} [properties] Properties to set + */ + function ModifyAckDeadlineRequest(properties) { + this.ackIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new 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]]; - } + /** + * ModifyAckDeadlineRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @instance + */ + ModifyAckDeadlineRequest.prototype.subscription = ""; - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * ModifyAckDeadlineRequest ackIds. + * @member {Array.} ackIds + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @instance + */ + ModifyAckDeadlineRequest.prototype.ackIds = $util.emptyArray; - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; + /** + * ModifyAckDeadlineRequest ackDeadlineSeconds. + * @member {number} ackDeadlineSeconds + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @instance + */ + ModifyAckDeadlineRequest.prototype.ackDeadlineSeconds = 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); - }; + /** + * Creates a new ModifyAckDeadlineRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {google.pubsub.v1.IModifyAckDeadlineRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest instance + */ + ModifyAckDeadlineRequest.create = function create(properties) { + return new ModifyAckDeadlineRequest(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 && message.hasOwnProperty("seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; + /** + * Encodes the specified ModifyAckDeadlineRequest message. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {google.pubsub.v1.IModifyAckDeadlineRequest} message ModifyAckDeadlineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyAckDeadlineRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && message.hasOwnProperty("subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ackDeadlineSeconds); + if (message.ackIds != null && message.ackIds.length) + for (var i = 0; i < message.ackIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ackIds[i]); + 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(); - }; + /** + * Encodes the specified ModifyAckDeadlineRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {google.pubsub.v1.IModifyAckDeadlineRequest} message ModifyAckDeadlineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModifyAckDeadlineRequest.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyAckDeadlineRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ModifyAckDeadlineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subscription = reader.string(); + break; + case 4: + if (!(message.ackIds && message.ackIds.length)) + message.ackIds = []; + message.ackIds.push(reader.string()); + break; + case 3: + message.ackDeadlineSeconds = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + 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()); - }; + /** + * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModifyAckDeadlineRequest.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; - }; + /** + * Verifies a ModifyAckDeadlineRequest message. + * @function verify + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModifyAckDeadlineRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.ackIds != null && message.hasOwnProperty("ackIds")) { + if (!Array.isArray(message.ackIds)) + return "ackIds: array expected"; + for (var i = 0; i < message.ackIds.length; ++i) + if (!$util.isString(message.ackIds[i])) + return "ackIds: string[] expected"; + } + if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) + if (!$util.isInteger(message.ackDeadlineSeconds)) + return "ackDeadlineSeconds: 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) + /** + * Creates a ModifyAckDeadlineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest + */ + ModifyAckDeadlineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ModifyAckDeadlineRequest) + return object; + var message = new $root.google.pubsub.v1.ModifyAckDeadlineRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.ackIds) { + if (!Array.isArray(object.ackIds)) + throw TypeError(".google.pubsub.v1.ModifyAckDeadlineRequest.ackIds: array expected"); + message.ackIds = []; + for (var i = 0; i < object.ackIds.length; ++i) + message.ackIds[i] = String(object.ackIds[i]); + } + if (object.ackDeadlineSeconds != null) + message.ackDeadlineSeconds = object.ackDeadlineSeconds | 0; + return message; + }; + + /** + * Creates a plain object from a ModifyAckDeadlineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @static + * @param {google.pubsub.v1.ModifyAckDeadlineRequest} message ModifyAckDeadlineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModifyAckDeadlineRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ackIds = []; + if (options.defaults) { + object.subscription = ""; + object.ackDeadlineSeconds = 0; + } + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds")) + object.ackDeadlineSeconds = message.ackDeadlineSeconds; + if (message.ackIds && message.ackIds.length) { + object.ackIds = []; + for (var j = 0; j < message.ackIds.length; ++j) + object.ackIds[j] = message.ackIds[j]; + } 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; - }; + }; + + /** + * Converts this ModifyAckDeadlineRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.ModifyAckDeadlineRequest + * @instance + * @returns {Object.} JSON object + */ + ModifyAckDeadlineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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; - }; + return ModifyAckDeadlineRequest; + })(); - /** - * 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); - }; + v1.AcknowledgeRequest = (function() { - return Timestamp; - })(); + /** + * Properties of an AcknowledgeRequest. + * @memberof google.pubsub.v1 + * @interface IAcknowledgeRequest + * @property {string|null} [subscription] AcknowledgeRequest subscription + * @property {Array.|null} [ackIds] AcknowledgeRequest ackIds + */ - return protobuf; - })(); + /** + * Constructs a new AcknowledgeRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents an AcknowledgeRequest. + * @implements IAcknowledgeRequest + * @constructor + * @param {google.pubsub.v1.IAcknowledgeRequest=} [properties] Properties to set + */ + function AcknowledgeRequest(properties) { + this.ackIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - google.iam = (function() { + /** + * AcknowledgeRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.AcknowledgeRequest + * @instance + */ + AcknowledgeRequest.prototype.subscription = ""; - /** - * Namespace iam. - * @memberof google - * @namespace - */ - var iam = {}; + /** + * AcknowledgeRequest ackIds. + * @member {Array.} ackIds + * @memberof google.pubsub.v1.AcknowledgeRequest + * @instance + */ + AcknowledgeRequest.prototype.ackIds = $util.emptyArray; - iam.v1 = (function() { + /** + * Creates a new AcknowledgeRequest instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {google.pubsub.v1.IAcknowledgeRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest instance + */ + AcknowledgeRequest.create = function create(properties) { + return new AcknowledgeRequest(properties); + }; - /** - * Namespace v1. - * @memberof google.iam - * @namespace - */ - var v1 = {}; + /** + * Encodes the specified AcknowledgeRequest message. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {google.pubsub.v1.IAcknowledgeRequest} message AcknowledgeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcknowledgeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && message.hasOwnProperty("subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.ackIds != null && message.ackIds.length) + for (var i = 0; i < message.ackIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ackIds[i]); + return writer; + }; - v1.IAMPolicy = (function() { + /** + * Encodes the specified AcknowledgeRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {google.pubsub.v1.IAcknowledgeRequest} message AcknowledgeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcknowledgeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Constructs a new IAMPolicy service. - * @memberof google.iam.v1 - * @classdesc Represents a IAMPolicy - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * Decodes an AcknowledgeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - function IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } + AcknowledgeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.AcknowledgeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subscription = reader.string(); + break; + case 2: + if (!(message.ackIds && message.ackIds.length)) + message.ackIds = []; + message.ackIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; + /** + * Decodes an AcknowledgeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcknowledgeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Creates new IAMPolicy service using the specified rpc implementation. - * @function create - * @memberof google.iam.v1.IAMPolicy + * Verifies an AcknowledgeRequest message. + * @function verify + * @memberof google.pubsub.v1.AcknowledgeRequest * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + AcknowledgeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.ackIds != null && message.hasOwnProperty("ackIds")) { + if (!Array.isArray(message.ackIds)) + return "ackIds: array expected"; + for (var i = 0; i < message.ackIds.length; ++i) + if (!$util.isString(message.ackIds[i])) + return "ackIds: string[] expected"; + } + return null; }; /** - * Callback as used by {@link google.iam.v1.IAMPolicy#setIamPolicy}. - * @memberof google.iam.v1.IAMPolicy - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy + * Creates an AcknowledgeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest */ + AcknowledgeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.AcknowledgeRequest) + return object; + var message = new $root.google.pubsub.v1.AcknowledgeRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.ackIds) { + if (!Array.isArray(object.ackIds)) + throw TypeError(".google.pubsub.v1.AcknowledgeRequest.ackIds: array expected"); + message.ackIds = []; + for (var i = 0; i < object.ackIds.length; ++i) + message.ackIds[i] = String(object.ackIds[i]); + } + return message; + }; /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 + * Creates a plain object from an AcknowledgeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.AcknowledgeRequest + * @static + * @param {google.pubsub.v1.AcknowledgeRequest} message AcknowledgeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); + AcknowledgeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ackIds = []; + if (options.defaults) + object.subscription = ""; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.ackIds && message.ackIds.length) { + object.ackIds = []; + for (var j = 0; j < message.ackIds.length; ++j) + object.ackIds[j] = message.ackIds[j]; + } + return object; + }; /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.iam.v1.IAMPolicy + * Converts this AcknowledgeRequest to JSON. + * @function toJSON + * @memberof google.pubsub.v1.AcknowledgeRequest * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + AcknowledgeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Callback as used by {@link google.iam.v1.IAMPolicy#getIamPolicy}. - * @memberof google.iam.v1.IAMPolicy - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ + return AcknowledgeRequest; + })(); - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); + v1.StreamingPullRequest = (function() { /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a StreamingPullRequest. + * @memberof google.pubsub.v1 + * @interface IStreamingPullRequest + * @property {string|null} [subscription] StreamingPullRequest subscription + * @property {Array.|null} [ackIds] StreamingPullRequest ackIds + * @property {Array.|null} [modifyDeadlineSeconds] StreamingPullRequest modifyDeadlineSeconds + * @property {Array.|null} [modifyDeadlineAckIds] StreamingPullRequest modifyDeadlineAckIds + * @property {number|null} [streamAckDeadlineSeconds] StreamingPullRequest streamAckDeadlineSeconds + * @property {string|null} [clientId] StreamingPullRequest clientId */ /** - * Callback as used by {@link google.iam.v1.IAMPolicy#testIamPermissions}. - * @memberof google.iam.v1.IAMPolicy - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + * Constructs a new StreamingPullRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a StreamingPullRequest. + * @implements IStreamingPullRequest + * @constructor + * @param {google.pubsub.v1.IStreamingPullRequest=} [properties] Properties to set */ + function StreamingPullRequest(properties) { + this.ackIds = []; + this.modifyDeadlineSeconds = []; + this.modifyDeadlineAckIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.iam.v1.IAMPolicy + * StreamingPullRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.StreamingPullRequest * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); + StreamingPullRequest.prototype.subscription = ""; /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.iam.v1.IAMPolicy + * StreamingPullRequest ackIds. + * @member {Array.} ackIds + * @memberof google.pubsub.v1.StreamingPullRequest * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ - - return IAMPolicy; - })(); - - v1.SetIamPolicyRequest = (function() { + StreamingPullRequest.prototype.ackIds = $util.emptyArray; /** - * Properties of a SetIamPolicyRequest. - * @memberof google.iam.v1 - * @interface ISetIamPolicyRequest - * @property {string|null} [resource] SetIamPolicyRequest resource - * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy + * StreamingPullRequest modifyDeadlineSeconds. + * @member {Array.} modifyDeadlineSeconds + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance */ + StreamingPullRequest.prototype.modifyDeadlineSeconds = $util.emptyArray; /** - * Constructs a new SetIamPolicyRequest. - * @memberof google.iam.v1 - * @classdesc Represents a SetIamPolicyRequest. - * @implements ISetIamPolicyRequest - * @constructor - * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + * StreamingPullRequest modifyDeadlineAckIds. + * @member {Array.} modifyDeadlineAckIds + * @memberof google.pubsub.v1.StreamingPullRequest + * @instance */ - function SetIamPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + StreamingPullRequest.prototype.modifyDeadlineAckIds = $util.emptyArray; /** - * SetIamPolicyRequest resource. - * @member {string} resource - * @memberof google.iam.v1.SetIamPolicyRequest + * StreamingPullRequest streamAckDeadlineSeconds. + * @member {number} streamAckDeadlineSeconds + * @memberof google.pubsub.v1.StreamingPullRequest * @instance */ - SetIamPolicyRequest.prototype.resource = ""; + StreamingPullRequest.prototype.streamAckDeadlineSeconds = 0; /** - * SetIamPolicyRequest policy. - * @member {google.iam.v1.IPolicy|null|undefined} policy - * @memberof google.iam.v1.SetIamPolicyRequest + * StreamingPullRequest clientId. + * @member {string} clientId + * @memberof google.pubsub.v1.StreamingPullRequest * @instance */ - SetIamPolicyRequest.prototype.policy = null; + StreamingPullRequest.prototype.clientId = ""; /** - * Creates a new SetIamPolicyRequest instance using the specified properties. + * Creates a new StreamingPullRequest instance using the specified properties. * @function create - * @memberof google.iam.v1.SetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullRequest * @static - * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance + * @param {google.pubsub.v1.IStreamingPullRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest instance */ - SetIamPolicyRequest.create = function create(properties) { - return new SetIamPolicyRequest(properties); + StreamingPullRequest.create = function create(properties) { + return new StreamingPullRequest(properties); }; /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * Encodes the specified StreamingPullRequest message. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. * @function encode - * @memberof google.iam.v1.SetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullRequest * @static - * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {google.pubsub.v1.IStreamingPullRequest} message StreamingPullRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetIamPolicyRequest.encode = function encode(message, writer) { + StreamingPullRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.resource != null && message.hasOwnProperty("resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.policy != null && message.hasOwnProperty("policy")) - $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.subscription != null && message.hasOwnProperty("subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.ackIds != null && message.ackIds.length) + for (var i = 0; i < message.ackIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ackIds[i]); + if (message.modifyDeadlineSeconds != null && message.modifyDeadlineSeconds.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.modifyDeadlineSeconds.length; ++i) + writer.int32(message.modifyDeadlineSeconds[i]); + writer.ldelim(); + } + if (message.modifyDeadlineAckIds != null && message.modifyDeadlineAckIds.length) + for (var i = 0; i < message.modifyDeadlineAckIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.modifyDeadlineAckIds[i]); + if (message.streamAckDeadlineSeconds != null && message.hasOwnProperty("streamAckDeadlineSeconds")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.streamAckDeadlineSeconds); + if (message.clientId != null && message.hasOwnProperty("clientId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.clientId); return writer; }; /** - * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * Encodes the specified StreamingPullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.iam.v1.SetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullRequest * @static - * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {google.pubsub.v1.IStreamingPullRequest} message StreamingPullRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + StreamingPullRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * Decodes a StreamingPullRequest message from the specified reader or buffer. * @function decode - * @memberof google.iam.v1.SetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetIamPolicyRequest.decode = function decode(reader, length) { + StreamingPullRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.StreamingPullRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.resource = reader.string(); + message.subscription = reader.string(); + break; + case 2: + if (!(message.ackIds && message.ackIds.length)) + message.ackIds = []; + message.ackIds.push(reader.string()); + break; + case 3: + if (!(message.modifyDeadlineSeconds && message.modifyDeadlineSeconds.length)) + message.modifyDeadlineSeconds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.modifyDeadlineSeconds.push(reader.int32()); + } else + message.modifyDeadlineSeconds.push(reader.int32()); break; - case 2: - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + case 4: + if (!(message.modifyDeadlineAckIds && message.modifyDeadlineAckIds.length)) + message.modifyDeadlineAckIds = []; + message.modifyDeadlineAckIds.push(reader.string()); + break; + case 5: + message.streamAckDeadlineSeconds = reader.int32(); + break; + case 6: + message.clientId = reader.string(); break; default: reader.skipType(tag & 7); @@ -21691,122 +22120,187 @@ }; /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a StreamingPullRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.iam.v1.SetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + StreamingPullRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetIamPolicyRequest message. + * Verifies a StreamingPullRequest message. * @function verify - * @memberof google.iam.v1.SetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetIamPolicyRequest.verify = function verify(message) { + StreamingPullRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.iam.v1.Policy.verify(message.policy); - if (error) - return "policy." + error; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.ackIds != null && message.hasOwnProperty("ackIds")) { + if (!Array.isArray(message.ackIds)) + return "ackIds: array expected"; + for (var i = 0; i < message.ackIds.length; ++i) + if (!$util.isString(message.ackIds[i])) + return "ackIds: string[] expected"; + } + if (message.modifyDeadlineSeconds != null && message.hasOwnProperty("modifyDeadlineSeconds")) { + if (!Array.isArray(message.modifyDeadlineSeconds)) + return "modifyDeadlineSeconds: array expected"; + for (var i = 0; i < message.modifyDeadlineSeconds.length; ++i) + if (!$util.isInteger(message.modifyDeadlineSeconds[i])) + return "modifyDeadlineSeconds: integer[] expected"; + } + if (message.modifyDeadlineAckIds != null && message.hasOwnProperty("modifyDeadlineAckIds")) { + if (!Array.isArray(message.modifyDeadlineAckIds)) + return "modifyDeadlineAckIds: array expected"; + for (var i = 0; i < message.modifyDeadlineAckIds.length; ++i) + if (!$util.isString(message.modifyDeadlineAckIds[i])) + return "modifyDeadlineAckIds: string[] expected"; } + if (message.streamAckDeadlineSeconds != null && message.hasOwnProperty("streamAckDeadlineSeconds")) + if (!$util.isInteger(message.streamAckDeadlineSeconds)) + return "streamAckDeadlineSeconds: integer expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; return null; }; /** - * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StreamingPullRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.iam.v1.SetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullRequest * @static * @param {Object.} object Plain object - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest */ - SetIamPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) + StreamingPullRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.StreamingPullRequest) return object; - var message = new $root.google.iam.v1.SetIamPolicyRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); - message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + var message = new $root.google.pubsub.v1.StreamingPullRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.ackIds) { + if (!Array.isArray(object.ackIds)) + throw TypeError(".google.pubsub.v1.StreamingPullRequest.ackIds: array expected"); + message.ackIds = []; + for (var i = 0; i < object.ackIds.length; ++i) + message.ackIds[i] = String(object.ackIds[i]); } + if (object.modifyDeadlineSeconds) { + if (!Array.isArray(object.modifyDeadlineSeconds)) + throw TypeError(".google.pubsub.v1.StreamingPullRequest.modifyDeadlineSeconds: array expected"); + message.modifyDeadlineSeconds = []; + for (var i = 0; i < object.modifyDeadlineSeconds.length; ++i) + message.modifyDeadlineSeconds[i] = object.modifyDeadlineSeconds[i] | 0; + } + if (object.modifyDeadlineAckIds) { + if (!Array.isArray(object.modifyDeadlineAckIds)) + throw TypeError(".google.pubsub.v1.StreamingPullRequest.modifyDeadlineAckIds: array expected"); + message.modifyDeadlineAckIds = []; + for (var i = 0; i < object.modifyDeadlineAckIds.length; ++i) + message.modifyDeadlineAckIds[i] = String(object.modifyDeadlineAckIds[i]); + } + if (object.streamAckDeadlineSeconds != null) + message.streamAckDeadlineSeconds = object.streamAckDeadlineSeconds | 0; + if (object.clientId != null) + message.clientId = String(object.clientId); return message; }; /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * Creates a plain object from a StreamingPullRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.iam.v1.SetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullRequest * @static - * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest + * @param {google.pubsub.v1.StreamingPullRequest} message StreamingPullRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetIamPolicyRequest.toObject = function toObject(message, options) { + StreamingPullRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.ackIds = []; + object.modifyDeadlineSeconds = []; + object.modifyDeadlineAckIds = []; + } if (options.defaults) { - object.resource = ""; - object.policy = null; + object.subscription = ""; + object.streamAckDeadlineSeconds = 0; + object.clientId = ""; } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.ackIds && message.ackIds.length) { + object.ackIds = []; + for (var j = 0; j < message.ackIds.length; ++j) + object.ackIds[j] = message.ackIds[j]; + } + if (message.modifyDeadlineSeconds && message.modifyDeadlineSeconds.length) { + object.modifyDeadlineSeconds = []; + for (var j = 0; j < message.modifyDeadlineSeconds.length; ++j) + object.modifyDeadlineSeconds[j] = message.modifyDeadlineSeconds[j]; + } + if (message.modifyDeadlineAckIds && message.modifyDeadlineAckIds.length) { + object.modifyDeadlineAckIds = []; + for (var j = 0; j < message.modifyDeadlineAckIds.length; ++j) + object.modifyDeadlineAckIds[j] = message.modifyDeadlineAckIds[j]; + } + if (message.streamAckDeadlineSeconds != null && message.hasOwnProperty("streamAckDeadlineSeconds")) + object.streamAckDeadlineSeconds = message.streamAckDeadlineSeconds; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; return object; }; /** - * Converts this SetIamPolicyRequest to JSON. + * Converts this StreamingPullRequest to JSON. * @function toJSON - * @memberof google.iam.v1.SetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullRequest * @instance * @returns {Object.} JSON object */ - SetIamPolicyRequest.prototype.toJSON = function toJSON() { + StreamingPullRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SetIamPolicyRequest; + return StreamingPullRequest; })(); - v1.GetIamPolicyRequest = (function() { + v1.StreamingPullResponse = (function() { /** - * Properties of a GetIamPolicyRequest. - * @memberof google.iam.v1 - * @interface IGetIamPolicyRequest - * @property {string|null} [resource] GetIamPolicyRequest resource - * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options + * Properties of a StreamingPullResponse. + * @memberof google.pubsub.v1 + * @interface IStreamingPullResponse + * @property {Array.|null} [receivedMessages] StreamingPullResponse receivedMessages */ /** - * Constructs a new GetIamPolicyRequest. - * @memberof google.iam.v1 - * @classdesc Represents a GetIamPolicyRequest. - * @implements IGetIamPolicyRequest + * Constructs a new StreamingPullResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a StreamingPullResponse. + * @implements IStreamingPullResponse * @constructor - * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + * @param {google.pubsub.v1.IStreamingPullResponse=} [properties] Properties to set */ - function GetIamPolicyRequest(properties) { + function StreamingPullResponse(properties) { + this.receivedMessages = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21814,88 +22308,78 @@ } /** - * GetIamPolicyRequest resource. - * @member {string} resource - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - */ - GetIamPolicyRequest.prototype.resource = ""; - - /** - * GetIamPolicyRequest options. - * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options - * @memberof google.iam.v1.GetIamPolicyRequest + * StreamingPullResponse receivedMessages. + * @member {Array.} receivedMessages + * @memberof google.pubsub.v1.StreamingPullResponse * @instance */ - GetIamPolicyRequest.prototype.options = null; + StreamingPullResponse.prototype.receivedMessages = $util.emptyArray; /** - * Creates a new GetIamPolicyRequest instance using the specified properties. + * Creates a new StreamingPullResponse instance using the specified properties. * @function create - * @memberof google.iam.v1.GetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullResponse * @static - * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance + * @param {google.pubsub.v1.IStreamingPullResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse instance */ - GetIamPolicyRequest.create = function create(properties) { - return new GetIamPolicyRequest(properties); + StreamingPullResponse.create = function create(properties) { + return new StreamingPullResponse(properties); }; /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * Encodes the specified StreamingPullResponse message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. * @function encode - * @memberof google.iam.v1.GetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullResponse * @static - * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {google.pubsub.v1.IStreamingPullResponse} message StreamingPullResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetIamPolicyRequest.encode = function encode(message, writer) { + StreamingPullResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.resource != null && message.hasOwnProperty("resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.options != null && message.hasOwnProperty("options")) - $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.receivedMessages != null && message.receivedMessages.length) + for (var i = 0; i < message.receivedMessages.length; ++i) + $root.google.pubsub.v1.ReceivedMessage.encode(message.receivedMessages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * Encodes the specified StreamingPullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.iam.v1.GetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullResponse * @static - * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {google.pubsub.v1.IStreamingPullResponse} message StreamingPullResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + StreamingPullResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * Decodes a StreamingPullResponse message from the specified reader or buffer. * @function decode - * @memberof google.iam.v1.GetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetIamPolicyRequest.decode = function decode(reader, length) { + StreamingPullResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.StreamingPullResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.resource = reader.string(); - break; - case 2: - message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); + if (!(message.receivedMessages && message.receivedMessages.length)) + message.receivedMessages = []; + message.receivedMessages.push($root.google.pubsub.v1.ReceivedMessage.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -21906,123 +22390,127 @@ }; /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a StreamingPullResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.iam.v1.GetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + StreamingPullResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetIamPolicyRequest message. + * Verifies a StreamingPullResponse message. * @function verify - * @memberof google.iam.v1.GetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetIamPolicyRequest.verify = function verify(message) { + StreamingPullResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); - if (error) - return "options." + error; + if (message.receivedMessages != null && message.hasOwnProperty("receivedMessages")) { + if (!Array.isArray(message.receivedMessages)) + return "receivedMessages: array expected"; + for (var i = 0; i < message.receivedMessages.length; ++i) { + var error = $root.google.pubsub.v1.ReceivedMessage.verify(message.receivedMessages[i]); + if (error) + return "receivedMessages." + error; + } } return null; }; /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StreamingPullResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.iam.v1.GetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullResponse * @static * @param {Object.} object Plain object - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse */ - GetIamPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) + StreamingPullResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.StreamingPullResponse) return object; - var message = new $root.google.iam.v1.GetIamPolicyRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); - message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); + var message = new $root.google.pubsub.v1.StreamingPullResponse(); + if (object.receivedMessages) { + if (!Array.isArray(object.receivedMessages)) + throw TypeError(".google.pubsub.v1.StreamingPullResponse.receivedMessages: array expected"); + message.receivedMessages = []; + for (var i = 0; i < object.receivedMessages.length; ++i) { + if (typeof object.receivedMessages[i] !== "object") + throw TypeError(".google.pubsub.v1.StreamingPullResponse.receivedMessages: object expected"); + message.receivedMessages[i] = $root.google.pubsub.v1.ReceivedMessage.fromObject(object.receivedMessages[i]); + } } return message; }; /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * Creates a plain object from a StreamingPullResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.iam.v1.GetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullResponse * @static - * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest + * @param {google.pubsub.v1.StreamingPullResponse} message StreamingPullResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetIamPolicyRequest.toObject = function toObject(message, options) { + StreamingPullResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.resource = ""; - object.options = null; + if (options.arrays || options.defaults) + object.receivedMessages = []; + if (message.receivedMessages && message.receivedMessages.length) { + object.receivedMessages = []; + for (var j = 0; j < message.receivedMessages.length; ++j) + object.receivedMessages[j] = $root.google.pubsub.v1.ReceivedMessage.toObject(message.receivedMessages[j], options); } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); return object; }; /** - * Converts this GetIamPolicyRequest to JSON. + * Converts this StreamingPullResponse to JSON. * @function toJSON - * @memberof google.iam.v1.GetIamPolicyRequest + * @memberof google.pubsub.v1.StreamingPullResponse * @instance * @returns {Object.} JSON object */ - GetIamPolicyRequest.prototype.toJSON = function toJSON() { + StreamingPullResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetIamPolicyRequest; + return StreamingPullResponse; })(); - v1.TestIamPermissionsRequest = (function() { + v1.CreateSnapshotRequest = (function() { /** - * Properties of a TestIamPermissionsRequest. - * @memberof google.iam.v1 - * @interface ITestIamPermissionsRequest - * @property {string|null} [resource] TestIamPermissionsRequest resource - * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions + * Properties of a CreateSnapshotRequest. + * @memberof google.pubsub.v1 + * @interface ICreateSnapshotRequest + * @property {string|null} [name] CreateSnapshotRequest name + * @property {string|null} [subscription] CreateSnapshotRequest subscription + * @property {Object.|null} [labels] CreateSnapshotRequest labels */ /** - * Constructs a new TestIamPermissionsRequest. - * @memberof google.iam.v1 - * @classdesc Represents a TestIamPermissionsRequest. - * @implements ITestIamPermissionsRequest + * Constructs a new CreateSnapshotRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a CreateSnapshotRequest. + * @implements ICreateSnapshotRequest * @constructor - * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + * @param {google.pubsub.v1.ICreateSnapshotRequest=} [properties] Properties to set */ - function TestIamPermissionsRequest(properties) { - this.permissions = []; + function CreateSnapshotRequest(properties) { + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22030,91 +22518,107 @@ } /** - * TestIamPermissionsRequest resource. - * @member {string} resource - * @memberof google.iam.v1.TestIamPermissionsRequest + * CreateSnapshotRequest name. + * @member {string} name + * @memberof google.pubsub.v1.CreateSnapshotRequest * @instance */ - TestIamPermissionsRequest.prototype.resource = ""; + CreateSnapshotRequest.prototype.name = ""; /** - * TestIamPermissionsRequest permissions. - * @member {Array.} permissions - * @memberof google.iam.v1.TestIamPermissionsRequest + * CreateSnapshotRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.CreateSnapshotRequest * @instance */ - TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; + CreateSnapshotRequest.prototype.subscription = ""; /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. + * CreateSnapshotRequest labels. + * @member {Object.} labels + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @instance + */ + CreateSnapshotRequest.prototype.labels = $util.emptyObject; + + /** + * Creates a new CreateSnapshotRequest instance using the specified properties. * @function create - * @memberof google.iam.v1.TestIamPermissionsRequest + * @memberof google.pubsub.v1.CreateSnapshotRequest * @static - * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance + * @param {google.pubsub.v1.ICreateSnapshotRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest instance */ - TestIamPermissionsRequest.create = function create(properties) { - return new TestIamPermissionsRequest(properties); + CreateSnapshotRequest.create = function create(properties) { + return new CreateSnapshotRequest(properties); }; /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * Encodes the specified CreateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. * @function encode - * @memberof google.iam.v1.TestIamPermissionsRequest + * @memberof google.pubsub.v1.CreateSnapshotRequest * @static - * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {google.pubsub.v1.ICreateSnapshotRequest} message CreateSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TestIamPermissionsRequest.encode = function encode(message, writer) { + CreateSnapshotRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.resource != null && message.hasOwnProperty("resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.subscription != null && message.hasOwnProperty("subscription")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subscription); + if (message.labels != null && message.hasOwnProperty("labels")) + for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * Encodes the specified CreateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.iam.v1.TestIamPermissionsRequest + * @memberof google.pubsub.v1.CreateSnapshotRequest * @static - * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {google.pubsub.v1.ICreateSnapshotRequest} message CreateSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * Decodes a CreateSnapshotRequest message from the specified reader or buffer. * @function decode - * @memberof google.iam.v1.TestIamPermissionsRequest + * @memberof google.pubsub.v1.CreateSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TestIamPermissionsRequest.decode = function decode(reader, length) { + CreateSnapshotRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.CreateSnapshotRequest(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.resource = reader.string(); + message.name = reader.string(); break; case 2: - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); + message.subscription = reader.string(); + break; + case 3: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); break; default: reader.skipType(tag & 7); @@ -22125,129 +22629,140 @@ }; /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSnapshotRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.iam.v1.TestIamPermissionsRequest + * @memberof google.pubsub.v1.CreateSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + CreateSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TestIamPermissionsRequest message. + * Verifies a CreateSnapshotRequest message. * @function verify - * @memberof google.iam.v1.TestIamPermissionsRequest + * @memberof google.pubsub.v1.CreateSnapshotRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TestIamPermissionsRequest.verify = function verify(message) { + CreateSnapshotRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: 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 TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - */ - TestIamPermissionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) - return object; - var message = new $root.google.iam.v1.TestIamPermissionsRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); + * @memberof google.pubsub.v1.CreateSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest + */ + CreateSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.CreateSnapshotRequest) + return object; + var message = new $root.google.pubsub.v1.CreateSnapshotRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.pubsub.v1.CreateSnapshotRequest.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 TestIamPermissionsRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateSnapshotRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.iam.v1.TestIamPermissionsRequest + * @memberof google.pubsub.v1.CreateSnapshotRequest * @static - * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest + * @param {google.pubsub.v1.CreateSnapshotRequest} message CreateSnapshotRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TestIamPermissionsRequest.toObject = function toObject(message, options) { + CreateSnapshotRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (options.defaults) - object.resource = ""; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.subscription = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + 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 TestIamPermissionsRequest to JSON. + * Converts this CreateSnapshotRequest to JSON. * @function toJSON - * @memberof google.iam.v1.TestIamPermissionsRequest + * @memberof google.pubsub.v1.CreateSnapshotRequest * @instance * @returns {Object.} JSON object */ - TestIamPermissionsRequest.prototype.toJSON = function toJSON() { + CreateSnapshotRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TestIamPermissionsRequest; + return CreateSnapshotRequest; })(); - v1.TestIamPermissionsResponse = (function() { + v1.UpdateSnapshotRequest = (function() { /** - * Properties of a TestIamPermissionsResponse. - * @memberof google.iam.v1 - * @interface ITestIamPermissionsResponse - * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions + * Properties of an UpdateSnapshotRequest. + * @memberof google.pubsub.v1 + * @interface IUpdateSnapshotRequest + * @property {google.pubsub.v1.ISnapshot|null} [snapshot] UpdateSnapshotRequest snapshot + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSnapshotRequest updateMask */ /** - * Constructs a new TestIamPermissionsResponse. - * @memberof google.iam.v1 - * @classdesc Represents a TestIamPermissionsResponse. - * @implements ITestIamPermissionsResponse + * Constructs a new UpdateSnapshotRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents an UpdateSnapshotRequest. + * @implements IUpdateSnapshotRequest * @constructor - * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + * @param {google.pubsub.v1.IUpdateSnapshotRequest=} [properties] Properties to set */ - function TestIamPermissionsResponse(properties) { - this.permissions = []; + function UpdateSnapshotRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22255,78 +22770,88 @@ } /** - * TestIamPermissionsResponse permissions. - * @member {Array.} permissions - * @memberof google.iam.v1.TestIamPermissionsResponse + * UpdateSnapshotRequest snapshot. + * @member {google.pubsub.v1.ISnapshot|null|undefined} snapshot + * @memberof google.pubsub.v1.UpdateSnapshotRequest * @instance */ - TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; + UpdateSnapshotRequest.prototype.snapshot = null; /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. + * UpdateSnapshotRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.pubsub.v1.UpdateSnapshotRequest + * @instance + */ + UpdateSnapshotRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSnapshotRequest instance using the specified properties. * @function create - * @memberof google.iam.v1.TestIamPermissionsResponse + * @memberof google.pubsub.v1.UpdateSnapshotRequest * @static - * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance + * @param {google.pubsub.v1.IUpdateSnapshotRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest instance */ - TestIamPermissionsResponse.create = function create(properties) { - return new TestIamPermissionsResponse(properties); + UpdateSnapshotRequest.create = function create(properties) { + return new UpdateSnapshotRequest(properties); }; /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * Encodes the specified UpdateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. * @function encode - * @memberof google.iam.v1.TestIamPermissionsResponse + * @memberof google.pubsub.v1.UpdateSnapshotRequest * @static - * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {google.pubsub.v1.IUpdateSnapshotRequest} message UpdateSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TestIamPermissionsResponse.encode = function encode(message, writer) { + UpdateSnapshotRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + $root.google.pubsub.v1.Snapshot.encode(message.snapshot, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * Encodes the specified UpdateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.iam.v1.TestIamPermissionsResponse + * @memberof google.pubsub.v1.UpdateSnapshotRequest * @static - * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {google.pubsub.v1.IUpdateSnapshotRequest} message UpdateSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + UpdateSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * Decodes an UpdateSnapshotRequest message from the specified reader or buffer. * @function decode - * @memberof google.iam.v1.TestIamPermissionsResponse + * @memberof google.pubsub.v1.UpdateSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TestIamPermissionsResponse.decode = function decode(reader, length) { + UpdateSnapshotRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.UpdateSnapshotRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); + message.snapshot = $root.google.pubsub.v1.Snapshot.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -22337,119 +22862,130 @@ }; /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateSnapshotRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.iam.v1.TestIamPermissionsResponse + * @memberof google.pubsub.v1.UpdateSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + UpdateSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TestIamPermissionsResponse message. + * Verifies an UpdateSnapshotRequest message. * @function verify - * @memberof google.iam.v1.TestIamPermissionsResponse + * @memberof google.pubsub.v1.UpdateSnapshotRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TestIamPermissionsResponse.verify = function verify(message) { + UpdateSnapshotRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + var error = $root.google.pubsub.v1.Snapshot.verify(message.snapshot); + if (error) + return "snapshot." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } return null; }; /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.iam.v1.TestIamPermissionsResponse + * @memberof google.pubsub.v1.UpdateSnapshotRequest * @static * @param {Object.} object Plain object - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest */ - TestIamPermissionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) + UpdateSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.UpdateSnapshotRequest) return object; - var message = new $root.google.iam.v1.TestIamPermissionsResponse(); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); + var message = new $root.google.pubsub.v1.UpdateSnapshotRequest(); + if (object.snapshot != null) { + if (typeof object.snapshot !== "object") + throw TypeError(".google.pubsub.v1.UpdateSnapshotRequest.snapshot: object expected"); + message.snapshot = $root.google.pubsub.v1.Snapshot.fromObject(object.snapshot); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.pubsub.v1.UpdateSnapshotRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * Creates a plain object from an UpdateSnapshotRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.iam.v1.TestIamPermissionsResponse + * @memberof google.pubsub.v1.UpdateSnapshotRequest * @static - * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse + * @param {google.pubsub.v1.UpdateSnapshotRequest} message UpdateSnapshotRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TestIamPermissionsResponse.toObject = function toObject(message, options) { + UpdateSnapshotRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; + if (options.defaults) { + object.snapshot = null; + object.updateMask = null; } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = $root.google.pubsub.v1.Snapshot.toObject(message.snapshot, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this TestIamPermissionsResponse to JSON. + * Converts this UpdateSnapshotRequest to JSON. * @function toJSON - * @memberof google.iam.v1.TestIamPermissionsResponse + * @memberof google.pubsub.v1.UpdateSnapshotRequest * @instance * @returns {Object.} JSON object */ - TestIamPermissionsResponse.prototype.toJSON = function toJSON() { + UpdateSnapshotRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TestIamPermissionsResponse; + return UpdateSnapshotRequest; })(); - v1.GetPolicyOptions = (function() { + v1.Snapshot = (function() { /** - * Properties of a GetPolicyOptions. - * @memberof google.iam.v1 - * @interface IGetPolicyOptions - * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion + * Properties of a Snapshot. + * @memberof google.pubsub.v1 + * @interface ISnapshot + * @property {string|null} [name] Snapshot name + * @property {string|null} [topic] Snapshot topic + * @property {google.protobuf.ITimestamp|null} [expireTime] Snapshot expireTime + * @property {Object.|null} [labels] Snapshot labels */ - - /** - * Constructs a new GetPolicyOptions. - * @memberof google.iam.v1 - * @classdesc Represents a GetPolicyOptions. - * @implements IGetPolicyOptions + + /** + * Constructs a new Snapshot. + * @memberof google.pubsub.v1 + * @classdesc Represents a Snapshot. + * @implements ISnapshot * @constructor - * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + * @param {google.pubsub.v1.ISnapshot=} [properties] Properties to set */ - function GetPolicyOptions(properties) { + function Snapshot(properties) { + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22457,75 +22993,120 @@ } /** - * GetPolicyOptions requestedPolicyVersion. - * @member {number} requestedPolicyVersion - * @memberof google.iam.v1.GetPolicyOptions + * Snapshot name. + * @member {string} name + * @memberof google.pubsub.v1.Snapshot * @instance */ - GetPolicyOptions.prototype.requestedPolicyVersion = 0; + Snapshot.prototype.name = ""; /** - * Creates a new GetPolicyOptions instance using the specified properties. + * Snapshot topic. + * @member {string} topic + * @memberof google.pubsub.v1.Snapshot + * @instance + */ + Snapshot.prototype.topic = ""; + + /** + * Snapshot expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.pubsub.v1.Snapshot + * @instance + */ + Snapshot.prototype.expireTime = null; + + /** + * Snapshot labels. + * @member {Object.} labels + * @memberof google.pubsub.v1.Snapshot + * @instance + */ + Snapshot.prototype.labels = $util.emptyObject; + + /** + * Creates a new Snapshot instance using the specified properties. * @function create - * @memberof google.iam.v1.GetPolicyOptions + * @memberof google.pubsub.v1.Snapshot * @static - * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance + * @param {google.pubsub.v1.ISnapshot=} [properties] Properties to set + * @returns {google.pubsub.v1.Snapshot} Snapshot instance */ - GetPolicyOptions.create = function create(properties) { - return new GetPolicyOptions(properties); + Snapshot.create = function create(properties) { + return new Snapshot(properties); }; /** - * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * Encodes the specified Snapshot message. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. * @function encode - * @memberof google.iam.v1.GetPolicyOptions + * @memberof google.pubsub.v1.Snapshot * @static - * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {google.pubsub.v1.ISnapshot} message Snapshot message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetPolicyOptions.encode = function encode(message, writer) { + Snapshot.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.topic != null && message.hasOwnProperty("topic")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.topic); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && message.hasOwnProperty("labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).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 GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages. * @function encodeDelimited - * @memberof google.iam.v1.GetPolicyOptions + * @memberof google.pubsub.v1.Snapshot * @static - * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {google.pubsub.v1.ISnapshot} message Snapshot message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { + Snapshot.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetPolicyOptions message from the specified reader or buffer. + * Decodes a Snapshot message from the specified reader or buffer. * @function decode - * @memberof google.iam.v1.GetPolicyOptions + * @memberof google.pubsub.v1.Snapshot * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @returns {google.pubsub.v1.Snapshot} Snapshot * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetPolicyOptions.decode = function decode(reader, length) { + Snapshot.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.Snapshot(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.requestedPolicyVersion = reader.int32(); + message.name = reader.string(); + break; + case 2: + message.topic = reader.string(); + break; + case 3: + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); break; default: reader.skipType(tag & 7); @@ -22536,215 +23117,228 @@ }; /** - * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * Decodes a Snapshot message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.iam.v1.GetPolicyOptions + * @memberof google.pubsub.v1.Snapshot * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @returns {google.pubsub.v1.Snapshot} Snapshot * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { + Snapshot.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetPolicyOptions message. + * Verifies a Snapshot message. * @function verify - * @memberof google.iam.v1.GetPolicyOptions + * @memberof google.pubsub.v1.Snapshot * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetPolicyOptions.verify = function verify(message) { + Snapshot.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) - if (!$util.isInteger(message.requestedPolicyVersion)) - return "requestedPolicyVersion: integer expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + 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"; + } return null; }; /** - * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.iam.v1.GetPolicyOptions + * @memberof google.pubsub.v1.Snapshot * @static * @param {Object.} object Plain object - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @returns {google.pubsub.v1.Snapshot} Snapshot */ - GetPolicyOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.GetPolicyOptions) + Snapshot.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.Snapshot) return object; - var message = new $root.google.iam.v1.GetPolicyOptions(); - if (object.requestedPolicyVersion != null) - message.requestedPolicyVersion = object.requestedPolicyVersion | 0; + var message = new $root.google.pubsub.v1.Snapshot(); + if (object.name != null) + message.name = String(object.name); + if (object.topic != null) + message.topic = String(object.topic); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.pubsub.v1.Snapshot.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.pubsub.v1.Snapshot.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 GetPolicyOptions message. Also converts values to other types if specified. + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. * @function toObject - * @memberof google.iam.v1.GetPolicyOptions + * @memberof google.pubsub.v1.Snapshot * @static - * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions + * @param {google.pubsub.v1.Snapshot} message Snapshot * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetPolicyOptions.toObject = function toObject(message, options) { + Snapshot.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.requestedPolicyVersion = 0; - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) - object.requestedPolicyVersion = message.requestedPolicyVersion; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.topic = ""; + object.expireTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + 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]]; + } return object; }; /** - * Converts this GetPolicyOptions to JSON. + * Converts this Snapshot to JSON. * @function toJSON - * @memberof google.iam.v1.GetPolicyOptions + * @memberof google.pubsub.v1.Snapshot * @instance * @returns {Object.} JSON object */ - GetPolicyOptions.prototype.toJSON = function toJSON() { + Snapshot.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetPolicyOptions; + return Snapshot; })(); - v1.Policy = (function() { + v1.GetSnapshotRequest = (function() { /** - * Properties of a Policy. - * @memberof google.iam.v1 - * @interface IPolicy - * @property {number|null} [version] Policy version - * @property {Array.|null} [bindings] Policy bindings - * @property {Uint8Array|null} [etag] Policy etag + * Properties of a GetSnapshotRequest. + * @memberof google.pubsub.v1 + * @interface IGetSnapshotRequest + * @property {string|null} [snapshot] GetSnapshotRequest snapshot */ /** - * Constructs a new Policy. - * @memberof google.iam.v1 - * @classdesc Represents a Policy. - * @implements IPolicy + * Constructs a new GetSnapshotRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a GetSnapshotRequest. + * @implements IGetSnapshotRequest * @constructor - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - */ - function Policy(properties) { - this.bindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Policy version. - * @member {number} version - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.version = 0; - - /** - * Policy bindings. - * @member {Array.} bindings - * @memberof google.iam.v1.Policy - * @instance + * @param {google.pubsub.v1.IGetSnapshotRequest=} [properties] Properties to set */ - Policy.prototype.bindings = $util.emptyArray; + function GetSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Policy etag. - * @member {Uint8Array} etag - * @memberof google.iam.v1.Policy + * GetSnapshotRequest snapshot. + * @member {string} snapshot + * @memberof google.pubsub.v1.GetSnapshotRequest * @instance */ - Policy.prototype.etag = $util.newBuffer([]); + GetSnapshotRequest.prototype.snapshot = ""; /** - * Creates a new Policy instance using the specified properties. + * Creates a new GetSnapshotRequest instance using the specified properties. * @function create - * @memberof google.iam.v1.Policy + * @memberof google.pubsub.v1.GetSnapshotRequest * @static - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - * @returns {google.iam.v1.Policy} Policy instance + * @param {google.pubsub.v1.IGetSnapshotRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest instance */ - Policy.create = function create(properties) { - return new Policy(properties); + GetSnapshotRequest.create = function create(properties) { + return new GetSnapshotRequest(properties); }; /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. * @function encode - * @memberof google.iam.v1.Policy + * @memberof google.pubsub.v1.GetSnapshotRequest * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {google.pubsub.v1.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Policy.encode = function encode(message, writer) { + GetSnapshotRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && message.hasOwnProperty("version")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); - if (message.etag != null && message.hasOwnProperty("etag")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); - if (message.bindings != null && message.bindings.length) - for (var i = 0; i < message.bindings.length; ++i) - $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshot); return writer; }; /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.iam.v1.Policy + * @memberof google.pubsub.v1.GetSnapshotRequest * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {google.pubsub.v1.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Policy.encodeDelimited = function encodeDelimited(message, writer) { + GetSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Policy message from the specified reader or buffer. + * Decodes a GetSnapshotRequest message from the specified reader or buffer. * @function decode - * @memberof google.iam.v1.Policy + * @memberof google.pubsub.v1.GetSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Policy} Policy + * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Policy.decode = function decode(reader, length) { + GetSnapshotRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.GetSnapshotRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.version = reader.int32(); - break; - case 4: - if (!(message.bindings && message.bindings.length)) - message.bindings = []; - message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); - break; - case 3: - message.etag = reader.bytes(); + message.snapshot = reader.string(); break; default: reader.skipType(tag & 7); @@ -22755,154 +23349,109 @@ }; /** - * Decodes a Policy message from the specified reader or buffer, length delimited. + * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.iam.v1.Policy + * @memberof google.pubsub.v1.GetSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Policy} Policy + * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Policy.decodeDelimited = function decodeDelimited(reader) { + GetSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Policy message. + * Verifies a GetSnapshotRequest message. * @function verify - * @memberof google.iam.v1.Policy + * @memberof google.pubsub.v1.GetSnapshotRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Policy.verify = function verify(message) { + GetSnapshotRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - if (message.bindings != null && message.hasOwnProperty("bindings")) { - if (!Array.isArray(message.bindings)) - return "bindings: array expected"; - for (var i = 0; i < message.bindings.length; ++i) { - var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); - if (error) - return "bindings." + error; - } - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) - return "etag: buffer expected"; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + if (!$util.isString(message.snapshot)) + return "snapshot: string expected"; return null; }; /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.iam.v1.Policy + * @memberof google.pubsub.v1.GetSnapshotRequest * @static * @param {Object.} object Plain object - * @returns {google.iam.v1.Policy} Policy + * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest */ - Policy.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Policy) + GetSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.GetSnapshotRequest) return object; - var message = new $root.google.iam.v1.Policy(); - if (object.version != null) - message.version = object.version | 0; - if (object.bindings) { - if (!Array.isArray(object.bindings)) - throw TypeError(".google.iam.v1.Policy.bindings: array expected"); - message.bindings = []; - for (var i = 0; i < object.bindings.length; ++i) { - if (typeof object.bindings[i] !== "object") - throw TypeError(".google.iam.v1.Policy.bindings: object expected"); - message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); - } - } - if (object.etag != null) - if (typeof object.etag === "string") - $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); - else if (object.etag.length) - message.etag = object.etag; + var message = new $root.google.pubsub.v1.GetSnapshotRequest(); + if (object.snapshot != null) + message.snapshot = String(object.snapshot); return message; }; /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. + * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.iam.v1.Policy + * @memberof google.pubsub.v1.GetSnapshotRequest * @static - * @param {google.iam.v1.Policy} message Policy + * @param {google.pubsub.v1.GetSnapshotRequest} message GetSnapshotRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Policy.toObject = function toObject(message, options) { + GetSnapshotRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.bindings = []; - if (options.defaults) { - object.version = 0; - if (options.bytes === String) - object.etag = ""; - else { - object.etag = []; - if (options.bytes !== Array) - object.etag = $util.newBuffer(object.etag); - } - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; - if (message.bindings && message.bindings.length) { - object.bindings = []; - for (var j = 0; j < message.bindings.length; ++j) - object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); - } + if (options.defaults) + object.snapshot = ""; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = message.snapshot; return object; }; /** - * Converts this Policy to JSON. + * Converts this GetSnapshotRequest to JSON. * @function toJSON - * @memberof google.iam.v1.Policy + * @memberof google.pubsub.v1.GetSnapshotRequest * @instance * @returns {Object.} JSON object */ - Policy.prototype.toJSON = function toJSON() { + GetSnapshotRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Policy; + return GetSnapshotRequest; })(); - v1.Binding = (function() { + v1.ListSnapshotsRequest = (function() { /** - * Properties of a Binding. - * @memberof google.iam.v1 - * @interface IBinding - * @property {string|null} [role] Binding role - * @property {Array.|null} [members] Binding members - * @property {google.type.IExpr|null} [condition] Binding condition + * Properties of a ListSnapshotsRequest. + * @memberof google.pubsub.v1 + * @interface IListSnapshotsRequest + * @property {string|null} [project] ListSnapshotsRequest project + * @property {number|null} [pageSize] ListSnapshotsRequest pageSize + * @property {string|null} [pageToken] ListSnapshotsRequest pageToken */ /** - * Constructs a new Binding. - * @memberof google.iam.v1 - * @classdesc Represents a Binding. - * @implements IBinding + * Constructs a new ListSnapshotsRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSnapshotsRequest. + * @implements IListSnapshotsRequest * @constructor - * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @param {google.pubsub.v1.IListSnapshotsRequest=} [properties] Properties to set */ - function Binding(properties) { - this.members = []; + function ListSnapshotsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22910,104 +23459,101 @@ } /** - * Binding role. - * @member {string} role - * @memberof google.iam.v1.Binding + * ListSnapshotsRequest project. + * @member {string} project + * @memberof google.pubsub.v1.ListSnapshotsRequest * @instance */ - Binding.prototype.role = ""; + ListSnapshotsRequest.prototype.project = ""; /** - * Binding members. - * @member {Array.} members - * @memberof google.iam.v1.Binding + * ListSnapshotsRequest pageSize. + * @member {number} pageSize + * @memberof google.pubsub.v1.ListSnapshotsRequest * @instance */ - Binding.prototype.members = $util.emptyArray; + ListSnapshotsRequest.prototype.pageSize = 0; /** - * Binding condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.Binding + * ListSnapshotsRequest pageToken. + * @member {string} pageToken + * @memberof google.pubsub.v1.ListSnapshotsRequest * @instance */ - Binding.prototype.condition = null; + ListSnapshotsRequest.prototype.pageToken = ""; /** - * Creates a new Binding instance using the specified properties. + * Creates a new ListSnapshotsRequest instance using the specified properties. * @function create - * @memberof google.iam.v1.Binding + * @memberof google.pubsub.v1.ListSnapshotsRequest * @static - * @param {google.iam.v1.IBinding=} [properties] Properties to set - * @returns {google.iam.v1.Binding} Binding instance + * @param {google.pubsub.v1.IListSnapshotsRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest instance */ - Binding.create = function create(properties) { - return new Binding(properties); + ListSnapshotsRequest.create = function create(properties) { + return new ListSnapshotsRequest(properties); }; /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. * @function encode - * @memberof google.iam.v1.Binding + * @memberof google.pubsub.v1.ListSnapshotsRequest * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {google.pubsub.v1.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Binding.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.role != null && message.hasOwnProperty("role")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); - if (message.members != null && message.members.length) - for (var i = 0; i < message.members.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); - if (message.condition != null && message.hasOwnProperty("condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + ListSnapshotsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && message.hasOwnProperty("project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.iam.v1.Binding + * @memberof google.pubsub.v1.ListSnapshotsRequest * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {google.pubsub.v1.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Binding.encodeDelimited = function encodeDelimited(message, writer) { + ListSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Binding message from the specified reader or buffer. + * Decodes a ListSnapshotsRequest message from the specified reader or buffer. * @function decode - * @memberof google.iam.v1.Binding + * @memberof google.pubsub.v1.ListSnapshotsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Binding} Binding + * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Binding.decode = function decode(reader, length) { + ListSnapshotsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSnapshotsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.role = reader.string(); + message.project = reader.string(); break; case 2: - if (!(message.members && message.members.length)) - message.members = []; - message.members.push(reader.string()); + message.pageSize = reader.int32(); break; case 3: - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -23018,145 +23564,126 @@ }; /** - * Decodes a Binding message from the specified reader or buffer, length delimited. + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.iam.v1.Binding + * @memberof google.pubsub.v1.ListSnapshotsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Binding} Binding + * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Binding.decodeDelimited = function decodeDelimited(reader) { + ListSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Binding message. + * Verifies a ListSnapshotsRequest message. * @function verify - * @memberof google.iam.v1.Binding + * @memberof google.pubsub.v1.ListSnapshotsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Binding.verify = function verify(message) { + ListSnapshotsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.members != null && message.hasOwnProperty("members")) { - if (!Array.isArray(message.members)) - return "members: array expected"; - for (var i = 0; i < message.members.length; ++i) - if (!$util.isString(message.members[i])) - return "members: string[] expected"; - } - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: 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 Binding message from a plain object. Also converts values to their respective internal types. + * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.iam.v1.Binding + * @memberof google.pubsub.v1.ListSnapshotsRequest * @static * @param {Object.} object Plain object - * @returns {google.iam.v1.Binding} Binding + * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest */ - Binding.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Binding) + ListSnapshotsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSnapshotsRequest) return object; - var message = new $root.google.iam.v1.Binding(); - if (object.role != null) - message.role = String(object.role); - if (object.members) { - if (!Array.isArray(object.members)) - throw TypeError(".google.iam.v1.Binding.members: array expected"); - message.members = []; - for (var i = 0; i < object.members.length; ++i) - message.members[i] = String(object.members[i]); - } - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.Binding.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } + var message = new $root.google.pubsub.v1.ListSnapshotsRequest(); + if (object.project != null) + message.project = String(object.project); + 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 Binding message. Also converts values to other types if specified. + * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.iam.v1.Binding + * @memberof google.pubsub.v1.ListSnapshotsRequest * @static - * @param {google.iam.v1.Binding} message Binding + * @param {google.pubsub.v1.ListSnapshotsRequest} message ListSnapshotsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Binding.toObject = function toObject(message, options) { + ListSnapshotsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.members = []; if (options.defaults) { - object.role = ""; - object.condition = null; - } - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.members && message.members.length) { - object.members = []; - for (var j = 0; j < message.members.length; ++j) - object.members[j] = message.members[j]; + object.project = ""; + object.pageSize = 0; + object.pageToken = ""; } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this Binding to JSON. + * Converts this ListSnapshotsRequest to JSON. * @function toJSON - * @memberof google.iam.v1.Binding + * @memberof google.pubsub.v1.ListSnapshotsRequest * @instance * @returns {Object.} JSON object */ - Binding.prototype.toJSON = function toJSON() { + ListSnapshotsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Binding; + return ListSnapshotsRequest; })(); - v1.PolicyDelta = (function() { + v1.ListSnapshotsResponse = (function() { /** - * Properties of a PolicyDelta. - * @memberof google.iam.v1 - * @interface IPolicyDelta - * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas - * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + * Properties of a ListSnapshotsResponse. + * @memberof google.pubsub.v1 + * @interface IListSnapshotsResponse + * @property {Array.|null} [snapshots] ListSnapshotsResponse snapshots + * @property {string|null} [nextPageToken] ListSnapshotsResponse nextPageToken */ /** - * Constructs a new PolicyDelta. - * @memberof google.iam.v1 - * @classdesc Represents a PolicyDelta. - * @implements IPolicyDelta + * Constructs a new ListSnapshotsResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a ListSnapshotsResponse. + * @implements IListSnapshotsResponse * @constructor - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @param {google.pubsub.v1.IListSnapshotsResponse=} [properties] Properties to set */ - function PolicyDelta(properties) { - this.bindingDeltas = []; - this.auditConfigDeltas = []; + function ListSnapshotsResponse(properties) { + this.snapshots = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23164,94 +23691,91 @@ } /** - * PolicyDelta bindingDeltas. - * @member {Array.} bindingDeltas - * @memberof google.iam.v1.PolicyDelta + * ListSnapshotsResponse snapshots. + * @member {Array.} snapshots + * @memberof google.pubsub.v1.ListSnapshotsResponse * @instance */ - PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + ListSnapshotsResponse.prototype.snapshots = $util.emptyArray; /** - * PolicyDelta auditConfigDeltas. - * @member {Array.} auditConfigDeltas - * @memberof google.iam.v1.PolicyDelta + * ListSnapshotsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.pubsub.v1.ListSnapshotsResponse * @instance */ - PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + ListSnapshotsResponse.prototype.nextPageToken = ""; /** - * Creates a new PolicyDelta instance using the specified properties. + * Creates a new ListSnapshotsResponse instance using the specified properties. * @function create - * @memberof google.iam.v1.PolicyDelta + * @memberof google.pubsub.v1.ListSnapshotsResponse * @static - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + * @param {google.pubsub.v1.IListSnapshotsResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse instance */ - PolicyDelta.create = function create(properties) { - return new PolicyDelta(properties); + ListSnapshotsResponse.create = function create(properties) { + return new ListSnapshotsResponse(properties); }; /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. * @function encode - * @memberof google.iam.v1.PolicyDelta + * @memberof google.pubsub.v1.ListSnapshotsResponse * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {google.pubsub.v1.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PolicyDelta.encode = function encode(message, writer) { + ListSnapshotsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.bindingDeltas != null && message.bindingDeltas.length) - for (var i = 0; i < message.bindingDeltas.length; ++i) - $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) - for (var i = 0; i < message.auditConfigDeltas.length; ++i) - $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.snapshots != null && message.snapshots.length) + for (var i = 0; i < message.snapshots.length; ++i) + $root.google.pubsub.v1.Snapshot.encode(message.snapshots[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * Encodes the specified ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.iam.v1.PolicyDelta + * @memberof google.pubsub.v1.ListSnapshotsResponse * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {google.pubsub.v1.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + ListSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PolicyDelta message from the specified reader or buffer. + * Decodes a ListSnapshotsResponse message from the specified reader or buffer. * @function decode - * @memberof google.iam.v1.PolicyDelta + * @memberof google.pubsub.v1.ListSnapshotsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PolicyDelta.decode = function decode(reader, length) { + ListSnapshotsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSnapshotsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.bindingDeltas && message.bindingDeltas.length)) - message.bindingDeltas = []; - message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + if (!(message.snapshots && message.snapshots.length)) + message.snapshots = []; + message.snapshots.push($root.google.pubsub.v1.Snapshot.decode(reader, reader.uint32())); break; case 2: - if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) - message.auditConfigDeltas = []; - message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -23262,153 +23786,133 @@ }; /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.iam.v1.PolicyDelta + * @memberof google.pubsub.v1.ListSnapshotsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + ListSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PolicyDelta message. + * Verifies a ListSnapshotsResponse message. * @function verify - * @memberof google.iam.v1.PolicyDelta + * @memberof google.pubsub.v1.ListSnapshotsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PolicyDelta.verify = function verify(message) { + ListSnapshotsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { - if (!Array.isArray(message.bindingDeltas)) - return "bindingDeltas: array expected"; - for (var i = 0; i < message.bindingDeltas.length; ++i) { - var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); - if (error) - return "bindingDeltas." + error; - } - } - if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { - if (!Array.isArray(message.auditConfigDeltas)) - return "auditConfigDeltas: array expected"; - for (var i = 0; i < message.auditConfigDeltas.length; ++i) { - var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (message.snapshots != null && message.hasOwnProperty("snapshots")) { + if (!Array.isArray(message.snapshots)) + return "snapshots: array expected"; + for (var i = 0; i < message.snapshots.length; ++i) { + var error = $root.google.pubsub.v1.Snapshot.verify(message.snapshots[i]); if (error) - return "auditConfigDeltas." + error; + return "snapshots." + error; } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.iam.v1.PolicyDelta + * @memberof google.pubsub.v1.ListSnapshotsResponse * @static * @param {Object.} object Plain object - * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse */ - PolicyDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.PolicyDelta) + ListSnapshotsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.ListSnapshotsResponse) return object; - var message = new $root.google.iam.v1.PolicyDelta(); - if (object.bindingDeltas) { - if (!Array.isArray(object.bindingDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); - message.bindingDeltas = []; - for (var i = 0; i < object.bindingDeltas.length; ++i) { - if (typeof object.bindingDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); - message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); - } - } - if (object.auditConfigDeltas) { - if (!Array.isArray(object.auditConfigDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); - message.auditConfigDeltas = []; - for (var i = 0; i < object.auditConfigDeltas.length; ++i) { - if (typeof object.auditConfigDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); - message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + var message = new $root.google.pubsub.v1.ListSnapshotsResponse(); + if (object.snapshots) { + if (!Array.isArray(object.snapshots)) + throw TypeError(".google.pubsub.v1.ListSnapshotsResponse.snapshots: array expected"); + message.snapshots = []; + for (var i = 0; i < object.snapshots.length; ++i) { + if (typeof object.snapshots[i] !== "object") + throw TypeError(".google.pubsub.v1.ListSnapshotsResponse.snapshots: object expected"); + message.snapshots[i] = $root.google.pubsub.v1.Snapshot.fromObject(object.snapshots[i]); } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.iam.v1.PolicyDelta + * @memberof google.pubsub.v1.ListSnapshotsResponse * @static - * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {google.pubsub.v1.ListSnapshotsResponse} message ListSnapshotsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PolicyDelta.toObject = function toObject(message, options) { + ListSnapshotsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.bindingDeltas = []; - object.auditConfigDeltas = []; - } - if (message.bindingDeltas && message.bindingDeltas.length) { - object.bindingDeltas = []; - for (var j = 0; j < message.bindingDeltas.length; ++j) - object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); - } - if (message.auditConfigDeltas && message.auditConfigDeltas.length) { - object.auditConfigDeltas = []; - for (var j = 0; j < message.auditConfigDeltas.length; ++j) - object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + if (options.arrays || options.defaults) + object.snapshots = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.snapshots && message.snapshots.length) { + object.snapshots = []; + for (var j = 0; j < message.snapshots.length; ++j) + object.snapshots[j] = $root.google.pubsub.v1.Snapshot.toObject(message.snapshots[j], options); } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this PolicyDelta to JSON. + * Converts this ListSnapshotsResponse to JSON. * @function toJSON - * @memberof google.iam.v1.PolicyDelta + * @memberof google.pubsub.v1.ListSnapshotsResponse * @instance * @returns {Object.} JSON object */ - PolicyDelta.prototype.toJSON = function toJSON() { + ListSnapshotsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PolicyDelta; + return ListSnapshotsResponse; })(); - v1.BindingDelta = (function() { + v1.DeleteSnapshotRequest = (function() { /** - * Properties of a BindingDelta. - * @memberof google.iam.v1 - * @interface IBindingDelta - * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action - * @property {string|null} [role] BindingDelta role - * @property {string|null} [member] BindingDelta member - * @property {google.type.IExpr|null} [condition] BindingDelta condition + * Properties of a DeleteSnapshotRequest. + * @memberof google.pubsub.v1 + * @interface IDeleteSnapshotRequest + * @property {string|null} [snapshot] DeleteSnapshotRequest snapshot */ /** - * Constructs a new BindingDelta. - * @memberof google.iam.v1 - * @classdesc Represents a BindingDelta. - * @implements IBindingDelta + * Constructs a new DeleteSnapshotRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a DeleteSnapshotRequest. + * @implements IDeleteSnapshotRequest * @constructor - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @param {google.pubsub.v1.IDeleteSnapshotRequest=} [properties] Properties to set */ - function BindingDelta(properties) { + function DeleteSnapshotRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23416,114 +23920,75 @@ } /** - * BindingDelta action. - * @member {google.iam.v1.BindingDelta.Action} action - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.action = 0; - - /** - * BindingDelta role. - * @member {string} role - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.role = ""; - - /** - * BindingDelta member. - * @member {string} member - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.member = ""; - - /** - * BindingDelta condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.BindingDelta + * DeleteSnapshotRequest snapshot. + * @member {string} snapshot + * @memberof google.pubsub.v1.DeleteSnapshotRequest * @instance */ - BindingDelta.prototype.condition = null; + DeleteSnapshotRequest.prototype.snapshot = ""; /** - * Creates a new BindingDelta instance using the specified properties. + * Creates a new DeleteSnapshotRequest instance using the specified properties. * @function create - * @memberof google.iam.v1.BindingDelta + * @memberof google.pubsub.v1.DeleteSnapshotRequest * @static - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - * @returns {google.iam.v1.BindingDelta} BindingDelta instance + * @param {google.pubsub.v1.IDeleteSnapshotRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest instance */ - BindingDelta.create = function create(properties) { - return new BindingDelta(properties); + DeleteSnapshotRequest.create = function create(properties) { + return new DeleteSnapshotRequest(properties); }; /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. * @function encode - * @memberof google.iam.v1.BindingDelta + * @memberof google.pubsub.v1.DeleteSnapshotRequest * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {google.pubsub.v1.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BindingDelta.encode = function encode(message, writer) { + DeleteSnapshotRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.action != null && message.hasOwnProperty("action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.role != null && message.hasOwnProperty("role")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); - if (message.member != null && message.hasOwnProperty("member")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); - if (message.condition != null && message.hasOwnProperty("condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshot); return writer; }; /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.iam.v1.BindingDelta + * @memberof google.pubsub.v1.DeleteSnapshotRequest * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {google.pubsub.v1.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + DeleteSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BindingDelta message from the specified reader or buffer. + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. * @function decode - * @memberof google.iam.v1.BindingDelta + * @memberof google.pubsub.v1.DeleteSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.BindingDelta} BindingDelta + * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BindingDelta.decode = function decode(reader, length) { + DeleteSnapshotRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeleteSnapshotRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.action = reader.int32(); - break; - case 2: - message.role = reader.string(); - break; - case 3: - message.member = reader.string(); - break; - case 4: - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + message.snapshot = reader.string(); break; default: reader.skipType(tag & 7); @@ -23534,174 +23999,109 @@ }; /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.iam.v1.BindingDelta + * @memberof google.pubsub.v1.DeleteSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.BindingDelta} BindingDelta + * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BindingDelta.decodeDelimited = function decodeDelimited(reader) { + DeleteSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BindingDelta message. + * Verifies a DeleteSnapshotRequest message. * @function verify - * @memberof google.iam.v1.BindingDelta + * @memberof google.pubsub.v1.DeleteSnapshotRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BindingDelta.verify = function verify(message) { + DeleteSnapshotRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.member != null && message.hasOwnProperty("member")) - if (!$util.isString(message.member)) - return "member: string expected"; - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + if (!$util.isString(message.snapshot)) + return "snapshot: string expected"; return null; }; /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.iam.v1.BindingDelta + * @memberof google.pubsub.v1.DeleteSnapshotRequest * @static * @param {Object.} object Plain object - * @returns {google.iam.v1.BindingDelta} BindingDelta + * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest */ - BindingDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.BindingDelta) + DeleteSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.DeleteSnapshotRequest) return object; - var message = new $root.google.iam.v1.BindingDelta(); - switch (object.action) { - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.role != null) - message.role = String(object.role); - if (object.member != null) - message.member = String(object.member); - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } + var message = new $root.google.pubsub.v1.DeleteSnapshotRequest(); + if (object.snapshot != null) + message.snapshot = String(object.snapshot); return message; }; /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.iam.v1.BindingDelta + * @memberof google.pubsub.v1.DeleteSnapshotRequest * @static - * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {google.pubsub.v1.DeleteSnapshotRequest} message DeleteSnapshotRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BindingDelta.toObject = function toObject(message, options) { + DeleteSnapshotRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.role = ""; - object.member = ""; - object.condition = null; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.member != null && message.hasOwnProperty("member")) - object.member = message.member; - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); + if (options.defaults) + object.snapshot = ""; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = message.snapshot; return object; }; /** - * Converts this BindingDelta to JSON. + * Converts this DeleteSnapshotRequest to JSON. * @function toJSON - * @memberof google.iam.v1.BindingDelta + * @memberof google.pubsub.v1.DeleteSnapshotRequest * @instance * @returns {Object.} JSON object */ - BindingDelta.prototype.toJSON = function toJSON() { + DeleteSnapshotRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Action enum. - * @name google.iam.v1.BindingDelta.Action - * @enum {string} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - BindingDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); - - return BindingDelta; + return DeleteSnapshotRequest; })(); - v1.AuditConfigDelta = (function() { + v1.SeekRequest = (function() { /** - * Properties of an AuditConfigDelta. - * @memberof google.iam.v1 - * @interface IAuditConfigDelta - * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action - * @property {string|null} [service] AuditConfigDelta service - * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember - * @property {string|null} [logType] AuditConfigDelta logType + * Properties of a SeekRequest. + * @memberof google.pubsub.v1 + * @interface ISeekRequest + * @property {string|null} [subscription] SeekRequest subscription + * @property {google.protobuf.ITimestamp|null} [time] SeekRequest time + * @property {string|null} [snapshot] SeekRequest snapshot */ /** - * Constructs a new AuditConfigDelta. - * @memberof google.iam.v1 - * @classdesc Represents an AuditConfigDelta. - * @implements IAuditConfigDelta + * Constructs a new SeekRequest. + * @memberof google.pubsub.v1 + * @classdesc Represents a SeekRequest. + * @implements ISeekRequest * @constructor - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @param {google.pubsub.v1.ISeekRequest=} [properties] Properties to set */ - function AuditConfigDelta(properties) { + function SeekRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23709,114 +24109,115 @@ } /** - * AuditConfigDelta action. - * @member {google.iam.v1.AuditConfigDelta.Action} action - * @memberof google.iam.v1.AuditConfigDelta + * SeekRequest subscription. + * @member {string} subscription + * @memberof google.pubsub.v1.SeekRequest * @instance */ - AuditConfigDelta.prototype.action = 0; + SeekRequest.prototype.subscription = ""; /** - * AuditConfigDelta service. - * @member {string} service - * @memberof google.iam.v1.AuditConfigDelta + * SeekRequest time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof google.pubsub.v1.SeekRequest * @instance */ - AuditConfigDelta.prototype.service = ""; + SeekRequest.prototype.time = null; /** - * AuditConfigDelta exemptedMember. - * @member {string} exemptedMember - * @memberof google.iam.v1.AuditConfigDelta + * SeekRequest snapshot. + * @member {string} snapshot + * @memberof google.pubsub.v1.SeekRequest * @instance */ - AuditConfigDelta.prototype.exemptedMember = ""; + SeekRequest.prototype.snapshot = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * AuditConfigDelta logType. - * @member {string} logType - * @memberof google.iam.v1.AuditConfigDelta + * SeekRequest target. + * @member {"time"|"snapshot"|undefined} target + * @memberof google.pubsub.v1.SeekRequest * @instance */ - AuditConfigDelta.prototype.logType = ""; + Object.defineProperty(SeekRequest.prototype, "target", { + get: $util.oneOfGetter($oneOfFields = ["time", "snapshot"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new AuditConfigDelta instance using the specified properties. + * Creates a new SeekRequest instance using the specified properties. * @function create - * @memberof google.iam.v1.AuditConfigDelta + * @memberof google.pubsub.v1.SeekRequest * @static - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + * @param {google.pubsub.v1.ISeekRequest=} [properties] Properties to set + * @returns {google.pubsub.v1.SeekRequest} SeekRequest instance */ - AuditConfigDelta.create = function create(properties) { - return new AuditConfigDelta(properties); + SeekRequest.create = function create(properties) { + return new SeekRequest(properties); }; /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * Encodes the specified SeekRequest message. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. * @function encode - * @memberof google.iam.v1.AuditConfigDelta + * @memberof google.pubsub.v1.SeekRequest * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {google.pubsub.v1.ISeekRequest} message SeekRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AuditConfigDelta.encode = function encode(message, writer) { + SeekRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.action != null && message.hasOwnProperty("action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.service != null && message.hasOwnProperty("service")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); - if (message.logType != null && message.hasOwnProperty("logType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + if (message.subscription != null && message.hasOwnProperty("subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.time != null && message.hasOwnProperty("time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.snapshot); return writer; }; /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * Encodes the specified SeekRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.iam.v1.AuditConfigDelta + * @memberof google.pubsub.v1.SeekRequest * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {google.pubsub.v1.ISeekRequest} message SeekRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + SeekRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. + * Decodes a SeekRequest message from the specified reader or buffer. * @function decode - * @memberof google.iam.v1.AuditConfigDelta + * @memberof google.pubsub.v1.SeekRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @returns {google.pubsub.v1.SeekRequest} SeekRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AuditConfigDelta.decode = function decode(reader, length) { + SeekRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.SeekRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.action = reader.int32(); + message.subscription = reader.string(); break; case 2: - message.service = reader.string(); + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 3: - message.exemptedMember = reader.string(); - break; - case 4: - message.logType = reader.string(); + message.snapshot = reader.string(); break; default: reader.skipType(tag & 7); @@ -23827,418 +24228,286 @@ }; /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * Decodes a SeekRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.iam.v1.AuditConfigDelta + * @memberof google.pubsub.v1.SeekRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @returns {google.pubsub.v1.SeekRequest} SeekRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + SeekRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AuditConfigDelta message. + * Verifies a SeekRequest message. * @function verify - * @memberof google.iam.v1.AuditConfigDelta + * @memberof google.pubsub.v1.SeekRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AuditConfigDelta.verify = function verify(message) { + SeekRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - if (!$util.isString(message.exemptedMember)) - return "exemptedMember: string expected"; - if (message.logType != null && message.hasOwnProperty("logType")) - if (!$util.isString(message.logType)) - return "logType: string expected"; + var properties = {}; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.time != null && message.hasOwnProperty("time")) { + properties.target = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (!$util.isString(message.snapshot)) + return "snapshot: string expected"; + } return null; }; /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * Creates a SeekRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.iam.v1.AuditConfigDelta + * @memberof google.pubsub.v1.SeekRequest * @static * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @returns {google.pubsub.v1.SeekRequest} SeekRequest */ - AuditConfigDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditConfigDelta) + SeekRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.SeekRequest) return object; - var message = new $root.google.iam.v1.AuditConfigDelta(); - switch (object.action) { - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; + var message = new $root.google.pubsub.v1.SeekRequest(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".google.pubsub.v1.SeekRequest.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); } - if (object.service != null) - message.service = String(object.service); - if (object.exemptedMember != null) - message.exemptedMember = String(object.exemptedMember); - if (object.logType != null) - message.logType = String(object.logType); + if (object.snapshot != null) + message.snapshot = String(object.snapshot); return message; }; /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * Creates a plain object from a SeekRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.iam.v1.AuditConfigDelta + * @memberof google.pubsub.v1.SeekRequest * @static - * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {google.pubsub.v1.SeekRequest} message SeekRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AuditConfigDelta.toObject = function toObject(message, options) { + SeekRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.service = ""; - object.exemptedMember = ""; - object.logType = ""; + if (options.defaults) + object.subscription = ""; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.time != null && message.hasOwnProperty("time")) { + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (options.oneofs) + object.target = "time"; + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + object.snapshot = message.snapshot; + if (options.oneofs) + object.target = "snapshot"; } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - object.exemptedMember = message.exemptedMember; - if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = message.logType; return object; }; /** - * Converts this AuditConfigDelta to JSON. + * Converts this SeekRequest to JSON. * @function toJSON - * @memberof google.iam.v1.AuditConfigDelta + * @memberof google.pubsub.v1.SeekRequest * @instance * @returns {Object.} JSON object */ - AuditConfigDelta.prototype.toJSON = function toJSON() { + SeekRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Action enum. - * @name google.iam.v1.AuditConfigDelta.Action - * @enum {string} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - AuditConfigDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); - - return AuditConfigDelta; + return SeekRequest; })(); - return v1; - })(); - - return iam; - })(); - - 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 = ""; + v1.SeekResponse = (function() { - /** - * Expr description. - * @member {string} description - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.description = ""; + /** + * Properties of a SeekResponse. + * @memberof google.pubsub.v1 + * @interface ISeekResponse + */ - /** - * Expr location. - * @member {string} location - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.location = ""; + /** + * Constructs a new SeekResponse. + * @memberof google.pubsub.v1 + * @classdesc Represents a SeekResponse. + * @implements ISeekResponse + * @constructor + * @param {google.pubsub.v1.ISeekResponse=} [properties] Properties to set + */ + function SeekResponse(properties) { + if (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 Expr instance using the specified properties. - * @function create - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr=} [properties] Properties to set - * @returns {google.type.Expr} Expr instance - */ - Expr.create = function create(properties) { - return new Expr(properties); - }; + /** + * Creates a new SeekResponse instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {google.pubsub.v1.ISeekResponse=} [properties] Properties to set + * @returns {google.pubsub.v1.SeekResponse} SeekResponse instance + */ + SeekResponse.create = function create(properties) { + return new SeekResponse(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 && message.hasOwnProperty("expression")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - if (message.title != null && message.hasOwnProperty("title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && message.hasOwnProperty("description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.location != null && message.hasOwnProperty("location")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); - return writer; - }; + /** + * Encodes the specified SeekResponse message. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {google.pubsub.v1.ISeekResponse} message SeekResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeekResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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(); - }; + /** + * Encodes the specified SeekResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {google.pubsub.v1.ISeekResponse} message SeekResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeekResponse.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.expression = reader.string(); - break; - case 2: - message.title = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.location = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a SeekResponse message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.SeekResponse} SeekResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeekResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.SeekResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + 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()); - }; + /** + * Decodes a SeekResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.SeekResponse} SeekResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeekResponse.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; - }; + /** + * Verifies a SeekResponse message. + * @function verify + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SeekResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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 SeekResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.SeekResponse} SeekResponse + */ + SeekResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.SeekResponse) + return object; + return new $root.google.pubsub.v1.SeekResponse(); + }; - /** - * 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; - }; + /** + * Creates a plain object from a SeekResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.SeekResponse + * @static + * @param {google.pubsub.v1.SeekResponse} message SeekResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SeekResponse.toObject = function toObject() { + return {}; + }; - /** - * 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); - }; + /** + * Converts this SeekResponse to JSON. + * @function toJSON + * @memberof google.pubsub.v1.SeekResponse + * @instance + * @returns {Object.} JSON object + */ + SeekResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Expr; + return SeekResponse; + })(); + + return v1; })(); - return type; + return pubsub; })(); return google; diff --git a/protos/protos.json b/protos/protos.json index a42e19cd0..1edead9dd 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -2,199 +2,176 @@ "nested": { "google": { "nested": { - "pubsub": { + "iam": { "nested": { "v1": { "options": { "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.PubSub.V1", - "go_package": "google.golang.org/genproto/googleapis/pubsub/v1;pubsub", + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "google.golang.org/genproto/googleapis/iam/v1;iam", "java_multiple_files": true, - "java_outer_classname": "PubsubProto", - "java_package": "com.google.pubsub.v1", - "php_namespace": "Google\\Cloud\\PubSub\\V1", - "ruby_package": "Google::Cloud::PubSub::V1" + "java_outer_classname": "IamPolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" }, "nested": { - "Publisher": { - "options": { - "(google.api.default_host)": "pubsub.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub" - }, - "methods": { - "CreateTopic": { - "requestType": "Topic", - "responseType": "Topic", - "options": { - "(google.api.http).put": "/v1/{name=projects/*/topics/*}", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - } - }, - "UpdateTopic": { - "requestType": "UpdateTopicRequest", - "responseType": "Topic", - "options": { - "(google.api.http).patch": "/v1/{topic.name=projects/*/topics/*}", - "(google.api.http).body": "*" - } - }, - "Publish": { - "requestType": "PublishRequest", - "responseType": "PublishResponse", - "options": { - "(google.api.http).post": "/v1/{topic=projects/*/topics/*}:publish", - "(google.api.http).body": "*", - "(google.api.method_signature)": "topic,messages" - } - }, - "GetTopic": { - "requestType": "GetTopicRequest", - "responseType": "Topic", - "options": { - "(google.api.http).get": "/v1/{topic=projects/*/topics/*}", - "(google.api.method_signature)": "topic" - } + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 }, - "ListTopics": { - "requestType": "ListTopicsRequest", - "responseType": "ListTopicsResponse", - "options": { - "(google.api.http).get": "/v1/{project=projects/*}/topics", - "(google.api.method_signature)": "project" - } + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 }, - "ListTopicSubscriptions": { - "requestType": "ListTopicSubscriptionsRequest", - "responseType": "ListTopicSubscriptionsResponse", - "options": { - "(google.api.http).get": "/v1/{topic=projects/*/topics/*}/subscriptions", - "(google.api.method_signature)": "topic" - } + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 }, - "ListTopicSnapshots": { - "requestType": "ListTopicSnapshotsRequest", - "responseType": "ListTopicSnapshotsResponse", - "options": { - "(google.api.http).get": "/v1/{topic=projects/*/topics/*}/snapshots", - "(google.api.method_signature)": "topic" - } + "members": { + "rule": "repeated", + "type": "string", + "id": 2 }, - "DeleteTopic": { - "requestType": "DeleteTopicRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{topic=projects/*/topics/*}", - "(google.api.method_signature)": "topic" - } + "condition": { + "type": "google.type.Expr", + "id": 3 } } }, - "MessageStoragePolicy": { + "PolicyDelta": { "fields": { - "allowedPersistenceRegions": { + "bindingDeltas": { "rule": "repeated", - "type": "string", + "type": "BindingDelta", "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 } } }, - "Topic": { - "options": { - "(google.api.resource).type": "pubsub.googleapis.com/Topic", - "(google.api.resource).pattern": "_deleted-topic_" - }, + "BindingDelta": { "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "action": { + "type": "Action", + "id": 1 }, - "labels": { - "keyType": "string", + "role": { "type": "string", "id": 2 }, - "messageStoragePolicy": { - "type": "MessageStoragePolicy", + "member": { + "type": "string", "id": 3 }, - "kmsKeyName": { - "type": "string", - "id": 5 + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } } } }, - "PubsubMessage": { + "AuditConfigDelta": { "fields": { - "data": { - "type": "bytes", + "action": { + "type": "Action", "id": 1 }, - "attributes": { - "keyType": "string", + "service": { "type": "string", "id": 2 }, - "messageId": { + "exemptedMember": { "type": "string", "id": 3 }, - "publishTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "orderingKey": { + "logType": { "type": "string", - "id": 5 + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } } } }, - "GetTopicRequest": { + "GetPolicyOptions": { "fields": { - "topic": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" - } + "requestedPolicyVersion": { + "type": "int32", + "id": 1 } } }, - "UpdateTopicRequest": { - "fields": { - "topic": { - "type": "Topic", - "id": 1, + "IAMPolicy": { + "options": { + "(google.api.default_host)": "iam-meta-api.googleapis.com" + }, + "methods": { + "SetIamPolicy": { + "requestType": "SetIamPolicyRequest", + "responseType": "Policy", "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", + "(google.api.http).body": "*" } }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, + "GetIamPolicy": { + "requestType": "GetIamPolicyRequest", + "responseType": "Policy", "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", + "(google.api.http).body": "*" + } + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsRequest", + "responseType": "TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", + "(google.api.http).body": "*" } } } }, - "PublishRequest": { + "SetIamPolicyRequest": { "fields": { - "topic": { + "resource": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + "(google.api.resource_reference).type": "*" } }, - "messages": { - "rule": "repeated", - "type": "PubsubMessage", + "policy": { + "type": "Policy", "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" @@ -202,1404 +179,701 @@ } } }, - "PublishResponse": { + "GetIamPolicyRequest": { "fields": { - "messageIds": { - "rule": "repeated", + "resource": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "options": { + "type": "GetPolicyOptions", + "id": 2 } } }, - "ListTopicsRequest": { + "TestIamPermissionsRequest": { "fields": { - "project": { + "resource": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + "(google.api.resource_reference).type": "*" } }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListTopicsResponse": { - "fields": { - "topics": { + "permissions": { "rule": "repeated", - "type": "Topic", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListTopicSubscriptionsRequest": { - "fields": { - "topic": { "type": "string", - "id": 1, + "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + "(google.api.field_behavior)": "REQUIRED" } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 } } }, - "ListTopicSubscriptionsResponse": { + "TestIamPermissionsResponse": { "fields": { - "subscriptions": { + "permissions": { "rule": "repeated", "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - }, - "nextPageToken": { - "type": "string", - "id": 2 + "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 }, - "ListTopicSnapshotsRequest": { - "fields": { - "topic": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } + "title": { + "type": "string", + "id": 2 }, - "ListTopicSnapshotsResponse": { - "fields": { - "snapshots": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } + "description": { + "type": "string", + "id": 3 }, - "DeleteTopicRequest": { - "fields": { - "topic": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" - } - } - } + "location": { + "type": "string", + "id": 4 + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 }, - "Subscriber": { - "options": { - "(google.api.default_host)": "pubsub.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub" - }, - "methods": { - "CreateSubscription": { - "requestType": "Subscription", - "responseType": "Subscription", - "options": { - "(google.api.http).put": "/v1/{name=projects/*/subscriptions/*}", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,topic,push_config,ack_deadline_seconds" - } - }, - "GetSubscription": { - "requestType": "GetSubscriptionRequest", - "responseType": "Subscription", - "options": { - "(google.api.http).get": "/v1/{subscription=projects/*/subscriptions/*}", - "(google.api.method_signature)": "subscription" - } - }, - "UpdateSubscription": { - "requestType": "UpdateSubscriptionRequest", - "responseType": "Subscription", - "options": { - "(google.api.http).patch": "/v1/{subscription.name=projects/*/subscriptions/*}", - "(google.api.http).body": "*" - } - }, - "ListSubscriptions": { - "requestType": "ListSubscriptionsRequest", - "responseType": "ListSubscriptionsResponse", - "options": { - "(google.api.http).get": "/v1/{project=projects/*}/subscriptions", - "(google.api.method_signature)": "project" - } - }, - "DeleteSubscription": { - "requestType": "DeleteSubscriptionRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{subscription=projects/*/subscriptions/*}", - "(google.api.method_signature)": "subscription" - } - }, - "ModifyAckDeadline": { - "requestType": "ModifyAckDeadlineRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline", - "(google.api.http).body": "*", - "(google.api.method_signature)": "subscription,ack_ids,ack_deadline_seconds" - } - }, - "Acknowledge": { - "requestType": "AcknowledgeRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:acknowledge", - "(google.api.http).body": "*", - "(google.api.method_signature)": "subscription,ack_ids" - } - }, - "Pull": { - "requestType": "PullRequest", - "responseType": "PullResponse", - "options": { - "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:pull", - "(google.api.http).body": "*", - "(google.api.method_signature)": "subscription,return_immediately,max_messages" - } - }, - "StreamingPull": { - "requestType": "StreamingPullRequest", - "requestStream": true, - "responseType": "StreamingPullResponse", - "responseStream": true - }, - "ModifyPushConfig": { - "requestType": "ModifyPushConfigRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig", - "(google.api.http).body": "*", - "(google.api.method_signature)": "subscription,push_config" - } - }, - "GetSnapshot": { - "requestType": "GetSnapshotRequest", - "responseType": "Snapshot", - "options": { - "(google.api.http).get": "/v1/{snapshot=projects/*/snapshots/*}", - "(google.api.method_signature)": "snapshot" - } - }, - "ListSnapshots": { - "requestType": "ListSnapshotsRequest", - "responseType": "ListSnapshotsResponse", - "options": { - "(google.api.http).get": "/v1/{project=projects/*}/snapshots", - "(google.api.method_signature)": "project" - } - }, - "CreateSnapshot": { - "requestType": "CreateSnapshotRequest", - "responseType": "Snapshot", - "options": { - "(google.api.http).put": "/v1/{name=projects/*/snapshots/*}", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,subscription" - } - }, - "UpdateSnapshot": { - "requestType": "UpdateSnapshotRequest", - "responseType": "Snapshot", - "options": { - "(google.api.http).patch": "/v1/{snapshot.name=projects/*/snapshots/*}", - "(google.api.http).body": "*" - } - }, - "DeleteSnapshot": { - "requestType": "DeleteSnapshotRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{snapshot=projects/*/snapshots/*}", - "(google.api.method_signature)": "snapshot" - } - }, - "Seek": { - "requestType": "SeekRequest", - "responseType": "SeekResponse", - "options": { - "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:seek", - "(google.api.http).body": "*" - } - } - } + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 }, - "Subscription": { - "options": { - "(google.api.resource).type": "pubsub.googleapis.com/Subscription", - "(google.api.resource).pattern": "projects/{project}/subscriptions/{subscription}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "topic": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" - } - }, - "pushConfig": { - "type": "PushConfig", - "id": 4 - }, - "ackDeadlineSeconds": { - "type": "int32", - "id": 5 - }, - "retainAckedMessages": { - "type": "bool", - "id": 7 - }, - "messageRetentionDuration": { - "type": "google.protobuf.Duration", - "id": 8 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 9 - }, - "enableMessageOrdering": { - "type": "bool", - "id": 10 - }, - "expirationPolicy": { - "type": "ExpirationPolicy", - "id": 11 - }, - "deadLetterPolicy": { - "type": "DeadLetterPolicy", - "id": 13 - } - } + "get": { + "type": "string", + "id": 2 }, - "DeadLetterPolicy": { - "fields": { - "deadLetterTopic": { - "type": "string", - "id": 1 - }, - "maxDeliveryAttempts": { - "type": "int32", - "id": 2 - } - } + "put": { + "type": "string", + "id": 3 }, - "ExpirationPolicy": { - "fields": { - "ttl": { - "type": "google.protobuf.Duration", - "id": 1 - } - } + "post": { + "type": "string", + "id": 4 }, - "PushConfig": { - "oneofs": { - "authenticationMethod": { - "oneof": [ - "oidcToken" - ] - } - }, - "fields": { - "pushEndpoint": { - "type": "string", - "id": 1 - }, - "attributes": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "oidcToken": { - "type": "OidcToken", - "id": 3 - } - }, - "nested": { - "OidcToken": { - "fields": { - "serviceAccountEmail": { - "type": "string", - "id": 1 - }, - "audience": { - "type": "string", - "id": 2 - } - } - } - } + "delete": { + "type": "string", + "id": 5 }, - "ReceivedMessage": { - "fields": { - "ackId": { - "type": "string", - "id": 1 - }, - "message": { - "type": "PubsubMessage", - "id": 2 - }, - "deliveryAttempt": { - "type": "int32", - "id": 3 - } - } + "patch": { + "type": "string", + "id": 6 }, - "GetSubscriptionRequest": { - "fields": { - "subscription": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - } - } + "custom": { + "type": "CustomHttpPattern", + "id": 8 }, - "UpdateSubscriptionRequest": { - "fields": { - "subscription": { - "type": "Subscription", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } + "body": { + "type": "string", + "id": 7 }, - "ListSubscriptionsRequest": { - "fields": { - "project": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } + "responseBody": { + "type": "string", + "id": 12 }, - "ListSubscriptionsResponse": { - "fields": { - "subscriptions": { - "rule": "repeated", - "type": "Subscription", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 }, - "DeleteSubscriptionRequest": { - "fields": { - "subscription": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - } - } + "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" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5 + } + }, + "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 }, - "ModifyPushConfigRequest": { - "fields": { - "subscription": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - }, - "pushConfig": { - "type": "PushConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 }, - "PullRequest": { - "fields": { - "subscription": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - }, - "returnImmediately": { - "type": "bool", - "id": 2, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxMessages": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 }, - "PullResponse": { - "fields": { - "receivedMessages": { - "rule": "repeated", - "type": "ReceivedMessage", - "id": 1 - } + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", + "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": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "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, + "options": { + "packed": false } }, - "ModifyAckDeadlineRequest": { - "fields": { - "subscription": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - }, - "ackIds": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "ackDeadlineSeconds": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false } }, - "AcknowledgeRequest": { - "fields": { - "subscription": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - }, - "ackIds": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 }, - "StreamingPullRequest": { - "fields": { - "subscription": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - }, - "ackIds": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "modifyDeadlineSeconds": { - "rule": "repeated", - "type": "int32", - "id": 3 - }, - "modifyDeadlineAckIds": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "streamAckDeadlineSeconds": { - "type": "int32", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clientId": { - "type": "string", - "id": 6 - } - } + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 }, - "StreamingPullResponse": { - "fields": { - "receivedMessages": { - "rule": "repeated", - "type": "ReceivedMessage", - "id": 1 - } - } + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 }, - "CreateSnapshotRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" - } - }, - "subscription": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 3 - } - } + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 }, - "UpdateSnapshotRequest": { - "fields": { - "snapshot": { - "type": "Snapshot", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } + "options": { + "type": "FileOptions", + "id": 8 }, - "Snapshot": { - "options": { - "(google.api.resource).type": "pubsub.googleapis.com/Snapshot", - "(google.api.resource).pattern": "projects/{project}/snapshots/{snapshot}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "topic": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4 - } - } + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 }, - "GetSnapshotRequest": { - "fields": { - "snapshot": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" - } - } - } + "syntax": { + "type": "string", + "id": 12 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 }, - "ListSnapshotsRequest": { + "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 + } + }, + "nested": { + "ExtensionRange": { "fields": { - "project": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } + "start": { + "type": "int32", + "id": 1 }, - "pageSize": { + "end": { "type": "int32", "id": 2 }, - "pageToken": { - "type": "string", + "options": { + "type": "ExtensionRangeOptions", "id": 3 } } }, - "ListSnapshotsResponse": { + "ReservedRange": { "fields": { - "snapshots": { - "rule": "repeated", - "type": "Snapshot", + "start": { + "type": "int32", "id": 1 }, - "nextPageToken": { - "type": "string", + "end": { + "type": "int32", "id": 2 } } - }, - "DeleteSnapshotRequest": { - "fields": { - "snapshot": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" - } - } - } - }, - "SeekRequest": { - "oneofs": { - "target": { - "oneof": [ - "time", - "snapshot" - ] - } - }, - "fields": { - "subscription": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" - } - }, - "time": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "snapshot": { - "type": "string", - "id": 3, - "options": { - "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" - } - } - } - }, - "SeekResponse": { - "fields": {} } } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "ResourceProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" }, - "Http": { + "ExtensionRangeOptions": { "fields": { - "rules": { + "uninterpretedOption": { "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] + "type": "UninterpretedOption", + "id": 999 } }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { "fields": { - "selector": { + "name": { "type": "string", "id": 1 }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", + "number": { + "type": "int32", "id": 3 }, - "post": { - "type": "string", + "label": { + "type": "Label", "id": 4 }, - "delete": { - "type": "string", + "type": { + "type": "Type", "id": 5 }, - "patch": { + "typeName": { "type": "string", "id": 6 }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 + "extendee": { + "type": "string", + "id": 2 }, - "body": { + "defaultValue": { "type": "string", "id": 7 }, - "responseBody": { + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { "type": "string", - "id": 12 + "id": 10 }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 + "options": { + "type": "FieldOptions", + "id": 8 + } + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } } } }, - "CustomHttpPattern": { + "OneofDescriptorProto": { "fields": { - "kind": { + "name": { "type": "string", "id": 1 }, - "path": { - "type": "string", + "options": { + "type": "OneofOptions", "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" - }, - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions" - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5 - } - }, - "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": { + "EnumDescriptorProto": { "fields": { - "type": { + "name": { "type": "string", "id": 1 }, - "pattern": { + "value": { "rule": "repeated", - "type": "string", + "type": "EnumValueDescriptorProto", "id": 2 }, - "nameField": { - "type": "string", + "options": { + "type": "EnumOptions", "id": 3 }, - "history": { - "type": "History", + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", "id": 4 }, - "plural": { + "reservedName": { + "rule": "repeated", "type": "string", "id": 5 - }, - "singular": { - "type": "string", - "id": 6 } }, "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "protobuf": { - "options": { - "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", - "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": { - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } } } }, - "FileDescriptorProto": { + "EnumValueDescriptorProto": { "fields": { "name": { "type": "string", "id": 1 }, - "package": { - "type": "string", + "number": { + "type": "int32", "id": 2 }, - "dependency": { - "rule": "repeated", - "type": "string", + "options": { + "type": "EnumValueOptions", "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10, - "options": { - "packed": false - } - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11, - "options": { - "packed": false - } - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { + "method": { "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 + "type": "MethodDescriptorProto", + "id": 2 }, "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 + "type": "ServiceOptions", + "id": 3 } } }, - "DescriptorProto": { + "MethodDescriptorProto": { "fields": { "name": { "type": "string", "id": 1 }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", + "inputType": { + "type": "string", "id": 2 }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", + "outputType": { + "type": "string", "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 + "type": "MethodOptions", + "id": 4 }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false } }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false } } } }, - "ExtensionRangeOptions": { - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "FieldDescriptorProto": { + "FileOptions": { "fields": { - "name": { + "javaPackage": { "type": "string", "id": 1 }, - "number": { - "type": "int32", - "id": 3 + "javaOuterClassname": { + "type": "string", + "id": 8 }, - "label": { - "type": "Label", - "id": 4 + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } }, - "type": { - "type": "Type", - "id": 5 + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } }, - "typeName": { - "type": "string", - "id": 6 + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } }, - "extendee": { - "type": "string", - "id": 2 + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } }, - "defaultValue": { + "goPackage": { "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - } - }, - "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_REQUIRED": 2, - "LABEL_REPEATED": 3 - } - } - } - }, - "OneofDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "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 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "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": { - "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 + "id": 11 }, "ccGenericServices": { "type": "bool", @@ -1822,529 +1096,1293 @@ "JS_STRING": 1, "JS_NUMBER": 2 } - } - } - }, - "OneofOptions": { - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "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 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "pubsub": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.PubSub.V1", + "go_package": "google.golang.org/genproto/googleapis/pubsub/v1;pubsub", + "java_multiple_files": true, + "java_outer_classname": "PubsubProto", + "java_package": "com.google.pubsub.v1", + "php_namespace": "Google\\Cloud\\PubSub\\V1", + "ruby_package": "Google::Cloud::PubSub::V1" + }, + "nested": { + "Publisher": { + "options": { + "(google.api.default_host)": "pubsub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub" + }, + "methods": { + "CreateTopic": { + "requestType": "Topic", + "responseType": "Topic", + "options": { + "(google.api.http).put": "/v1/{name=projects/*/topics/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + } + }, + "UpdateTopic": { + "requestType": "UpdateTopicRequest", + "responseType": "Topic", + "options": { + "(google.api.http).patch": "/v1/{topic.name=projects/*/topics/*}", + "(google.api.http).body": "*" + } + }, + "Publish": { + "requestType": "PublishRequest", + "responseType": "PublishResponse", + "options": { + "(google.api.http).post": "/v1/{topic=projects/*/topics/*}:publish", + "(google.api.http).body": "*", + "(google.api.method_signature)": "topic,messages" + } + }, + "GetTopic": { + "requestType": "GetTopicRequest", + "responseType": "Topic", + "options": { + "(google.api.http).get": "/v1/{topic=projects/*/topics/*}", + "(google.api.method_signature)": "topic" + } + }, + "ListTopics": { + "requestType": "ListTopicsRequest", + "responseType": "ListTopicsResponse", + "options": { + "(google.api.http).get": "/v1/{project=projects/*}/topics", + "(google.api.method_signature)": "project" + } + }, + "ListTopicSubscriptions": { + "requestType": "ListTopicSubscriptionsRequest", + "responseType": "ListTopicSubscriptionsResponse", + "options": { + "(google.api.http).get": "/v1/{topic=projects/*/topics/*}/subscriptions", + "(google.api.method_signature)": "topic" + } + }, + "ListTopicSnapshots": { + "requestType": "ListTopicSnapshotsRequest", + "responseType": "ListTopicSnapshotsResponse", + "options": { + "(google.api.http).get": "/v1/{topic=projects/*/topics/*}/snapshots", + "(google.api.method_signature)": "topic" + } + }, + "DeleteTopic": { + "requestType": "DeleteTopicRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{topic=projects/*/topics/*}", + "(google.api.method_signature)": "topic" + } + } + } + }, + "MessageStoragePolicy": { + "fields": { + "allowedPersistenceRegions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Topic": { + "options": { + "(google.api.resource).type": "pubsub.googleapis.com/Topic", + "(google.api.resource).pattern": "_deleted-topic_" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "messageStoragePolicy": { + "type": "MessageStoragePolicy", + "id": 3 + }, + "kmsKeyName": { + "type": "string", + "id": 5 + } + } + }, + "PubsubMessage": { + "fields": { + "data": { + "type": "bytes", + "id": 1 + }, + "attributes": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "messageId": { + "type": "string", + "id": 3 + }, + "publishTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "orderingKey": { + "type": "string", + "id": 5 + } + } + }, + "GetTopicRequest": { + "fields": { + "topic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + } + } + }, + "UpdateTopicRequest": { + "fields": { + "topic": { + "type": "Topic", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PublishRequest": { + "fields": { + "topic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "messages": { + "rule": "repeated", + "type": "PubsubMessage", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PublishResponse": { + "fields": { + "messageIds": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "ListTopicsRequest": { + "fields": { + "project": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListTopicsResponse": { + "fields": { + "topics": { + "rule": "repeated", + "type": "Topic", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListTopicSubscriptionsRequest": { + "fields": { + "topic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListTopicSubscriptionsResponse": { + "fields": { + "subscriptions": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListTopicSnapshotsRequest": { + "fields": { + "topic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListTopicSnapshotsResponse": { + "fields": { + "snapshots": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteTopicRequest": { + "fields": { + "topic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + } + } + }, + "Subscriber": { + "options": { + "(google.api.default_host)": "pubsub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub" + }, + "methods": { + "CreateSubscription": { + "requestType": "Subscription", + "responseType": "Subscription", + "options": { + "(google.api.http).put": "/v1/{name=projects/*/subscriptions/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,topic,push_config,ack_deadline_seconds" + } + }, + "GetSubscription": { + "requestType": "GetSubscriptionRequest", + "responseType": "Subscription", + "options": { + "(google.api.http).get": "/v1/{subscription=projects/*/subscriptions/*}", + "(google.api.method_signature)": "subscription" + } + }, + "UpdateSubscription": { + "requestType": "UpdateSubscriptionRequest", + "responseType": "Subscription", + "options": { + "(google.api.http).patch": "/v1/{subscription.name=projects/*/subscriptions/*}", + "(google.api.http).body": "*" + } + }, + "ListSubscriptions": { + "requestType": "ListSubscriptionsRequest", + "responseType": "ListSubscriptionsResponse", + "options": { + "(google.api.http).get": "/v1/{project=projects/*}/subscriptions", + "(google.api.method_signature)": "project" + } + }, + "DeleteSubscription": { + "requestType": "DeleteSubscriptionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{subscription=projects/*/subscriptions/*}", + "(google.api.method_signature)": "subscription" + } + }, + "ModifyAckDeadline": { + "requestType": "ModifyAckDeadlineRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline", + "(google.api.http).body": "*", + "(google.api.method_signature)": "subscription,ack_ids,ack_deadline_seconds" + } + }, + "Acknowledge": { + "requestType": "AcknowledgeRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:acknowledge", + "(google.api.http).body": "*", + "(google.api.method_signature)": "subscription,ack_ids" + } + }, + "Pull": { + "requestType": "PullRequest", + "responseType": "PullResponse", + "options": { + "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:pull", + "(google.api.http).body": "*", + "(google.api.method_signature)": "subscription,return_immediately,max_messages" + } + }, + "StreamingPull": { + "requestType": "StreamingPullRequest", + "requestStream": true, + "responseType": "StreamingPullResponse", + "responseStream": true + }, + "ModifyPushConfig": { + "requestType": "ModifyPushConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig", + "(google.api.http).body": "*", + "(google.api.method_signature)": "subscription,push_config" + } + }, + "GetSnapshot": { + "requestType": "GetSnapshotRequest", + "responseType": "Snapshot", + "options": { + "(google.api.http).get": "/v1/{snapshot=projects/*/snapshots/*}", + "(google.api.method_signature)": "snapshot" + } + }, + "ListSnapshots": { + "requestType": "ListSnapshotsRequest", + "responseType": "ListSnapshotsResponse", + "options": { + "(google.api.http).get": "/v1/{project=projects/*}/snapshots", + "(google.api.method_signature)": "project" + } + }, + "CreateSnapshot": { + "requestType": "CreateSnapshotRequest", + "responseType": "Snapshot", + "options": { + "(google.api.http).put": "/v1/{name=projects/*/snapshots/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,subscription" + } + }, + "UpdateSnapshot": { + "requestType": "UpdateSnapshotRequest", + "responseType": "Snapshot", + "options": { + "(google.api.http).patch": "/v1/{snapshot.name=projects/*/snapshots/*}", + "(google.api.http).body": "*" + } + }, + "DeleteSnapshot": { + "requestType": "DeleteSnapshotRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{snapshot=projects/*/snapshots/*}", + "(google.api.method_signature)": "snapshot" + } + }, + "Seek": { + "requestType": "SeekRequest", + "responseType": "SeekResponse", + "options": { + "(google.api.http).post": "/v1/{subscription=projects/*/subscriptions/*}:seek", + "(google.api.http).body": "*" + } + } + } + }, + "Subscription": { + "options": { + "(google.api.resource).type": "pubsub.googleapis.com/Subscription", + "(google.api.resource).pattern": "projects/{project}/subscriptions/{subscription}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "topic": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "pushConfig": { + "type": "PushConfig", + "id": 4 + }, + "ackDeadlineSeconds": { + "type": "int32", + "id": 5 + }, + "retainAckedMessages": { + "type": "bool", + "id": 7 + }, + "messageRetentionDuration": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9 + }, + "enableMessageOrdering": { + "type": "bool", + "id": 10 + }, + "expirationPolicy": { + "type": "ExpirationPolicy", + "id": 11 + }, + "filter": { + "type": "string", + "id": 12 + }, + "deadLetterPolicy": { + "type": "DeadLetterPolicy", + "id": 13 + }, + "retryPolicy": { + "type": "RetryPolicy", + "id": 14 + } + } }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false + "RetryPolicy": { + "fields": { + "minimumBackoff": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "maximumBackoff": { + "type": "google.protobuf.Duration", + "id": 2 + } } }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false + "DeadLetterPolicy": { + "fields": { + "deadLetterTopic": { + "type": "string", + "id": 1 + }, + "maxDeliveryAttempts": { + "type": "int32", + "id": 2 + } } }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false + "ExpirationPolicy": { + "fields": { + "ttl": { + "type": "google.protobuf.Duration", + "id": 1 + } } }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false + "PushConfig": { + "oneofs": { + "authenticationMethod": { + "oneof": [ + "oidcToken" + ] + } + }, + "fields": { + "pushEndpoint": { + "type": "string", + "id": 1 + }, + "attributes": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "oidcToken": { + "type": "OidcToken", + "id": 3 + } + }, + "nested": { + "OidcToken": { + "fields": { + "serviceAccountEmail": { + "type": "string", + "id": 1 + }, + "audience": { + "type": "string", + "id": 2 + } + } + } } }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" + "ReceivedMessage": { + "fields": { + "ackId": { + "type": "string", + "id": 1 + }, + "message": { + "type": "PubsubMessage", + "id": 2 + }, + "deliveryAttempt": { + "type": "int32", + "id": 3 + } } }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 + "GetSubscriptionRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + } } - } - } - }, - "UninterpretedOption": { - "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 + "UpdateSubscriptionRequest": { + "fields": { + "subscription": { + "type": "Subscription", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { + "ListSubscriptionsRequest": { "fields": { - "namePart": { - "rule": "required", + "project": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } }, - "isExtension": { - "rule": "required", - "type": "bool", + "pageSize": { + "type": "int32", "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 } } - } - } - }, - "SourceCodeInfo": { - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { + }, + "ListSubscriptionsResponse": { "fields": { - "path": { + "subscriptions": { "rule": "repeated", - "type": "int32", + "type": "Subscription", "id": 1 }, - "span": { - "rule": "repeated", - "type": "int32", + "nextPageToken": { + "type": "string", "id": 2 - }, - "leadingComments": { + } + } + }, + "DeleteSubscriptionRequest": { + "fields": { + "subscription": { "type": "string", - "id": 3 - }, - "trailingComments": { + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + } + } + }, + "ModifyPushConfigRequest": { + "fields": { + "subscription": { "type": "string", - "id": 4 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } }, - "leadingDetachedComments": { - "rule": "repeated", + "pushConfig": { + "type": "PushConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PullRequest": { + "fields": { + "subscription": { "type": "string", - "id": 6 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "returnImmediately": { + "type": "bool", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxMessages": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } - } - } - }, - "GeneratedCodeInfo": { - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { + }, + "PullResponse": { "fields": { - "path": { + "receivedMessages": { "rule": "repeated", - "type": "int32", + "type": "ReceivedMessage", "id": 1 - }, - "sourceFile": { + } + } + }, + "ModifyAckDeadlineRequest": { + "fields": { + "subscription": { "type": "string", - "id": 2 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } }, - "begin": { - "type": "int32", - "id": 3 + "ackIds": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "end": { + "ackDeadlineSeconds": { "type": "int32", - "id": 4 + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "iam": { - "nested": { - "v1": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.Iam.V1", - "go_package": "google.golang.org/genproto/googleapis/iam/v1;iam", - "java_multiple_files": true, - "java_outer_classname": "PolicyProto", - "java_package": "com.google.iam.v1", - "php_namespace": "Google\\Cloud\\Iam\\V1" - }, - "nested": { - "IAMPolicy": { - "options": { - "(google.api.default_host)": "iam-meta-api.googleapis.com" - }, - "methods": { - "SetIamPolicy": { - "requestType": "SetIamPolicyRequest", - "responseType": "Policy", + "AcknowledgeRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, "options": { - "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", - "(google.api.http).body": "*" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" } }, - "GetIamPolicy": { - "requestType": "GetIamPolicyRequest", - "responseType": "Policy", + "ackIds": { + "rule": "repeated", + "type": "string", + "id": 2, "options": { - "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", - "(google.api.http).body": "*" + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "StreamingPullRequest": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" } }, - "TestIamPermissions": { - "requestType": "TestIamPermissionsRequest", - "responseType": "TestIamPermissionsResponse", + "ackIds": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "modifyDeadlineSeconds": { + "rule": "repeated", + "type": "int32", + "id": 3 + }, + "modifyDeadlineAckIds": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "streamAckDeadlineSeconds": { + "type": "int32", + "id": 5, "options": { - "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", - "(google.api.http).body": "*" + "(google.api.field_behavior)": "REQUIRED" } + }, + "clientId": { + "type": "string", + "id": 6 } } }, - "SetIamPolicyRequest": { + "StreamingPullResponse": { "fields": { - "resource": { - "type": "string", + "receivedMessages": { + "rule": "repeated", + "type": "ReceivedMessage", "id": 1 - }, - "policy": { - "type": "Policy", - "id": 2 } } }, - "GetIamPolicyRequest": { + "CreateSnapshotRequest": { "fields": { - "resource": { + "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" + } }, - "options": { - "type": "google.iam.v1.GetPolicyOptions", - "id": 2 - } - } - }, - "TestIamPermissionsRequest": { - "fields": { - "resource": { + "subscription": { "type": "string", - "id": 1 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } }, - "permissions": { - "rule": "repeated", + "labels": { + "keyType": "string", "type": "string", - "id": 2 + "id": 3 } } }, - "TestIamPermissionsResponse": { + "UpdateSnapshotRequest": { "fields": { - "permissions": { - "rule": "repeated", - "type": "string", - "id": 1 + "snapshot": { + "type": "Snapshot", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, - "GetPolicyOptions": { + "Snapshot": { + "options": { + "(google.api.resource).type": "pubsub.googleapis.com/Snapshot", + "(google.api.resource).pattern": "projects/{project}/snapshots/{snapshot}" + }, "fields": { - "requestedPolicyVersion": { - "type": "int32", + "name": { + "type": "string", "id": 1 + }, + "topic": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 } } }, - "Policy": { + "GetSnapshotRequest": { "fields": { - "version": { - "type": "int32", - "id": 1 - }, - "bindings": { - "rule": "repeated", - "type": "Binding", - "id": 4 - }, - "etag": { - "type": "bytes", - "id": 3 + "snapshot": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" + } } } }, - "Binding": { + "ListSnapshotsRequest": { "fields": { - "role": { + "project": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } }, - "members": { - "rule": "repeated", - "type": "string", + "pageSize": { + "type": "int32", "id": 2 }, - "condition": { - "type": "google.type.Expr", + "pageToken": { + "type": "string", "id": 3 } } }, - "PolicyDelta": { + "ListSnapshotsResponse": { "fields": { - "bindingDeltas": { + "snapshots": { "rule": "repeated", - "type": "BindingDelta", + "type": "Snapshot", "id": 1 }, - "auditConfigDeltas": { - "rule": "repeated", - "type": "AuditConfigDelta", + "nextPageToken": { + "type": "string", "id": 2 } } }, - "BindingDelta": { + "DeleteSnapshotRequest": { "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "role": { - "type": "string", - "id": 2 - }, - "member": { + "snapshot": { "type": "string", - "id": 3 - }, - "condition": { - "type": "google.type.Expr", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" } } } }, - "AuditConfigDelta": { + "SeekRequest": { + "oneofs": { + "target": { + "oneof": [ + "time", + "snapshot" + ] + } + }, "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "service": { + "subscription": { "type": "string", - "id": 2 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } }, - "exemptedMember": { - "type": "string", - "id": 3 + "time": { + "type": "google.protobuf.Timestamp", + "id": 2 }, - "logType": { + "snapshot": { "type": "string", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 + "id": 3, + "options": { + "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" } } } - } - } - } - } - }, - "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 + "SeekResponse": { + "fields": {} } } } diff --git a/samples/publishWithRetrySettings.js b/samples/publishWithRetrySettings.js index 9a22750c0..6be0d0067 100644 --- a/samples/publishWithRetrySettings.js +++ b/samples/publishWithRetrySettings.js @@ -50,7 +50,7 @@ function main( }); async function publishWithRetrySettings() { - const formattedTopic = publisherClient.topicPath(projectId, topicName); + const formattedTopic = publisherClient.projectTopicPath(projectId, topicName); // Publishes the message as a string, e.g. "Hello, world!" or JSON.stringify(someObject) const dataBuffer = Buffer.from(data); diff --git a/smoke-test/.eslintrc.yml b/smoke-test/.eslintrc.yml deleted file mode 100644 index 0d3d77f79..000000000 --- a/smoke-test/.eslintrc.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -rules: - node/no-missing-require: off - no-console: off diff --git a/smoke-test/publisher_smoke_test.js b/smoke-test/publisher_smoke_test.js deleted file mode 100644 index 04b5a84c1..000000000 --- a/smoke-test/publisher_smoke_test.js +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -'use strict'; - -const {describe, it} = require('mocha'); - -describe('PublisherSmokeTest', () => { - if (!process.env.GCLOUD_PROJECT) { - throw new Error('Usage: GCLOUD_PROJECT= node #{$0}'); - } - const projectId = process.env.GCLOUD_PROJECT; - - it('successfully makes a call to the service using promises', done => { - const pubsub = require('../src'); - - const client = new pubsub.v1.PublisherClient({ - // optional auth parameters. - }); - - // Iterate over all elements. - const formattedProject = client.projectPath(projectId); - - client - .listTopics({project: formattedProject}) - .then(responses => { - const resources = responses[0]; - for (const resource of resources) { - console.log(resource); - } - }) - .then(done) - .catch(done); - }); - - it('successfully makes a call to the service using callbacks', done => { - const pubsub = require('../src'); - - const client = new pubsub.v1.PublisherClient({ - // optional auth parameters. - }); - - // Or obtain the paged response. - const formattedProject = client.projectPath(projectId); - - const options = {autoPaginate: false}; - const callback = responses => { - // The actual resources in a response. - const resources = responses[0]; - // The next request if the response shows that there are more responses. - const nextRequest = responses[1]; - // The actual response object, if necessary. - // const rawResponse = responses[2]; - for (const resource of resources) { - console.log(resource); - } - if (nextRequest) { - // Fetch the next page. - return client.listTopics(nextRequest, options).then(callback); - } - }; - client - .listTopics({project: formattedProject}, options) - .then(callback) - .then(done) - .catch(done); - }); - - it('successfully makes a call to the service using streaming', done => { - const pubsub = require('../src'); - - const client = new pubsub.v1.PublisherClient({ - // optional auth parameters. - }); - - const formattedProject = client.projectPath(projectId); - client - .listTopicsStream({project: formattedProject}) - .on('data', element => { - console.log(element); - }) - .on('error', done) - .on('end', done); - }); -}); diff --git a/src/helper.ts b/src/helper.ts new file mode 100644 index 000000000..3c90ff06f --- /dev/null +++ b/src/helper.ts @@ -0,0 +1,260 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as gax from 'google-gax'; +import {Descriptors, ClientOptions} from 'google-gax'; +import * as path from 'path'; +import * as gapicConfig from './iam_policy_service_client_config.json'; +import {ProjectIdCallback} from 'google-auth-library'; +import * as protosTypes from '../protos/protos'; +const {version} = require('../../package.json'); +/** + * Google Cloud IAM Client. + * This is manually written for providing methods [setIamPolicy, getIamPolicy, testIamPerssion] to the KMS client. + * We don't support it now in micro-generators. + * New feature request link: [https://github.com/googleapis/gapic-generator-typescript/issues/315] + */ +export class IamClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function} = {}; + private _terminated = false; + auth: gax.GoogleAuth; + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof IamClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof IamClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + const nodejsProtoPath = path.join(__dirname, '..', 'protos', 'protos.json'); + + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../protos/protos.json') : nodejsProtoPath + ); + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.iam.v1.IAMPolicy', + gapicConfig as gax.ClientConfig, + opts!.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + // Put together the "service stub" for + // google.iam.v1.IAMPolicy. + const iamPolicyStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService('google.iam.v1.IAMPolicy') + : // tslint:disable-next-line no-any + (protos as any).google.iam.v1.IAMPolicy, + opts + ) as Promise<{[method: string]: Function}>; + this._innerApiCalls = {}; + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const iamPolicyStubMethods = [ + 'getIamPolicy', + 'setIamPolicy', + 'testIamPermissions', + ]; + + for (const methodName of iamPolicyStubMethods) { + const innerCallPromise = iamPolicyStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] + ); + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'cloudkms.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'cloudkms.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloudkms', + ]; + } + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId(callback: ProjectIdCallback) { + return this.auth.getProjectId(callback); + } + + getIamPolicy(request: protosTypes.google.iam.v1.GetIamPolicyRequest): void; + getIamPolicy( + request: protosTypes.google.iam.v1.GetIamPolicyRequest, + options?: gax.CallOptions, + callback?: protosTypes.google.iam.v1.IAMPolicy.GetIamPolicyCallback + ): Promise { + if (options instanceof Function && callback === undefined) { + callback = (options as unknown) as protosTypes.google.iam.v1.IAMPolicy.GetIamPolicyCallback; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource, + }); + return this._innerApiCalls.getIamPolicy(request, options, callback); + } + setIamPolicy(request: protosTypes.google.iam.v1.SetIamPolicyRequest): void; + setIamPolicy( + request: protosTypes.google.iam.v1.SetIamPolicyRequest, + options?: gax.CallOptions, + callback?: protosTypes.google.iam.v1.IAMPolicy.SetIamPolicyCallback + ): Promise { + if (options instanceof Function && callback === undefined) { + callback = (options as unknown) as protosTypes.google.iam.v1.IAMPolicy.SetIamPolicyCallback; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource, + }); + + return this._innerApiCalls.setIamPolicy(request, options, callback); + } + testIamPermissions( + request: protosTypes.google.iam.v1.TestIamPermissionsRequest + ): void; + testIamPermissions( + request: protosTypes.google.iam.v1.TestIamPermissionsRequest, + options?: gax.CallOptions, + callback?: protosTypes.google.iam.v1.IAMPolicy.TestIamPermissionsCallback + ): Promise { + if (options instanceof Function && callback === undefined) { + callback = (options as unknown) as protosTypes.google.iam.v1.IAMPolicy.TestIamPermissionsCallback; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + resource: request.resource, + }); + + return this._innerApiCalls.testIamPermissions(request, options, callback); + } +} +export interface IamClient { + getIamPolicy(request: protosTypes.google.iam.v1.GetIamPolicyRequest): void; + getIamPolicy( + request: protosTypes.google.iam.v1.GetIamPolicyRequest, + options?: gax.CallOptions, + callback?: protosTypes.google.iam.v1.IAMPolicy.GetIamPolicyCallback + ): Promise; + setIamPolicy(request: protosTypes.google.iam.v1.SetIamPolicyRequest): void; + setIamPolicy( + request: protosTypes.google.iam.v1.SetIamPolicyRequest, + options?: gax.CallOptions, + callback?: protosTypes.google.iam.v1.IAMPolicy.SetIamPolicyCallback + ): Promise; + testIamPermissions( + request: protosTypes.google.iam.v1.TestIamPermissionsRequest + ): void; + testIamPermissions( + request: protosTypes.google.iam.v1.TestIamPermissionsRequest, + options?: gax.CallOptions, + callback?: protosTypes.google.iam.v1.IAMPolicy.TestIamPermissionsCallback + ): Promise; +} diff --git a/src/iam.ts b/src/iam.ts index b98014004..a3096bdbf 100644 --- a/src/iam.ts +++ b/src/iam.ts @@ -22,7 +22,7 @@ import {promisifyAll} from '@google-cloud/promisify'; import arrify = require('arrify'); import {CallOptions} from 'google-gax'; -import {google} from '../proto/iam'; +import {google} from '../protos/protos'; import {Omit, PubSub, RequestCallback, ResourceCallback} from './pubsub'; diff --git a/src/iam_policy_service_client_config.json b/src/iam_policy_service_client_config.json new file mode 100644 index 000000000..a63e35755 --- /dev/null +++ b/src/iam_policy_service_client_config.json @@ -0,0 +1,38 @@ +{ + "interfaces": { + "google.iam.v1.IAMPolicy": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/message-stream.ts b/src/message-stream.ts index 3d31ac3cd..ddac12de7 100644 --- a/src/message-stream.ts +++ b/src/message-stream.ts @@ -28,7 +28,7 @@ import {PassThrough} from 'stream'; import {PullRetry} from './pull-retry'; import {Subscriber} from './subscriber'; -import {google} from '../proto/pubsub'; +import {google} from '../protos/protos'; import {defaultOptions} from './default-options'; /*! @@ -258,7 +258,8 @@ export class MessageStream extends PassThrough { */ private async _getClient(): Promise { const client = await this._subscriber.getClient(); - return client.getSubscriberStub(); + client.initialize(); + return client.subscriberStub as Promise; } /** * Since we do not use the streams to ack/modAck messages, they will close diff --git a/src/publisher/index.ts b/src/publisher/index.ts index 3e3ed9b17..7386dba5e 100644 --- a/src/publisher/index.ts +++ b/src/publisher/index.ts @@ -22,7 +22,7 @@ import {BatchPublishOptions} from './message-batch'; import {Queue, OrderedQueue, PublishDone} from './message-queues'; import {Topic} from '../topic'; import {RequestCallback, EmptyCallback, EmptyResponse} from '../pubsub'; -import {google} from '../../proto/pubsub'; +import {google} from '../../protos/protos'; import {defaultOptions} from '../default-options'; export type PubsubMessage = google.pubsub.v1.IPubsubMessage; diff --git a/src/publisher/message-queues.ts b/src/publisher/message-queues.ts index 2f357e207..c7365ac7a 100644 --- a/src/publisher/message-queues.ts +++ b/src/publisher/message-queues.ts @@ -20,7 +20,7 @@ import {EventEmitter} from 'events'; import {BatchPublishOptions, MessageBatch} from './message-batch'; import {PublishError} from './publish-error'; import {Publisher, PubsubMessage, PublishCallback, BATCH_LIMITS} from './'; -import {google} from '../../proto/pubsub'; +import {google} from '../../protos/protos'; export interface PublishDone { (err: ServiceError | null): void; diff --git a/src/pubsub.ts b/src/pubsub.ts index 4b81e2a84..bc700fb50 100644 --- a/src/pubsub.ts +++ b/src/pubsub.ts @@ -45,7 +45,7 @@ import { import {PublishOptions} from './publisher'; import {CallOptions} from 'google-gax'; import {Transform} from 'stream'; -import {google} from '../proto/pubsub'; +import {google} from '../protos/protos'; const opts = {} as gax.GrpcClientOptions; @@ -277,9 +277,6 @@ export class PubSub { this.api = {}; this.auth = new GoogleAuth(this.options); this.projectId = this.options.projectId || PROJECT_ID_PLACEHOLDER; - if (this.options.promise) { - this.Promise = this.options.promise; - } } close(): Promise; @@ -665,11 +662,13 @@ export class PubSub { let snapshots: Snapshot[]; if (rawSnapshots) { - snapshots = rawSnapshots.map(snapshot => { - const snapshotInstance = this.snapshot(snapshot.name!); - snapshotInstance.metadata = snapshot; - return snapshotInstance; - }); + snapshots = rawSnapshots.map( + (snapshot: google.pubsub.v1.ISnapshot) => { + const snapshotInstance = this.snapshot(snapshot.name!); + snapshotInstance.metadata = snapshot; + return snapshotInstance; + } + ); } callback!(err, snapshots!, ...args); @@ -789,7 +788,7 @@ export class PubSub { let subscriptions: Subscription[]; if (rawSubs) { - subscriptions = rawSubs.map(sub => { + subscriptions = rawSubs.map((sub: google.pubsub.v1.ISubscription) => { const subscriptionInstance = this.subscription(sub.name!); subscriptionInstance.metadata = sub; return subscriptionInstance; diff --git a/src/service_proto_list.json b/src/service_proto_list.json index 4b20fe08d..03bfe23c6 100644 --- a/src/service_proto_list.json +++ b/src/service_proto_list.json @@ -1 +1,5 @@ -["../protos/google/pubsub/v1/pubsub.proto"] \ No newline at end of file +[ + "../../protos/google/iam/v1/policy.proto", + "../../protos/google/iam/v1/options.proto", + "../../protos/google/iam/v1/iam_policy.proto" +] diff --git a/src/snapshot.ts b/src/snapshot.ts index d2070c9c6..68339c44d 100644 --- a/src/snapshot.ts +++ b/src/snapshot.ts @@ -17,9 +17,9 @@ import {promisifyAll} from '@google-cloud/promisify'; import {CallOptions} from 'google-gax'; -import {google} from '../proto/pubsub'; +import {google} from '../protos/protos'; -import {PubSub} from './index'; +import {PubSub} from './pubsub'; import { EmptyCallback, EmptyResponse, diff --git a/src/subscriber.ts b/src/subscriber.ts index 03febd6b3..145ef1375 100644 --- a/src/subscriber.ts +++ b/src/subscriber.ts @@ -21,7 +21,7 @@ import {EventEmitter} from 'events'; import {ClientStub} from 'google-gax'; import {common as protobuf} from 'protobufjs'; -import {google} from '../proto/pubsub'; +import {google} from '../protos/protos'; import {Histogram} from './histogram'; import {FlowControlOptions, LeaseManager} from './lease-manager'; @@ -29,6 +29,7 @@ import {AckQueue, BatchOptions, ModAckQueue} from './message-queues'; import {MessageStream, MessageStreamOptions} from './message-stream'; import {Subscription} from './subscription'; import {defaultOptions} from './default-options'; +import {SubscriberClient} from './v1'; export type PullResponse = google.pubsub.v1.IPullResponse; @@ -323,7 +324,7 @@ export class Subscriber extends EventEmitter { * @returns {Promise} * @private */ - async getClient(): Promise { + async getClient(): Promise { const pubsub = this._subscription.pubsub; const [client] = await promisify(pubsub.getClient_).call(pubsub, { client: 'SubscriberClient', diff --git a/src/subscription.ts b/src/subscription.ts index 9995821b1..d83859dab 100644 --- a/src/subscription.ts +++ b/src/subscription.ts @@ -20,7 +20,7 @@ import * as extend from 'extend'; import {CallOptions} from 'google-gax'; import snakeCase = require('lodash.snakecase'); -import {google} from '../proto/pubsub'; +import {google} from '../protos/protos'; import {IAM} from './iam'; import {FlowControlOptions} from './lease-manager'; diff --git a/src/topic.ts b/src/topic.ts index 43f9278bd..526209f8e 100644 --- a/src/topic.ts +++ b/src/topic.ts @@ -18,7 +18,7 @@ import {paginator} from '@google-cloud/paginator'; import {promisifyAll} from '@google-cloud/promisify'; import {CallOptions} from 'google-gax'; -import {google} from '../proto/pubsub'; +import {google} from '../protos/protos'; import {IAM} from './iam'; import { @@ -607,7 +607,7 @@ export class Topic { let subscriptions: Subscription[]; if (subNames) { - subscriptions = subNames.map(sub => this.subscription(sub)); + subscriptions = subNames.map((sub: string) => this.subscription(sub)); } callback!(err, subscriptions!, ...args); diff --git a/src/v1/doc/google/iam/v1/doc_policy.js b/src/v1/doc/google/iam/v1/doc_policy.js deleted file mode 100644 index 322889591..000000000 --- a/src/v1/doc/google/iam/v1/doc_policy.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. diff --git a/src/v1/doc/google/protobuf/doc_duration.js b/src/v1/doc/google/protobuf/doc_duration.js deleted file mode 100644 index bd4b4ee60..000000000 --- a/src/v1/doc/google/protobuf/doc_duration.js +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Duration represents a signed, fixed-length span of time represented - * as a count of seconds and fractions of seconds at nanosecond - * resolution. It is independent of any calendar and concepts like "day" - * or "month". It is related to Timestamp in that the difference between - * two Timestamp values is a Duration and it can be added or subtracted - * from a Timestamp. Range is approximately +-10,000 years. - * - * # Examples - * - * Example 1: Compute Duration from two Timestamps in pseudo code. - * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; - * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; - * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (durations.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } - * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; - * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; - * - * if (end.nanos < 0) { - * end.seconds -= 1; - * end.nanos += 1000000000; - * } else if (end.nanos >= 1000000000) { - * end.seconds += 1; - * end.nanos -= 1000000000; - * } - * - * Example 3: Compute Duration from datetime.timedelta in Python. - * - * td = datetime.timedelta(days=3, minutes=10) - * duration = Duration() - * duration.FromTimedelta(td) - * - * # JSON Mapping - * - * In JSON format, the Duration type is encoded as a string rather than an - * object, where the string ends in the suffix "s" (indicating seconds) and - * is preceded by the number of seconds, with nanoseconds expressed as - * fractional seconds. For example, 3 seconds with 0 nanoseconds should be - * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - * microsecond should be expressed in JSON format as "3.000001s". - * - * @property {number} seconds - * Signed seconds of the span of time. Must be from -315,576,000,000 - * to +315,576,000,000 inclusive. Note: these bounds are computed from: - * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - * - * @property {number} nanos - * Signed fractions of a second at nanosecond resolution of the span - * of time. Durations less than one second are represented with a 0 - * `seconds` field and a positive or negative `nanos` field. For durations - * of one second or more, a non-zero value for the `nanos` field must be - * of the same sign as the `seconds` field. Must be from -999,999,999 - * to +999,999,999 inclusive. - * - * @typedef Duration - * @memberof google.protobuf - * @see [google.protobuf.Duration definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/duration.proto} - */ -const Duration = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v1/doc/google/protobuf/doc_empty.js b/src/v1/doc/google/protobuf/doc_empty.js deleted file mode 100644 index 1e3961d66..000000000 --- a/src/v1/doc/google/protobuf/doc_empty.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request - * or the response type of an API method. For instance: - * - * service Foo { - * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - * } - * - * The JSON representation for `Empty` is empty JSON object `{}`. - * @typedef Empty - * @memberof google.protobuf - * @see [google.protobuf.Empty definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/empty.proto} - */ -const Empty = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v1/doc/google/protobuf/doc_field_mask.js b/src/v1/doc/google/protobuf/doc_field_mask.js deleted file mode 100644 index 59e745f36..000000000 --- a/src/v1/doc/google/protobuf/doc_field_mask.js +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `FieldMask` represents a set of symbolic field paths, for example: - * - * paths: "f.a" - * paths: "f.b.d" - * - * Here `f` represents a field in some root message, `a` and `b` - * fields in the message found in `f`, and `d` a field found in the - * message in `f.b`. - * - * Field masks are used to specify a subset of fields that should be - * returned by a get operation or modified by an update operation. - * Field masks also have a custom JSON encoding (see below). - * - * # Field Masks in Projections - * - * When used in the context of a projection, a response message or - * sub-message is filtered by the API to only contain those fields as - * specified in the mask. For example, if the mask in the previous - * example is applied to a response message as follows: - * - * f { - * a : 22 - * b { - * d : 1 - * x : 2 - * } - * y : 13 - * } - * z: 8 - * - * The result will not contain specific values for fields x,y and z - * (their value will be set to the default, and omitted in proto text - * output): - * - * - * f { - * a : 22 - * b { - * d : 1 - * } - * } - * - * A repeated field is not allowed except at the last position of a - * paths string. - * - * If a FieldMask object is not present in a get operation, the - * operation applies to all fields (as if a FieldMask of all fields - * had been specified). - * - * Note that a field mask does not necessarily apply to the - * top-level response message. In case of a REST get operation, the - * field mask applies directly to the response, but in case of a REST - * list operation, the mask instead applies to each individual message - * in the returned resource list. In case of a REST custom method, - * other definitions may be used. Where the mask applies will be - * clearly documented together with its declaration in the API. In - * any case, the effect on the returned resource/resources is required - * behavior for APIs. - * - * # Field Masks in Update Operations - * - * A field mask in update operations specifies which fields of the - * targeted resource are going to be updated. The API is required - * to only change the values of the fields as specified in the mask - * and leave the others untouched. If a resource is passed in to - * describe the updated values, the API ignores the values of all - * fields not covered by the mask. - * - * If a repeated field is specified for an update operation, new values will - * be appended to the existing repeated field in the target resource. Note that - * a repeated field is only allowed in the last position of a `paths` string. - * - * If a sub-message is specified in the last position of the field mask for an - * update operation, then new value will be merged into the existing sub-message - * in the target resource. - * - * For example, given the target message: - * - * f { - * b { - * d: 1 - * x: 2 - * } - * c: [1] - * } - * - * And an update message: - * - * f { - * b { - * d: 10 - * } - * c: [2] - * } - * - * then if the field mask is: - * - * paths: ["f.b", "f.c"] - * - * then the result will be: - * - * f { - * b { - * d: 10 - * x: 2 - * } - * c: [1, 2] - * } - * - * An implementation may provide options to override this default behavior for - * repeated and message fields. - * - * In order to reset a field's value to the default, the field must - * be in the mask and set to the default value in the provided resource. - * Hence, in order to reset all fields of a resource, provide a default - * instance of the resource and set all fields in the mask, or do - * not provide a mask as described below. - * - * If a field mask is not present on update, the operation applies to - * all fields (as if a field mask of all fields has been specified). - * Note that in the presence of schema evolution, this may mean that - * fields the client does not know and has therefore not filled into - * the request will be reset to their default. If this is unwanted - * behavior, a specific service may require a client to always specify - * a field mask, producing an error if not. - * - * As with get operations, the location of the resource which - * describes the updated values in the request message depends on the - * operation kind. In any case, the effect of the field mask is - * required to be honored by the API. - * - * ## Considerations for HTTP REST - * - * The HTTP kind of an update operation which uses a field mask must - * be set to PATCH instead of PUT in order to satisfy HTTP semantics - * (PUT must only be used for full updates). - * - * # JSON Encoding of Field Masks - * - * In JSON, a field mask is encoded as a single string where paths are - * separated by a comma. Fields name in each path are converted - * to/from lower-camel naming conventions. - * - * As an example, consider the following message declarations: - * - * message Profile { - * User user = 1; - * Photo photo = 2; - * } - * message User { - * string display_name = 1; - * string address = 2; - * } - * - * In proto a field mask for `Profile` may look as such: - * - * mask { - * paths: "user.display_name" - * paths: "photo" - * } - * - * In JSON, the same mask is represented as below: - * - * { - * mask: "user.displayName,photo" - * } - * - * # Field Masks and Oneof Fields - * - * Field masks treat fields in oneofs just as regular fields. Consider the - * following message: - * - * message SampleMessage { - * oneof test_oneof { - * string name = 4; - * SubMessage sub_message = 9; - * } - * } - * - * The field mask can be: - * - * mask { - * paths: "name" - * } - * - * Or: - * - * mask { - * paths: "sub_message" - * } - * - * Note that oneof type names ("test_oneof" in this case) cannot be used in - * paths. - * - * ## Field Mask Verification - * - * The implementation of any API method which has a FieldMask type field in the - * request should verify the included field paths, and return an - * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. - * - * @property {string[]} paths - * The set of field mask paths. - * - * @typedef FieldMask - * @memberof google.protobuf - * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} - */ -const FieldMask = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v1/doc/google/protobuf/doc_timestamp.js b/src/v1/doc/google/protobuf/doc_timestamp.js deleted file mode 100644 index ad801cc9a..000000000 --- a/src/v1/doc/google/protobuf/doc_timestamp.js +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. - * - * @property {number} seconds - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - * - * @property {number} nanos - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - * - * @typedef Timestamp - * @memberof google.protobuf - * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} - */ -const Timestamp = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v1/doc/google/pubsub/v1/doc_pubsub.js b/src/v1/doc/google/pubsub/v1/doc_pubsub.js deleted file mode 100644 index ff7d0345b..000000000 --- a/src/v1/doc/google/pubsub/v1/doc_pubsub.js +++ /dev/null @@ -1,1125 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * @property {string[]} allowedPersistenceRegions - * A list of IDs of GCP regions where messages that are published to the topic - * may be persisted in storage. Messages published by publishers running in - * non-allowed GCP regions (or running outside of GCP altogether) will be - * routed for storage in one of the allowed regions. An empty list means that - * no regions are allowed, and is not a valid configuration. - * - * @typedef MessageStoragePolicy - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.MessageStoragePolicy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const MessageStoragePolicy = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A topic resource. - * - * @property {string} name - * Required. The name of the topic. It must have the format - * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, - * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), - * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent - * signs (`%`). It must be between 3 and 255 characters in length, and it - * must not start with `"goog"`. - * - * @property {Object.} labels - * See Creating and - * managing labels. - * - * @property {Object} messageStoragePolicy - * Policy constraining the set of Google Cloud Platform regions where messages - * published to the topic may be stored. If not present, then no constraints - * are in effect. - * - * This object should have the same structure as [MessageStoragePolicy]{@link google.pubsub.v1.MessageStoragePolicy} - * - * @property {string} kmsKeyName - * The resource name of the Cloud KMS CryptoKey to be used to protect access - * to messages published on this topic. - * - * The expected format is `projects/* /locations/* /keyRings/* /cryptoKeys/*`. - * - * @typedef Topic - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.Topic definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const Topic = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A message that is published by publishers and consumed by subscribers. The - * message must contain either a non-empty data field or at least one attribute. - * Note that client libraries represent this object differently - * depending on the language. See the corresponding - * client - * library documentation for more information. See - * Quotas and limits - * for more information about message limits. - * - * @property {Buffer} data - * The message data field. If this field is empty, the message must contain - * at least one attribute. - * - * @property {Object.} attributes - * Attributes for this message. If this field is empty, the message must - * contain non-empty data. - * - * @property {string} messageId - * ID of this message, assigned by the server when the message is published. - * Guaranteed to be unique within the topic. This value may be read by a - * subscriber that receives a `PubsubMessage` via a `Pull` call or a push - * delivery. It must not be populated by the publisher in a `Publish` call. - * - * @property {Object} publishTime - * The time at which the message was published, populated by the server when - * it receives the `Publish` call. It must not be populated by the - * publisher in a `Publish` call. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} orderingKey - * If non-empty, identifies related messages for which publish order should be - * respected. If a `Subscription` has `enable_message_ordering` set to `true`, - * messages published with the same non-empty `ordering_key` value will be - * delivered to subscribers in the order in which they are received by the - * Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest` - * must specify the same `ordering_key` value. - * EXPERIMENTAL: This feature is part of a closed alpha release. This - * API might be changed in backward-incompatible ways and is not recommended - * for production use. It is not subject to any SLA or deprecation policy. - * - * @typedef PubsubMessage - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.PubsubMessage definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const PubsubMessage = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the GetTopic method. - * - * @property {string} topic - * Required. The name of the topic to get. - * Format is `projects/{project}/topics/{topic}`. - * - * @typedef GetTopicRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.GetTopicRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const GetTopicRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the UpdateTopic method. - * - * @property {Object} topic - * Required. The updated topic object. - * - * This object should have the same structure as [Topic]{@link google.pubsub.v1.Topic} - * - * @property {Object} updateMask - * Required. Indicates which fields in the provided topic to update. Must be - * specified and non-empty. Note that if `update_mask` contains - * "message_storage_policy" then the new value will be determined based on the - * policy configured at the project or organization level. The - * `message_storage_policy` must not be set in the `topic` provided above. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateTopicRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.UpdateTopicRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const UpdateTopicRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the Publish method. - * - * @property {string} topic - * Required. The messages in the request will be published on this topic. - * Format is `projects/{project}/topics/{topic}`. - * - * @property {Object[]} messages - * Required. The messages to publish. - * - * This object should have the same structure as [PubsubMessage]{@link google.pubsub.v1.PubsubMessage} - * - * @typedef PublishRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.PublishRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const PublishRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response for the `Publish` method. - * - * @property {string[]} messageIds - * The server-assigned ID of each published message, in the same order as - * the messages in the request. IDs are guaranteed to be unique within - * the topic. - * - * @typedef PublishResponse - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.PublishResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const PublishResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the `ListTopics` method. - * - * @property {string} project - * Required. The name of the project in which to list topics. - * Format is `projects/{project-id}`. - * - * @property {number} pageSize - * Maximum number of topics to return. - * - * @property {string} pageToken - * The value returned by the last `ListTopicsResponse`; indicates that this is - * a continuation of a prior `ListTopics` call, and that the system should - * return the next page of data. - * - * @typedef ListTopicsRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.ListTopicsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const ListTopicsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response for the `ListTopics` method. - * - * @property {Object[]} topics - * The resulting topics. - * - * This object should have the same structure as [Topic]{@link google.pubsub.v1.Topic} - * - * @property {string} nextPageToken - * If not empty, indicates that there may be more topics that match the - * request; this value should be passed in a new `ListTopicsRequest`. - * - * @typedef ListTopicsResponse - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.ListTopicsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const ListTopicsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the `ListTopicSubscriptions` method. - * - * @property {string} topic - * Required. The name of the topic that subscriptions are attached to. - * Format is `projects/{project}/topics/{topic}`. - * - * @property {number} pageSize - * Maximum number of subscription names to return. - * - * @property {string} pageToken - * The value returned by the last `ListTopicSubscriptionsResponse`; indicates - * that this is a continuation of a prior `ListTopicSubscriptions` call, and - * that the system should return the next page of data. - * - * @typedef ListTopicSubscriptionsRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.ListTopicSubscriptionsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const ListTopicSubscriptionsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response for the `ListTopicSubscriptions` method. - * - * @property {string[]} subscriptions - * The names of the subscriptions that match the request. - * - * @property {string} nextPageToken - * If not empty, indicates that there may be more subscriptions that match - * the request; this value should be passed in a new - * `ListTopicSubscriptionsRequest` to get more subscriptions. - * - * @typedef ListTopicSubscriptionsResponse - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.ListTopicSubscriptionsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const ListTopicSubscriptionsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the `ListTopicSnapshots` method. - * - * @property {string} topic - * Required. The name of the topic that snapshots are attached to. - * Format is `projects/{project}/topics/{topic}`. - * - * @property {number} pageSize - * Maximum number of snapshot names to return. - * - * @property {string} pageToken - * The value returned by the last `ListTopicSnapshotsResponse`; indicates - * that this is a continuation of a prior `ListTopicSnapshots` call, and - * that the system should return the next page of data. - * - * @typedef ListTopicSnapshotsRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.ListTopicSnapshotsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const ListTopicSnapshotsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response for the `ListTopicSnapshots` method. - * - * @property {string[]} snapshots - * The names of the snapshots that match the request. - * - * @property {string} nextPageToken - * If not empty, indicates that there may be more snapshots that match - * the request; this value should be passed in a new - * `ListTopicSnapshotsRequest` to get more snapshots. - * - * @typedef ListTopicSnapshotsResponse - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.ListTopicSnapshotsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const ListTopicSnapshotsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the `DeleteTopic` method. - * - * @property {string} topic - * Required. Name of the topic to delete. - * Format is `projects/{project}/topics/{topic}`. - * - * @typedef DeleteTopicRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.DeleteTopicRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const DeleteTopicRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A subscription resource. - * - * @property {string} name - * Required. The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - * start with a letter, and contain only letters (`[A-Za-z]`), numbers - * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - * in length, and it must not start with `"goog"`. - * - * @property {string} topic - * Required. The name of the topic from which this subscription is receiving - * messages. Format is `projects/{project}/topics/{topic}`. The value of this - * field will be `_deleted-topic_` if the topic has been deleted. - * - * @property {Object} pushConfig - * If push delivery is used with this subscription, this field is - * used to configure it. An empty `pushConfig` signifies that the subscriber - * will pull and ack messages using API methods. - * - * This object should have the same structure as [PushConfig]{@link google.pubsub.v1.PushConfig} - * - * @property {number} ackDeadlineSeconds - * The approximate amount of time (on a best-effort basis) Pub/Sub waits for - * the subscriber to acknowledge receipt before resending the message. In the - * interval after the message is delivered and before it is acknowledged, it - * is considered to be outstanding. During that time period, the - * message will not be redelivered (on a best-effort basis). - * - * For pull subscriptions, this value is used as the initial value for the ack - * deadline. To override this value for a given message, call - * `ModifyAckDeadline` with the corresponding `ack_id` if using - * non-streaming pull or send the `ack_id` in a - * `StreamingModifyAckDeadlineRequest` if using streaming pull. - * The minimum custom deadline you can specify is 10 seconds. - * The maximum custom deadline you can specify is 600 seconds (10 minutes). - * If this parameter is 0, a default value of 10 seconds is used. - * - * For push delivery, this value is also used to set the request timeout for - * the call to the push endpoint. - * - * If the subscriber never acknowledges the message, the Pub/Sub - * system will eventually redeliver the message. - * - * @property {boolean} retainAckedMessages - * Indicates whether to retain acknowledged messages. If true, then - * messages are not expunged from the subscription's backlog, even if they are - * acknowledged, until they fall out of the `message_retention_duration` - * window. This must be true if you would like to - * - * Seek to a timestamp. - * - * @property {Object} messageRetentionDuration - * How long to retain unacknowledged messages in the subscription's backlog, - * from the moment a message is published. - * If `retain_acked_messages` is true, then this also configures the retention - * of acknowledged messages, and thus configures how far back in time a `Seek` - * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10 - * minutes. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @property {Object.} labels - * See Creating and - * managing labels. - * - * @property {boolean} enableMessageOrdering - * If true, messages published with the same `ordering_key` in `PubsubMessage` - * will be delivered to the subscribers in the order in which they - * are received by the Pub/Sub system. Otherwise, they may be delivered in - * any order. - * EXPERIMENTAL: This feature is part of a closed alpha release. This - * API might be changed in backward-incompatible ways and is not recommended - * for production use. It is not subject to any SLA or deprecation policy. - * - * @property {Object} expirationPolicy - * A policy that specifies the conditions for this subscription's expiration. - * A subscription is considered active as long as any connected subscriber is - * successfully consuming messages from the subscription or is issuing - * operations on the subscription. If `expiration_policy` is not set, a - * *default policy* with `ttl` of 31 days will be used. The minimum allowed - * value for `expiration_policy.ttl` is 1 day. - * - * This object should have the same structure as [ExpirationPolicy]{@link google.pubsub.v1.ExpirationPolicy} - * - * @property {Object} deadLetterPolicy - * A policy that specifies the conditions for dead lettering messages in - * this subscription. If dead_letter_policy is not set, dead lettering - * is disabled. - * - * The Cloud Pub/Sub service account associated with this subscriptions's - * parent project (i.e., - * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have - * permission to Acknowledge() messages on this subscription. - * EXPERIMENTAL: This feature is part of a closed alpha release. This - * API might be changed in backward-incompatible ways and is not recommended - * for production use. It is not subject to any SLA or deprecation policy. - * - * This object should have the same structure as [DeadLetterPolicy]{@link google.pubsub.v1.DeadLetterPolicy} - * - * @typedef Subscription - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.Subscription definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const Subscription = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Dead lettering is done on a best effort basis. The same message might be - * dead lettered multiple times. - * - * If validation on any of the fields fails at subscription creation/updation, - * the create/update subscription request will fail. - * - * @property {string} deadLetterTopic - * The name of the topic to which dead letter messages should be published. - * Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service - * account associated with the enclosing subscription's parent project (i.e., - * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have - * permission to Publish() to this topic. - * - * The operation will fail if the topic does not exist. - * Users should ensure that there is a subscription attached to this topic - * since messages published to a topic with no subscriptions are lost. - * - * @property {number} maxDeliveryAttempts - * The maximum number of delivery attempts for any message. The value must be - * between 5 and 100. - * - * The number of delivery attempts is defined as 1 + (the sum of number of - * NACKs and number of times the acknowledgement deadline has been exceeded - * for the message). - * - * A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that - * client libraries may automatically extend ack_deadlines. - * - * This field will be honored on a best effort basis. - * - * If this parameter is 0, a default value of 5 is used. - * - * @typedef DeadLetterPolicy - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.DeadLetterPolicy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const DeadLetterPolicy = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A policy that specifies the conditions for resource expiration (i.e., - * automatic resource deletion). - * - * @property {Object} ttl - * Specifies the "time-to-live" duration for an associated resource. The - * resource expires if it is not active for a period of `ttl`. The definition - * of "activity" depends on the type of the associated resource. The minimum - * and maximum allowed values for `ttl` depend on the type of the associated - * resource, as well. If `ttl` is not set, the associated resource never - * expires. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @typedef ExpirationPolicy - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.ExpirationPolicy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const ExpirationPolicy = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Configuration for a push delivery endpoint. - * - * @property {string} pushEndpoint - * A URL locating the endpoint to which messages should be pushed. - * For example, a Webhook endpoint might use "https://example.com/push". - * - * @property {Object.} attributes - * Endpoint configuration attributes that can be used to control different - * aspects of the message delivery. - * - * The only currently supported attribute is `x-goog-version`, which you can - * use to change the format of the pushed message. This attribute - * indicates the version of the data expected by the endpoint. This - * controls the shape of the pushed message (i.e., its fields and metadata). - * - * If not present during the `CreateSubscription` call, it will default to - * the version of the Pub/Sub API used to make such call. If not present in a - * `ModifyPushConfig` call, its value will not be changed. `GetSubscription` - * calls will always return a valid version, even if the subscription was - * created without this attribute. - * - * The only supported values for the `x-goog-version` attribute are: - * - * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. - * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. - * - * For example: - *
attributes { "x-goog-version": "v1" } 
- * - * @property {Object} oidcToken - * If specified, Pub/Sub will generate and attach an OIDC JWT token as an - * `Authorization` header in the HTTP request for every pushed message. - * - * This object should have the same structure as [OidcToken]{@link google.pubsub.v1.OidcToken} - * - * @typedef PushConfig - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.PushConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const PushConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Contains information needed for generating an - * [OpenID Connect - * token](https://developers.google.com/identity/protocols/OpenIDConnect). - * - * @property {string} serviceAccountEmail - * [Service account - * email](https://cloud.google.com/iam/docs/service-accounts) - * to be used for generating the OIDC token. The caller (for - * CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must - * have the iam.serviceAccounts.actAs permission for the service account. - * - * @property {string} audience - * Audience to be used when generating OIDC token. The audience claim - * identifies the recipients that the JWT is intended for. The audience - * value is a single case-sensitive string. Having multiple values (array) - * for the audience field is not supported. More info about the OIDC JWT - * token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 - * Note: if not specified, the Push endpoint URL will be used. - * - * @typedef OidcToken - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.PushConfig.OidcToken definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ - OidcToken: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * A message and its corresponding acknowledgment ID. - * - * @property {string} ackId - * This ID can be used to acknowledge the received message. - * - * @property {Object} message - * The message. - * - * This object should have the same structure as [PubsubMessage]{@link google.pubsub.v1.PubsubMessage} - * - * @property {number} deliveryAttempt - * Delivery attempt counter is 1 + (the sum of number of NACKs and number of - * ack_deadline exceeds) for this message. - * - * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline - * exceeds event is whenever a message is not acknowledged within - * ack_deadline. Note that ack_deadline is initially - * Subscription.ackDeadlineSeconds, but may get extended automatically by - * the client library. - * - * The first delivery of a given message will have this value as 1. The value - * is calculated at best effort and is approximate. - * - * If a DeadLetterPolicy is not set on the subscription, this will be 0. - * EXPERIMENTAL: This feature is part of a closed alpha release. This - * API might be changed in backward-incompatible ways and is not recommended - * for production use. It is not subject to any SLA or deprecation policy. - * - * @typedef ReceivedMessage - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.ReceivedMessage definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const ReceivedMessage = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the GetSubscription method. - * - * @property {string} subscription - * Required. The name of the subscription to get. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * @typedef GetSubscriptionRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.GetSubscriptionRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const GetSubscriptionRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the UpdateSubscription method. - * - * @property {Object} subscription - * Required. The updated subscription object. - * - * This object should have the same structure as [Subscription]{@link google.pubsub.v1.Subscription} - * - * @property {Object} updateMask - * Required. Indicates which fields in the provided subscription to update. - * Must be specified and non-empty. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateSubscriptionRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.UpdateSubscriptionRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const UpdateSubscriptionRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the `ListSubscriptions` method. - * - * @property {string} project - * Required. The name of the project in which to list subscriptions. - * Format is `projects/{project-id}`. - * - * @property {number} pageSize - * Maximum number of subscriptions to return. - * - * @property {string} pageToken - * The value returned by the last `ListSubscriptionsResponse`; indicates that - * this is a continuation of a prior `ListSubscriptions` call, and that the - * system should return the next page of data. - * - * @typedef ListSubscriptionsRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.ListSubscriptionsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const ListSubscriptionsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response for the `ListSubscriptions` method. - * - * @property {Object[]} subscriptions - * The subscriptions that match the request. - * - * This object should have the same structure as [Subscription]{@link google.pubsub.v1.Subscription} - * - * @property {string} nextPageToken - * If not empty, indicates that there may be more subscriptions that match - * the request; this value should be passed in a new - * `ListSubscriptionsRequest` to get more subscriptions. - * - * @typedef ListSubscriptionsResponse - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.ListSubscriptionsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const ListSubscriptionsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the DeleteSubscription method. - * - * @property {string} subscription - * Required. The subscription to delete. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * @typedef DeleteSubscriptionRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.DeleteSubscriptionRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const DeleteSubscriptionRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the ModifyPushConfig method. - * - * @property {string} subscription - * Required. The name of the subscription. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * @property {Object} pushConfig - * Required. The push configuration for future deliveries. - * - * An empty `pushConfig` indicates that the Pub/Sub system should - * stop pushing messages from the given subscription and allow - * messages to be pulled and acknowledged - effectively pausing - * the subscription if `Pull` or `StreamingPull` is not called. - * - * This object should have the same structure as [PushConfig]{@link google.pubsub.v1.PushConfig} - * - * @typedef ModifyPushConfigRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.ModifyPushConfigRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const ModifyPushConfigRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the `Pull` method. - * - * @property {string} subscription - * Required. The subscription from which messages should be pulled. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * @property {boolean} returnImmediately - * Optional. If this field set to true, the system will respond immediately - * even if it there are no messages available to return in the `Pull` - * response. Otherwise, the system may wait (for a bounded amount of time) - * until at least one message is available, rather than returning no messages. - * Warning: setting this field to `true` is discouraged because it adversely - * impacts the performance of `Pull` operations. We recommend that users do - * not set this field. - * - * @property {number} maxMessages - * Required. The maximum number of messages to return for this request. Must - * be a positive integer. The Pub/Sub system may return fewer than the number - * specified. - * - * @typedef PullRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.PullRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const PullRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response for the `Pull` method. - * - * @property {Object[]} receivedMessages - * Received Pub/Sub messages. The list will be empty if there are no more - * messages available in the backlog. For JSON, the response can be entirely - * empty. The Pub/Sub system may return fewer than the `maxMessages` requested - * even if there are more messages available in the backlog. - * - * This object should have the same structure as [ReceivedMessage]{@link google.pubsub.v1.ReceivedMessage} - * - * @typedef PullResponse - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.PullResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const PullResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the ModifyAckDeadline method. - * - * @property {string} subscription - * Required. The name of the subscription. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * @property {string[]} ackIds - * Required. List of acknowledgment IDs. - * - * @property {number} ackDeadlineSeconds - * Required. The new ack deadline with respect to the time this request was - * sent to the Pub/Sub system. For example, if the value is 10, the new ack - * deadline will expire 10 seconds after the `ModifyAckDeadline` call was - * made. Specifying zero might immediately make the message available for - * delivery to another subscriber client. This typically results in an - * increase in the rate of message redeliveries (that is, duplicates). - * The minimum deadline you can specify is 0 seconds. - * The maximum deadline you can specify is 600 seconds (10 minutes). - * - * @typedef ModifyAckDeadlineRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.ModifyAckDeadlineRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const ModifyAckDeadlineRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the Acknowledge method. - * - * @property {string} subscription - * Required. The subscription whose message is being acknowledged. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * @property {string[]} ackIds - * Required. The acknowledgment ID for the messages being acknowledged that - * was returned by the Pub/Sub system in the `Pull` response. Must not be - * empty. - * - * @typedef AcknowledgeRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.AcknowledgeRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const AcknowledgeRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the `StreamingPull` streaming RPC method. This request is used to - * establish the initial stream as well as to stream acknowledgements and ack - * deadline modifications from the client to the server. - * - * @property {string} subscription - * Required. The subscription for which to initialize the new stream. This - * must be provided in the first request on the stream, and must not be set in - * subsequent requests from client to server. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * @property {string[]} ackIds - * List of acknowledgement IDs for acknowledging previously received messages - * (received on this stream or a different stream). If an ack ID has expired, - * the corresponding message may be redelivered later. Acknowledging a message - * more than once will not result in an error. If the acknowledgement ID is - * malformed, the stream will be aborted with status `INVALID_ARGUMENT`. - * - * @property {number[]} modifyDeadlineSeconds - * The list of new ack deadlines for the IDs listed in - * `modify_deadline_ack_ids`. The size of this list must be the same as the - * size of `modify_deadline_ack_ids`. If it differs the stream will be aborted - * with `INVALID_ARGUMENT`. Each element in this list is applied to the - * element in the same position in `modify_deadline_ack_ids`. The new ack - * deadline is with respect to the time this request was sent to the Pub/Sub - * system. Must be >= 0. For example, if the value is 10, the new ack deadline - * will expire 10 seconds after this request is received. If the value is 0, - * the message is immediately made available for another streaming or - * non-streaming pull request. If the value is < 0 (an error), the stream will - * be aborted with status `INVALID_ARGUMENT`. - * - * @property {string[]} modifyDeadlineAckIds - * List of acknowledgement IDs whose deadline will be modified based on the - * corresponding element in `modify_deadline_seconds`. This field can be used - * to indicate that more time is needed to process a message by the - * subscriber, or to make the message available for redelivery if the - * processing was interrupted. - * - * @property {number} streamAckDeadlineSeconds - * Required. The ack deadline to use for the stream. This must be provided in - * the first request on the stream, but it can also be updated on subsequent - * requests from client to server. The minimum deadline you can specify is 10 - * seconds. The maximum deadline you can specify is 600 seconds (10 minutes). - * - * @property {string} clientId - * A unique identifier that is used to distinguish client instances from each - * other. Only needs to be provided on the initial request. When a stream - * disconnects and reconnects for the same stream, the client_id should be set - * to the same value so that state associated with the old stream can be - * transferred to the new stream. The same client_id should not be used for - * different client instances. - * - * @typedef StreamingPullRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.StreamingPullRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const StreamingPullRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response for the `StreamingPull` method. This response is used to stream - * messages from the server to the client. - * - * @property {Object[]} receivedMessages - * Received Pub/Sub messages. This will not be empty. - * - * This object should have the same structure as [ReceivedMessage]{@link google.pubsub.v1.ReceivedMessage} - * - * @typedef StreamingPullResponse - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.StreamingPullResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const StreamingPullResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the `CreateSnapshot` method. - * - * @property {string} name - * Required. User-provided name for this snapshot. If the name is not provided - * in the request, the server will assign a random name for this snapshot on - * the same project as the subscription. Note that for REST API requests, you - * must specify a name. See the resource - * name rules. Format is `projects/{project}/snapshots/{snap}`. - * - * @property {string} subscription - * Required. The subscription whose backlog the snapshot retains. - * Specifically, the created snapshot is guaranteed to retain: - * (a) The existing backlog on the subscription. More precisely, this is - * defined as the messages in the subscription's backlog that are - * unacknowledged upon the successful completion of the - * `CreateSnapshot` request; as well as: - * (b) Any messages published to the subscription's topic following the - * successful completion of the CreateSnapshot request. - * Format is `projects/{project}/subscriptions/{sub}`. - * - * @property {Object.} labels - * See Creating and - * managing labels. - * - * @typedef CreateSnapshotRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.CreateSnapshotRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const CreateSnapshotRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the UpdateSnapshot method. - * - * @property {Object} snapshot - * Required. The updated snapshot object. - * - * This object should have the same structure as [Snapshot]{@link google.pubsub.v1.Snapshot} - * - * @property {Object} updateMask - * Required. Indicates which fields in the provided snapshot to update. - * Must be specified and non-empty. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateSnapshotRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.UpdateSnapshotRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const UpdateSnapshotRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A snapshot resource. Snapshots are used in - * Seek - * operations, which allow - * you to manage message acknowledgments in bulk. That is, you can set the - * acknowledgment state of messages in an existing subscription to the state - * captured by a snapshot. - * - * @property {string} name - * The name of the snapshot. - * - * @property {string} topic - * The name of the topic from which this snapshot is retaining messages. - * - * @property {Object} expireTime - * The snapshot is guaranteed to exist up until this time. - * A newly-created snapshot expires no later than 7 days from the time of its - * creation. Its exact lifetime is determined at creation by the existing - * backlog in the source subscription. Specifically, the lifetime of the - * snapshot is `7 days - (age of oldest unacked message in the subscription)`. - * For example, consider a subscription whose oldest unacked message is 3 days - * old. If a snapshot is created from this subscription, the snapshot -- which - * will always capture this 3-day-old backlog as long as the snapshot - * exists -- will expire in 4 days. The service will refuse to create a - * snapshot that would expire in less than 1 hour after creation. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object.} labels - * See Creating and - * managing labels. - * - * @typedef Snapshot - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.Snapshot definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const Snapshot = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the GetSnapshot method. - * - * @property {string} snapshot - * Required. The name of the snapshot to get. - * Format is `projects/{project}/snapshots/{snap}`. - * - * @typedef GetSnapshotRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.GetSnapshotRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const GetSnapshotRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the `ListSnapshots` method. - * - * @property {string} project - * Required. The name of the project in which to list snapshots. - * Format is `projects/{project-id}`. - * - * @property {number} pageSize - * Maximum number of snapshots to return. - * - * @property {string} pageToken - * The value returned by the last `ListSnapshotsResponse`; indicates that this - * is a continuation of a prior `ListSnapshots` call, and that the system - * should return the next page of data. - * - * @typedef ListSnapshotsRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.ListSnapshotsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const ListSnapshotsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response for the `ListSnapshots` method. - * - * @property {Object[]} snapshots - * The resulting snapshots. - * - * This object should have the same structure as [Snapshot]{@link google.pubsub.v1.Snapshot} - * - * @property {string} nextPageToken - * If not empty, indicates that there may be more snapshot that match the - * request; this value should be passed in a new `ListSnapshotsRequest`. - * - * @typedef ListSnapshotsResponse - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.ListSnapshotsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const ListSnapshotsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the `DeleteSnapshot` method. - * - * @property {string} snapshot - * Required. The name of the snapshot to delete. - * Format is `projects/{project}/snapshots/{snap}`. - * - * @typedef DeleteSnapshotRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.DeleteSnapshotRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const DeleteSnapshotRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Request for the `Seek` method. - * - * @property {string} subscription - * Required. The subscription to affect. - * - * @property {Object} time - * The time to seek to. - * Messages retained in the subscription that were published before this - * time are marked as acknowledged, and messages retained in the - * subscription that were published after this time are marked as - * unacknowledged. Note that this operation affects only those messages - * retained in the subscription (configured by the combination of - * `message_retention_duration` and `retain_acked_messages`). For example, - * if `time` corresponds to a point before the message retention - * window (or to a point before the system's notion of the subscription - * creation time), only retained messages will be marked as unacknowledged, - * and already-expunged messages will not be restored. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} snapshot - * The snapshot to seek to. The snapshot's topic must be the same as that of - * the provided subscription. - * Format is `projects/{project}/snapshots/{snap}`. - * - * @typedef SeekRequest - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.SeekRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const SeekRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Response for the `Seek` method (this response is empty). - * @typedef SeekResponse - * @memberof google.pubsub.v1 - * @see [google.pubsub.v1.SeekResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto} - */ -const SeekResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v1/doc/google/type/doc_expr.js b/src/v1/doc/google/type/doc_expr.js deleted file mode 100644 index 322889591..000000000 --- a/src/v1/doc/google/type/doc_expr.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. diff --git a/src/v1/index.js b/src/v1/index.js deleted file mode 100644 index d27ad5a62..000000000 --- a/src/v1/index.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -'use strict'; - -const PublisherClient = require('./publisher_client'); -const SubscriberClient = require('./subscriber_client'); - -module.exports.PublisherClient = PublisherClient; -module.exports.SubscriberClient = SubscriberClient; diff --git a/src/v1/doc/google/iam/v1/doc_options.js b/src/v1/index.ts similarity index 65% rename from src/v1/doc/google/iam/v1/doc_options.js rename to src/v1/index.ts index 322889591..e2984775c 100644 --- a/src/v1/doc/google/iam/v1/doc_options.js +++ b/src/v1/index.ts @@ -11,6 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. +export {PublisherClient} from './publisher_client'; +export {SubscriberClient} from './subscriber_client'; diff --git a/src/v1/publisher_client.js b/src/v1/publisher_client.js deleted file mode 100644 index 4410aa5cc..000000000 --- a/src/v1/publisher_client.js +++ /dev/null @@ -1,1221 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -'use strict'; - -const gapicConfig = require('./publisher_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../../package.json').version; - -/** - * The service that an application uses to manipulate topics, and to send - * messages to a topic. - * - * @class - * @memberof v1 - */ -class PublisherClient { - /** - * Construct an instance of PublisherClient. - * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; - } - - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - - // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath - ); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this._pathTemplates = { - projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), - topicPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/topics/{topic}' - ), - }; - - // 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 = { - listTopics: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'topics' - ), - listTopicSubscriptions: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'subscriptions' - ), - }; - - const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); - - // Some methods on this API support automatically batching - // requests; denote this. - this._descriptors.batching = { - publish: new gaxModule.BundleDescriptor( - 'messages', - ['topic'], - 'messageIds', - gax.createByteLengthFunction( - protoFilesRoot.lookup('google.pubsub.v1.PubsubMessage') - ) - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.pubsub.v1.Publisher', - gapicConfig, - opts.clientConfig, - {'x-goog-api-client': clientHeader.join(' ')} - ); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this._innerApiCalls = {}; - - // Put together the "service stub" for - // google.iam.v1.IAMPolicy. - const iamPolicyStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.iam.v1.IAMPolicy') - : protos.google.iam.v1.IAMPolicy, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const iamPolicyStubMethods = [ - 'setIamPolicy', - 'getIamPolicy', - 'testIamPermissions', - ]; - for (const methodName of iamPolicyStubMethods) { - const innerCallPromise = iamPolicyStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.batching[methodName] - ); - } - - // Put together the "service stub" for - // google.pubsub.v1.Publisher. - const publisherStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.pubsub.v1.Publisher') - : protos.google.pubsub.v1.Publisher, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - // note: editing generated code - this.publisherStub = publisherStub; - const publisherStubMethods = [ - 'createTopic', - 'updateTopic', - 'publish', - 'getTopic', - 'listTopics', - 'listTopicSubscriptions', - 'deleteTopic', - ]; - for (const methodName of publisherStubMethods) { - const innerCallPromise = publisherStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.batching[methodName] - ); - } - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'pubsub.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'pubsub.googleapis.com'; - } - - /** - * The port for this API service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/pubsub', - ]; - } - - /** - * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. - */ - getProjectId(callback) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * Creates the given topic with the given name. See the - * - * resource name rules. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the topic. It must have the format - * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, - * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), - * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent - * signs (`%`). It must be between 3 and 255 characters in length, and it - * must not start with `"goog"`. - * @param {Object.} [request.labels] - * See Creating and - * managing labels. - * @param {Object} [request.messageStoragePolicy] - * Policy constraining the set of Google Cloud Platform regions where messages - * published to the topic may be stored. If not present, then no constraints - * are in effect. - * - * This object should have the same structure as [MessageStoragePolicy]{@link google.pubsub.v1.MessageStoragePolicy} - * @param {string} [request.kmsKeyName] - * The resource name of the Cloud KMS CryptoKey to be used to protect access - * to messages published on this topic. - * - * The expected format is `projects/* /locations/* /keyRings/* /cryptoKeys/*`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Topic]{@link google.pubsub.v1.Topic}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Topic]{@link google.pubsub.v1.Topic}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.PublisherClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.topicPath('[PROJECT]', '[TOPIC]'); - * client.createTopic({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createTopic(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.createTopic(request, options, callback); - } - - /** - * Updates an existing topic. Note that certain properties of a - * topic are not modifiable. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.topic - * Required. The updated topic object. - * - * This object should have the same structure as [Topic]{@link google.pubsub.v1.Topic} - * @param {Object} request.updateMask - * Required. Indicates which fields in the provided topic to update. Must be - * specified and non-empty. Note that if `update_mask` contains - * "message_storage_policy" then the new value will be determined based on the - * policy configured at the project or organization level. The - * `message_storage_policy` must not be set in the `topic` provided above. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Topic]{@link google.pubsub.v1.Topic}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Topic]{@link google.pubsub.v1.Topic}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.PublisherClient({ - * // optional auth parameters. - * }); - * - * const topic = {}; - * const updateMask = {}; - * const request = { - * topic: topic, - * updateMask: updateMask, - * }; - * client.updateTopic(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateTopic(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'topic.name': request.topic.name, - }); - - return this._innerApiCalls.updateTopic(request, options, callback); - } - - /** - * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic - * does not exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.topic - * Required. The messages in the request will be published on this topic. - * Format is `projects/{project}/topics/{topic}`. - * @param {Object[]} request.messages - * Required. The messages to publish. - * - * This object should have the same structure as [PubsubMessage]{@link google.pubsub.v1.PubsubMessage} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [PublishResponse]{@link google.pubsub.v1.PublishResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [PublishResponse]{@link google.pubsub.v1.PublishResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.PublisherClient({ - * // optional auth parameters. - * }); - * - * const formattedTopic = client.topicPath('[PROJECT]', '[TOPIC]'); - * const data = Buffer.from(''); - * const messagesElement = { - * data: data, - * }; - * const messages = [messagesElement]; - * const request = { - * topic: formattedTopic, - * messages: messages, - * }; - * client.publish(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - publish(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - topic: request.topic, - }); - - return this._innerApiCalls.publish(request, options, callback); - } - - /** - * Gets the configuration of a topic. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.topic - * Required. The name of the topic to get. - * Format is `projects/{project}/topics/{topic}`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Topic]{@link google.pubsub.v1.Topic}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Topic]{@link google.pubsub.v1.Topic}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.PublisherClient({ - * // optional auth parameters. - * }); - * - * const formattedTopic = client.topicPath('[PROJECT]', '[TOPIC]'); - * client.getTopic({topic: formattedTopic}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getTopic(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - topic: request.topic, - }); - - return this._innerApiCalls.getTopic(request, options, callback); - } - - /** - * Lists matching topics. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.project - * Required. The name of the project in which to list topics. - * Format is `projects/{project-id}`. - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [Topic]{@link google.pubsub.v1.Topic}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListTopicsResponse]{@link google.pubsub.v1.ListTopicsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Topic]{@link google.pubsub.v1.Topic}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Topic]{@link google.pubsub.v1.Topic} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListTopicsResponse]{@link google.pubsub.v1.ListTopicsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.PublisherClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedProject = client.projectPath('[PROJECT]'); - * - * client.listTopics({project: formattedProject}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedProject = client.projectPath('[PROJECT]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listTopics(nextRequest, options).then(callback); - * } - * } - * client.listTopics({project: formattedProject}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listTopics(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - project: request.project, - }); - - return this._innerApiCalls.listTopics(request, options, callback); - } - - /** - * Equivalent to {@link listTopics}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listTopics} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.project - * Required. The name of the project in which to list topics. - * Format is `projects/{project-id}`. - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [Topic]{@link google.pubsub.v1.Topic} on 'data' event. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.PublisherClient({ - * // optional auth parameters. - * }); - * - * const formattedProject = client.projectPath('[PROJECT]'); - * client.listTopicsStream({project: formattedProject}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listTopicsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listTopics.createStream( - this._innerApiCalls.listTopics, - request, - options - ); - } - - /** - * Lists the names of the subscriptions on this topic. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.topic - * Required. The name of the topic that subscriptions are attached to. - * Format is `projects/{project}/topics/{topic}`. - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of string. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListTopicSubscriptionsResponse]{@link google.pubsub.v1.ListTopicSubscriptionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of string. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of string in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListTopicSubscriptionsResponse]{@link google.pubsub.v1.ListTopicSubscriptionsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.PublisherClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedTopic = client.topicPath('[PROJECT]', '[TOPIC]'); - * - * client.listTopicSubscriptions({topic: formattedTopic}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedTopic = client.topicPath('[PROJECT]', '[TOPIC]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listTopicSubscriptions(nextRequest, options).then(callback); - * } - * } - * client.listTopicSubscriptions({topic: formattedTopic}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listTopicSubscriptions(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - topic: request.topic, - }); - - return this._innerApiCalls.listTopicSubscriptions( - request, - options, - callback - ); - } - - /** - * Equivalent to {@link listTopicSubscriptions}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listTopicSubscriptions} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.topic - * Required. The name of the topic that subscriptions are attached to. - * Format is `projects/{project}/topics/{topic}`. - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits a string on 'data' event. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.PublisherClient({ - * // optional auth parameters. - * }); - * - * const formattedTopic = client.topicPath('[PROJECT]', '[TOPIC]'); - * client.listTopicSubscriptionsStream({topic: formattedTopic}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listTopicSubscriptionsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listTopicSubscriptions.createStream( - this._innerApiCalls.listTopicSubscriptions, - request, - options - ); - } - - /** - * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic - * does not exist. After a topic is deleted, a new topic may be created with - * the same name; this is an entirely new topic with none of the old - * configuration or subscriptions. Existing subscriptions to this topic are - * not deleted, but their `topic` field is set to `_deleted-topic_`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.topic - * Required. Name of the topic to delete. - * Format is `projects/{project}/topics/{topic}`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.PublisherClient({ - * // optional auth parameters. - * }); - * - * const formattedTopic = client.topicPath('[PROJECT]', '[TOPIC]'); - * client.deleteTopic({topic: formattedTopic}).catch(err => { - * console.error(err); - * }); - */ - deleteTopic(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - topic: request.topic, - }); - - return this._innerApiCalls.deleteTopic(request, options, callback); - } - - /** - * Sets the access control policy on the specified resource. Replaces - * any existing policy. - * - * Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and - * PERMISSION_DENIED - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {Object} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * - * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.PublisherClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.topicPath('[PROJECT]', '[TOPIC]'); - * const policy = {}; - * const request = { - * resource: formattedResource, - * policy: policy, - * }; - * client.setIamPolicy(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - setIamPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.setIamPolicy(request, options, callback); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.PublisherClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.topicPath('[PROJECT]', '[TOPIC]'); - * client.getIamPolicy({resource: formattedResource}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getIamPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.getIamPolicy(request, options, callback); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.PublisherClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.topicPath('[PROJECT]', '[TOPIC]'); - * const permissions = []; - * const request = { - * resource: formattedResource, - * permissions: permissions, - * }; - * client.testIamPermissions(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - testIamPermissions(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.testIamPermissions(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified project resource name string. - * - * @param {String} project - * @returns {String} - */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Return a fully-qualified topic resource name string. - * - * @param {String} project - * @param {String} topic - * @returns {String} - */ - topicPath(project, topic) { - return this._pathTemplates.topicPathTemplate.render({ - project: project, - topic: topic, - }); - } - - /** - * Terminate the GRPC channel and close the client. - * note: editing generated code - * - * The client will no longer be usable and all future behavior is undefined. - */ - close() { - return this.publisherStub.then(stub => { - stub.close(); - }); - } - - /** - * Parse the projectName from a project resource. - * - * @param {String} projectName - * A fully-qualified path representing a project resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Parse the topicName from a topic resource. - * - * @param {String} topicName - * A fully-qualified path representing a topic resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromTopicName(topicName) { - return this._pathTemplates.topicPathTemplate.match(topicName).project; - } - - /** - * Parse the topicName from a topic resource. - * - * @param {String} topicName - * A fully-qualified path representing a topic resources. - * @returns {String} - A string representing the topic. - */ - matchTopicFromTopicName(topicName) { - return this._pathTemplates.topicPathTemplate.match(topicName).topic; - } -} - -module.exports = PublisherClient; diff --git a/src/v1/publisher_client.ts b/src/v1/publisher_client.ts new file mode 100644 index 000000000..ac9132508 --- /dev/null +++ b/src/v1/publisher_client.ts @@ -0,0 +1,1583 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import * as gapicConfig from './publisher_client_config.json'; +import {IamClient} from '../helper'; + +const version = require('../../../package.json').version; + +/** + * The service that an application uses to manipulate topics, and to send + * messages to a topic. + * @class + * @memberof v1 + */ +export class PublisherClient { + private _terminated = false; + private _iamClient: IamClient; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + publisherStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PublisherClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof PublisherClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof PublisherClient).scopes; + 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; + + this._iamClient = new IamClient(opts); + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectTopicPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/topics/{topic}' + ), + snapshotPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/snapshots/{snapshot}' + ), + subscriptionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/subscriptions/{subscription}' + ), + }; + + // 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 = { + listTopics: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'topics' + ), + listTopicSubscriptions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'subscriptions' + ), + listTopicSnapshots: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'snapshots' + ), + }; + + // 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 protoFilesRoot = opts.fallback + ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); + + // Some methods on this API support automatically batching + // requests; denote this. + + this.descriptors.batching = { + Publish: new this._gaxModule.BundleDescriptor( + 'messages', + ['topic'], + 'message_ids', + gax.createByteLengthFunction( + // tslint:disable-next-line no-any + protoFilesRoot.lookupType('google.pubsub.v1.PubsubMessage') as any + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.pubsub.v1.Publisher', + 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 = {}; + } + + /** + * 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.publisherStub) { + return this.publisherStub; + } + + // Put together the "service stub" for + // google.pubsub.v1.Publisher. + this.publisherStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.pubsub.v1.Publisher' + ) + : // tslint:disable-next-line no-any + (this._protos as any).google.pubsub.v1.Publisher, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const publisherStubMethods = [ + 'createTopic', + 'updateTopic', + 'publish', + 'getTopic', + 'listTopics', + 'listTopicSubscriptions', + 'listTopicSnapshots', + 'deleteTopic', + ]; + for (const methodName of publisherStubMethods) { + const callPromise = this.publisherStub.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 apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.publisherStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'pubsub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'pubsub.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/pubsub', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + createTopic( + request: protos.google.pubsub.v1.ITopic, + options?: gax.CallOptions + ): Promise< + [ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic | undefined, + {} | undefined + ] + >; + createTopic( + request: protos.google.pubsub.v1.ITopic, + options: gax.CallOptions, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic | null | undefined, + {} | null | undefined + > + ): void; + createTopic( + request: protos.google.pubsub.v1.ITopic, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates the given topic with the given name. See the + * + * resource name rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the topic. It must have the format + * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, + * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), + * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent + * signs (`%`). It must be between 3 and 255 characters in length, and it + * must not start with `"goog"`. + * @param {number[]} request.labels + * See Creating and + * managing labels. + * @param {google.pubsub.v1.MessageStoragePolicy} request.messageStoragePolicy + * Policy constraining the set of Google Cloud Platform regions where messages + * published to the topic may be stored. If not present, then no constraints + * are in effect. + * @param {string} request.kmsKeyName + * The resource name of the Cloud KMS CryptoKey to be used to protect access + * to messages published on this topic. + * + * The expected format is `projects/* /locations/* /keyRings/* /cryptoKeys/*`. + * @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 [Topic]{@link google.pubsub.v1.Topic}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createTopic( + request: protos.google.pubsub.v1.ITopic, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.ITopic | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.createTopic(request, options, callback); + } + updateTopic( + request: protos.google.pubsub.v1.IUpdateTopicRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest | undefined, + {} | undefined + ] + >; + updateTopic( + request: protos.google.pubsub.v1.IUpdateTopicRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest | null | undefined, + {} | null | undefined + > + ): void; + updateTopic( + request: protos.google.pubsub.v1.IUpdateTopicRequest, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates an existing topic. Note that certain properties of a + * topic are not modifiable. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.pubsub.v1.Topic} request.topic + * Required. The updated topic object. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Indicates which fields in the provided topic to update. Must be + * specified and non-empty. Note that if `update_mask` contains + * "message_storage_policy" then the new value will be determined based on the + * policy configured at the project or organization level. The + * `message_storage_policy` must not be set in the `topic` provided above. + * @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 [Topic]{@link google.pubsub.v1.Topic}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateTopic( + request: protos.google.pubsub.v1.IUpdateTopicRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IUpdateTopicRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'topic.name': request.topic!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateTopic(request, options, callback); + } + publish( + request: protos.google.pubsub.v1.IPublishRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest | undefined, + {} | undefined + ] + >; + publish( + request: protos.google.pubsub.v1.IPublishRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest | null | undefined, + {} | null | undefined + > + ): void; + publish( + request: protos.google.pubsub.v1.IPublishRequest, + callback: Callback< + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic + * does not exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The messages in the request will be published on this topic. + * Format is `projects/{project}/topics/{topic}`. + * @param {number[]} request.messages + * Required. The messages to publish. + * @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 [PublishResponse]{@link google.pubsub.v1.PublishResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + publish( + request: protos.google.pubsub.v1.IPublishRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.pubsub.v1.IPublishResponse, + protos.google.pubsub.v1.IPublishRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + topic: request.topic || '', + }); + this.initialize(); + return this.innerApiCalls.publish(request, options, callback); + } + getTopic( + request: protos.google.pubsub.v1.IGetTopicRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest | undefined, + {} | undefined + ] + >; + getTopic( + request: protos.google.pubsub.v1.IGetTopicRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest | null | undefined, + {} | null | undefined + > + ): void; + getTopic( + request: protos.google.pubsub.v1.IGetTopicRequest, + callback: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the configuration of a topic. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The name of the topic to get. + * Format is `projects/{project}/topics/{topic}`. + * @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 [Topic]{@link google.pubsub.v1.Topic}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getTopic( + request: protos.google.pubsub.v1.IGetTopicRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.pubsub.v1.ITopic, + protos.google.pubsub.v1.IGetTopicRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + topic: request.topic || '', + }); + this.initialize(); + return this.innerApiCalls.getTopic(request, options, callback); + } + deleteTopic( + request: protos.google.pubsub.v1.IDeleteTopicRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest | undefined, + {} | undefined + ] + >; + deleteTopic( + request: protos.google.pubsub.v1.IDeleteTopicRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteTopic( + request: protos.google.pubsub.v1.IDeleteTopicRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic + * does not exist. After a topic is deleted, a new topic may be created with + * the same name; this is an entirely new topic with none of the old + * configuration or subscriptions. Existing subscriptions to this topic are + * not deleted, but their `topic` field is set to `_deleted-topic_`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. Name of the topic to delete. + * Format is `projects/{project}/topics/{topic}`. + * @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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteTopic( + request: protos.google.pubsub.v1.IDeleteTopicRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteTopicRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + topic: request.topic || '', + }); + this.initialize(); + return this.innerApiCalls.deleteTopic(request, options, callback); + } + + listTopics( + request: protos.google.pubsub.v1.IListTopicsRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.pubsub.v1.ITopic[], + protos.google.pubsub.v1.IListTopicsRequest | null, + protos.google.pubsub.v1.IListTopicsResponse + ] + >; + listTopics( + request: protos.google.pubsub.v1.IListTopicsRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicsRequest, + protos.google.pubsub.v1.IListTopicsResponse | null | undefined, + protos.google.pubsub.v1.ITopic + > + ): void; + listTopics( + request: protos.google.pubsub.v1.IListTopicsRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicsRequest, + protos.google.pubsub.v1.IListTopicsResponse | null | undefined, + protos.google.pubsub.v1.ITopic + > + ): void; + /** + * Lists matching topics. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list topics. + * Format is `projects/{project-id}`. + * @param {number} request.pageSize + * Maximum number of topics to return. + * @param {string} request.pageToken + * The value returned by the last `ListTopicsResponse`; indicates that this is + * a continuation of a prior `ListTopics` call, and that the system should + * return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Topic]{@link google.pubsub.v1.Topic}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Topic]{@link google.pubsub.v1.Topic} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListTopicsRequest]{@link google.pubsub.v1.ListTopicsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListTopicsResponse]{@link google.pubsub.v1.ListTopicsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listTopics( + request: protos.google.pubsub.v1.IListTopicsRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< + protos.google.pubsub.v1.IListTopicsRequest, + protos.google.pubsub.v1.IListTopicsResponse | null | undefined, + protos.google.pubsub.v1.ITopic + >, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListTopicsRequest, + protos.google.pubsub.v1.IListTopicsResponse | null | undefined, + protos.google.pubsub.v1.ITopic + > + ): Promise< + [ + protos.google.pubsub.v1.ITopic[], + protos.google.pubsub.v1.IListTopicsRequest | null, + protos.google.pubsub.v1.IListTopicsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listTopics(request, options, callback); + } + + /** + * Equivalent to {@link listTopics}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listTopics} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list topics. + * Format is `projects/{project-id}`. + * @param {number} request.pageSize + * Maximum number of topics to return. + * @param {string} request.pageToken + * The value returned by the last `ListTopicsResponse`; indicates that this is + * a continuation of a prior `ListTopics` call, and that the system should + * return the next page of data. + * @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 [Topic]{@link google.pubsub.v1.Topic} on 'data' event. + */ + listTopicsStream( + request?: protos.google.pubsub.v1.IListTopicsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listTopics.createStream( + this.innerApiCalls.listTopics as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listTopics}, but 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.project + * Required. The name of the project in which to list topics. + * Format is `projects/{project-id}`. + * @param {number} request.pageSize + * Maximum number of topics to return. + * @param {string} request.pageToken + * The value returned by the last `ListTopicsResponse`; indicates that this is + * a continuation of a prior `ListTopics` call, and that the system should + * return the next page of data. + * @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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listTopicsAsync( + request?: protos.google.pubsub.v1.IListTopicsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listTopics.asyncIterate( + this.innerApiCalls['listTopics'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + listTopicSubscriptions( + request: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + options?: gax.CallOptions + ): Promise< + [ + string[], + protos.google.pubsub.v1.IListTopicSubscriptionsRequest | null, + protos.google.pubsub.v1.IListTopicSubscriptionsResponse + ] + >; + listTopicSubscriptions( + request: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + | protos.google.pubsub.v1.IListTopicSubscriptionsResponse + | null + | undefined, + string + > + ): void; + listTopicSubscriptions( + request: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + | protos.google.pubsub.v1.IListTopicSubscriptionsResponse + | null + | undefined, + string + > + ): void; + /** + * Lists the names of the subscriptions on this topic. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The name of the topic that subscriptions are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} request.pageSize + * Maximum number of subscription names to return. + * @param {string} request.pageToken + * The value returned by the last `ListTopicSubscriptionsResponse`; indicates + * that this is a continuation of a prior `ListTopicSubscriptions` call, and + * that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of string. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of string that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListTopicSubscriptionsRequest]{@link google.pubsub.v1.ListTopicSubscriptionsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListTopicSubscriptionsResponse]{@link google.pubsub.v1.ListTopicSubscriptionsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listTopicSubscriptions( + request: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< + protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + | protos.google.pubsub.v1.IListTopicSubscriptionsResponse + | null + | undefined, + string + >, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + | protos.google.pubsub.v1.IListTopicSubscriptionsResponse + | null + | undefined, + string + > + ): Promise< + [ + string[], + protos.google.pubsub.v1.IListTopicSubscriptionsRequest | null, + protos.google.pubsub.v1.IListTopicSubscriptionsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + topic: request.topic || '', + }); + this.initialize(); + return this.innerApiCalls.listTopicSubscriptions( + request, + options, + callback + ); + } + + /** + * Equivalent to {@link listTopicSubscriptions}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listTopicSubscriptions} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The name of the topic that subscriptions are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} request.pageSize + * Maximum number of subscription names to return. + * @param {string} request.pageToken + * The value returned by the last `ListTopicSubscriptionsResponse`; indicates + * that this is a continuation of a prior `ListTopicSubscriptions` call, and + * that the system should return the next page of data. + * @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 string on 'data' event. + */ + listTopicSubscriptionsStream( + request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + topic: request.topic || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listTopicSubscriptions.createStream( + this.innerApiCalls.listTopicSubscriptions as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listTopicSubscriptions}, but 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.topic + * Required. The name of the topic that subscriptions are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} request.pageSize + * Maximum number of subscription names to return. + * @param {string} request.pageToken + * The value returned by the last `ListTopicSubscriptionsResponse`; indicates + * that this is a continuation of a prior `ListTopicSubscriptions` call, and + * that the system should return the next page of data. + * @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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listTopicSubscriptionsAsync( + request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + topic: request.topic || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listTopicSubscriptions.asyncIterate( + this.innerApiCalls['listTopicSubscriptions'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + listTopicSnapshots( + request: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + options?: gax.CallOptions + ): Promise< + [ + string[], + protos.google.pubsub.v1.IListTopicSnapshotsRequest | null, + protos.google.pubsub.v1.IListTopicSnapshotsResponse + ] + >; + listTopicSnapshots( + request: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicSnapshotsRequest, + protos.google.pubsub.v1.IListTopicSnapshotsResponse | null | undefined, + string + > + ): void; + listTopicSnapshots( + request: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListTopicSnapshotsRequest, + protos.google.pubsub.v1.IListTopicSnapshotsResponse | null | undefined, + string + > + ): void; + /** + * Lists the names of the snapshots on this topic. Snapshots are used in + * Seek + * operations, which allow + * you to manage message acknowledgments in bulk. That is, you can set the + * acknowledgment state of messages in an existing subscription to the state + * captured by a snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The name of the topic that snapshots are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} request.pageSize + * Maximum number of snapshot names to return. + * @param {string} request.pageToken + * The value returned by the last `ListTopicSnapshotsResponse`; indicates + * that this is a continuation of a prior `ListTopicSnapshots` call, and + * that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of string. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of string that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListTopicSnapshotsRequest]{@link google.pubsub.v1.ListTopicSnapshotsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListTopicSnapshotsResponse]{@link google.pubsub.v1.ListTopicSnapshotsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listTopicSnapshots( + request: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< + protos.google.pubsub.v1.IListTopicSnapshotsRequest, + | protos.google.pubsub.v1.IListTopicSnapshotsResponse + | null + | undefined, + string + >, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListTopicSnapshotsRequest, + protos.google.pubsub.v1.IListTopicSnapshotsResponse | null | undefined, + string + > + ): Promise< + [ + string[], + protos.google.pubsub.v1.IListTopicSnapshotsRequest | null, + protos.google.pubsub.v1.IListTopicSnapshotsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + topic: request.topic || '', + }); + this.initialize(); + return this.innerApiCalls.listTopicSnapshots(request, options, callback); + } + + /** + * Equivalent to {@link listTopicSnapshots}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listTopicSnapshots} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.topic + * Required. The name of the topic that snapshots are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} request.pageSize + * Maximum number of snapshot names to return. + * @param {string} request.pageToken + * The value returned by the last `ListTopicSnapshotsResponse`; indicates + * that this is a continuation of a prior `ListTopicSnapshots` call, and + * that the system should return the next page of data. + * @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 string on 'data' event. + */ + listTopicSnapshotsStream( + request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + topic: request.topic || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listTopicSnapshots.createStream( + this.innerApiCalls.listTopicSnapshots as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listTopicSnapshots}, but 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.topic + * Required. The name of the topic that snapshots are attached to. + * Format is `projects/{project}/topics/{topic}`. + * @param {number} request.pageSize + * Maximum number of snapshot names to return. + * @param {string} request.pageToken + * The value returned by the last `ListTopicSnapshotsResponse`; indicates + * that this is a continuation of a prior `ListTopicSnapshots` call, and + * that the system should return the next page of data. + * @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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listTopicSnapshotsAsync( + request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + topic: request.topic || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listTopicSnapshots.asyncIterate( + this.innerApiCalls['listTopicSnapshots'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectTopic resource name string. + * + * @param {string} project + * @param {string} topic + * @returns {string} Resource name string. + */ + projectTopicPath(project: string, topic: string) { + return this.pathTemplates.projectTopicPathTemplate.render({ + project, + topic, + }); + } + + /** + * Parse the project from ProjectTopic resource. + * + * @param {string} projectTopicName + * A fully-qualified path representing project_topic resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTopicName(projectTopicName: string) { + return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName) + .project; + } + + /** + * Parse the topic from ProjectTopic resource. + * + * @param {string} projectTopicName + * A fully-qualified path representing project_topic resource. + * @returns {string} A string representing the topic. + */ + matchTopicFromProjectTopicName(projectTopicName: string) { + return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName) + .topic; + } + + /** + * Return a fully-qualified snapshot resource name string. + * + * @param {string} project + * @param {string} snapshot + * @returns {string} Resource name string. + */ + snapshotPath(project: string, snapshot: string) { + return this.pathTemplates.snapshotPathTemplate.render({ + project, + snapshot, + }); + } + + /** + * Parse the project from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).project; + } + + /** + * Parse the snapshot from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the snapshot. + */ + matchSnapshotFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).snapshot; + } + + /** + * Return a fully-qualified subscription resource name string. + * + * @param {string} project + * @param {string} subscription + * @returns {string} Resource name string. + */ + subscriptionPath(project: string, subscription: string) { + return this.pathTemplates.subscriptionPathTemplate.render({ + project, + subscription, + }); + } + + /** + * Parse the project from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .project; + } + + /** + * Parse the subscription from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the subscription. + */ + matchSubscriptionFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .subscription; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.publisherStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } + /** + * This part will be added into src/v1/key_management_service_client.ts by synth.py. + * KMS service requires IAM client for [setIamPolicy, getIamPolicy, testIamPerssion] methods. + * But we don't support it now in micro-generators for rerouting one service to another and mix them in. + * New feature request link: [https://github.com/googleapis/gapic-generator-typescript/issues/315] + * + * So this is manually written for providing methods to the KMS client. + * IamClient is created for KMS client in the constructor using src/helper.ts. + * [setIamPolicy, getIamPolicy, testIamPerssion] methods are created which is calling the corresponding methods from IamClient in `helper.ts`. + */ + + getIamPolicy( + request: protos.google.iam.v1.GetIamPolicyRequest, + options: gax.CallOptions, + callback: protos.google.iam.v1.IAMPolicy.GetIamPolicyCallback + ) { + return this._iamClient.getIamPolicy(request, options, callback); + } + setIamPolicy( + request: protos.google.iam.v1.SetIamPolicyRequest, + options: gax.CallOptions, + callback: protos.google.iam.v1.IAMPolicy.SetIamPolicyCallback + ) { + return this._iamClient.setIamPolicy(request, options, callback); + } + testIamPermissions( + request: protos.google.iam.v1.TestIamPermissionsRequest, + options: gax.CallOptions, + callback?: protos.google.iam.v1.IAMPolicy.TestIamPermissionsCallback + ) { + return this._iamClient.testIamPermissions(request, options, callback); + } +} diff --git a/src/v1/publisher_client_config.json b/src/v1/publisher_client_config.json index 9b6be0608..57cd43235 100644 --- a/src/v1/publisher_client_config.json +++ b/src/v1/publisher_client_config.json @@ -2,23 +2,27 @@ "interfaces": { "google.pubsub.v1.Publisher": { "retry_codes": { + "non_idempotent": [], "idempotent": [ - "ABORTED", - "UNAVAILABLE", - "UNKNOWN" + "DEADLINE_EXCEEDED", + "UNAVAILABLE" ], - "non_idempotent": [ + "unavailable": [ "UNAVAILABLE" ], - "none": [], - "publish": [ - "ABORTED", + "cancelled_unknown_deadline_exceeded_resource_exhausted_aborted_internal_unavailable": [ "CANCELLED", + "UNKNOWN", "DEADLINE_EXCEEDED", - "INTERNAL", "RESOURCE_EXHAUSTED", - "UNAVAILABLE", - "UNKNOWN" + "ABORTED", + "INTERNAL", + "UNAVAILABLE" + ], + "unknown_aborted_unavailable": [ + "UNKNOWN", + "ABORTED", + "UNAVAILABLE" ] }, "retry_params": { @@ -27,76 +31,56 @@ "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, + "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 - }, - "messaging": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 5000, - "rpc_timeout_multiplier": 1.3, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 } }, "methods": { "CreateTopic": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "UpdateTopic": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "Publish": { - "timeout_millis": 20000, - "retry_codes_name": "publish", - "retry_params_name": "messaging", + "timeout_millis": 60000, + "retry_codes_name": "cancelled_unknown_deadline_exceeded_resource_exhausted_aborted_internal_unavailable", + "retry_params_name": "default", "bundling": { "element_count_threshold": 100, - "element_count_limit": 1000, "request_byte_threshold": 1048576, - "request_byte_limit": 10485760, - "delay_threshold_millis": 10 + "delay_threshold_millis": 10, + "element_count_limit": 1000 } }, "GetTopic": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "unknown_aborted_unavailable", "retry_params_name": "default" }, "ListTopics": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "unknown_aborted_unavailable", "retry_params_name": "default" }, "ListTopicSubscriptions": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteTopic": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "unknown_aborted_unavailable", "retry_params_name": "default" }, - "GetIamPolicy": { + "ListTopicSnapshots": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "unknown_aborted_unavailable", "retry_params_name": "default" }, - "TestIamPermissions": { + "DeleteTopic": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "unavailable", "retry_params_name": "default" } } diff --git a/src/v1/publisher_proto_list.json b/src/v1/publisher_proto_list.json index 6e307cc9f..23484bf66 100644 --- a/src/v1/publisher_proto_list.json +++ b/src/v1/publisher_proto_list.json @@ -1,4 +1,3 @@ [ - "../../protos/google/iam/v1/iam_policy.proto", "../../protos/google/pubsub/v1/pubsub.proto" ] diff --git a/src/v1/subscriber_client.js b/src/v1/subscriber_client.js deleted file mode 100644 index 9fe4a89d8..000000000 --- a/src/v1/subscriber_client.js +++ /dev/null @@ -1,1942 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -'use strict'; - -const gapicConfig = require('./subscriber_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../../package.json').version; - -/** - * The service that an application uses to manipulate subscriptions and to - * consume messages from a subscription via the `Pull` method or by - * establishing a bi-directional stream using the `StreamingPull` method. - * - * @class - * @memberof v1 - */ -class SubscriberClient { - /** - * Construct an instance of SubscriberClient. - * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; - } - - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - - // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath - ); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this._pathTemplates = { - projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), - snapshotPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/snapshots/{snapshot}' - ), - subscriptionPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/subscriptions/{subscription}' - ), - topicPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/topics/{topic}' - ), - }; - - // 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 = { - listSubscriptions: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'subscriptions' - ), - listSnapshots: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'snapshots' - ), - }; - - // Some of the methods on this service provide streaming responses. - // Provide descriptors for these. - this._descriptors.stream = { - streamingPull: new gaxModule.StreamDescriptor( - gax.StreamType.BIDI_STREAMING - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.pubsub.v1.Subscriber', - gapicConfig, - opts.clientConfig, - {'x-goog-api-client': clientHeader.join(' ')} - ); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this._innerApiCalls = {}; - - // Put together the "service stub" for - // google.iam.v1.IAMPolicy. - const iamPolicyStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.iam.v1.IAMPolicy') - : protos.google.iam.v1.IAMPolicy, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const iamPolicyStubMethods = [ - 'setIamPolicy', - 'getIamPolicy', - 'testIamPermissions', - ]; - for (const methodName of iamPolicyStubMethods) { - const innerCallPromise = iamPolicyStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] - ); - } - - // Put together the "service stub" for - // google.pubsub.v1.Subscriber. - const subscriberStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.pubsub.v1.Subscriber') - : protos.google.pubsub.v1.Subscriber, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const subscriberStubMethods = [ - 'createSubscription', - 'getSubscription', - 'updateSubscription', - 'listSubscriptions', - 'deleteSubscription', - 'modifyAckDeadline', - 'acknowledge', - 'pull', - 'streamingPull', - 'modifyPushConfig', - 'listSnapshots', - 'createSnapshot', - 'updateSnapshot', - 'deleteSnapshot', - 'seek', - ]; - for (const methodName of subscriberStubMethods) { - const innerCallPromise = subscriberStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] - ); - } - - // note: editing generated code - this.waitForReady = function(deadline, callback) { - return subscriberStub.then( - stub => stub.waitForReady(deadline, callback), - callback - ); - }; - this.getSubscriberStub = function() { - return subscriberStub; - }; - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'pubsub.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'pubsub.googleapis.com'; - } - - /** - * The port for this API service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/pubsub', - ]; - } - - /** - * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. - */ - getProjectId(callback) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * Creates a subscription to a given topic. See the - * - * resource name rules. - * If the subscription already exists, returns `ALREADY_EXISTS`. - * If the corresponding topic doesn't exist, returns `NOT_FOUND`. - * - * If the name is not provided in the request, the server will assign a random - * name for this subscription on the same project as the topic, conforming - * to the - * [resource name - * format](https://cloud.google.com/pubsub/docs/admin#resource_names). The - * generated name is populated in the returned Subscription object. Note that - * for REST API requests, you must specify a name in the request. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - * start with a letter, and contain only letters (`[A-Za-z]`), numbers - * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - * in length, and it must not start with `"goog"`. - * @param {string} request.topic - * Required. The name of the topic from which this subscription is receiving - * messages. Format is `projects/{project}/topics/{topic}`. The value of this - * field will be `_deleted-topic_` if the topic has been deleted. - * @param {Object} [request.pushConfig] - * If push delivery is used with this subscription, this field is - * used to configure it. An empty `pushConfig` signifies that the subscriber - * will pull and ack messages using API methods. - * - * This object should have the same structure as [PushConfig]{@link google.pubsub.v1.PushConfig} - * @param {number} [request.ackDeadlineSeconds] - * The approximate amount of time (on a best-effort basis) Pub/Sub waits for - * the subscriber to acknowledge receipt before resending the message. In the - * interval after the message is delivered and before it is acknowledged, it - * is considered to be outstanding. During that time period, the - * message will not be redelivered (on a best-effort basis). - * - * For pull subscriptions, this value is used as the initial value for the ack - * deadline. To override this value for a given message, call - * `ModifyAckDeadline` with the corresponding `ack_id` if using - * non-streaming pull or send the `ack_id` in a - * `StreamingModifyAckDeadlineRequest` if using streaming pull. - * The minimum custom deadline you can specify is 10 seconds. - * The maximum custom deadline you can specify is 600 seconds (10 minutes). - * If this parameter is 0, a default value of 10 seconds is used. - * - * For push delivery, this value is also used to set the request timeout for - * the call to the push endpoint. - * - * If the subscriber never acknowledges the message, the Pub/Sub - * system will eventually redeliver the message. - * @param {boolean} [request.retainAckedMessages] - * Indicates whether to retain acknowledged messages. If true, then - * messages are not expunged from the subscription's backlog, even if they are - * acknowledged, until they fall out of the `message_retention_duration` - * window. This must be true if you would like to - * - * Seek to a timestamp. - * @param {Object} [request.messageRetentionDuration] - * How long to retain unacknowledged messages in the subscription's backlog, - * from the moment a message is published. - * If `retain_acked_messages` is true, then this also configures the retention - * of acknowledged messages, and thus configures how far back in time a `Seek` - * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10 - * minutes. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * @param {Object.} [request.labels] - * See Creating and - * managing labels. - * @param {boolean} [request.enableMessageOrdering] - * If true, messages published with the same `ordering_key` in `PubsubMessage` - * will be delivered to the subscribers in the order in which they - * are received by the Pub/Sub system. Otherwise, they may be delivered in - * any order. - * EXPERIMENTAL: This feature is part of a closed alpha release. This - * API might be changed in backward-incompatible ways and is not recommended - * for production use. It is not subject to any SLA or deprecation policy. - * @param {Object} [request.expirationPolicy] - * A policy that specifies the conditions for this subscription's expiration. - * A subscription is considered active as long as any connected subscriber is - * successfully consuming messages from the subscription or is issuing - * operations on the subscription. If `expiration_policy` is not set, a - * *default policy* with `ttl` of 31 days will be used. The minimum allowed - * value for `expiration_policy.ttl` is 1 day. - * - * This object should have the same structure as [ExpirationPolicy]{@link google.pubsub.v1.ExpirationPolicy} - * @param {Object} [request.deadLetterPolicy] - * A policy that specifies the conditions for dead lettering messages in - * this subscription. If dead_letter_policy is not set, dead lettering - * is disabled. - * - * The Cloud Pub/Sub service account associated with this subscriptions's - * parent project (i.e., - * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have - * permission to Acknowledge() messages on this subscription. - * EXPERIMENTAL: This feature is part of a closed alpha release. This - * API might be changed in backward-incompatible ways and is not recommended - * for production use. It is not subject to any SLA or deprecation policy. - * - * This object should have the same structure as [DeadLetterPolicy]{@link google.pubsub.v1.DeadLetterPolicy} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Subscription]{@link google.pubsub.v1.Subscription}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Subscription]{@link google.pubsub.v1.Subscription}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.subscriptionPath('[PROJECT]', '[SUBSCRIPTION]'); - * const formattedTopic = client.topicPath('[PROJECT]', '[TOPIC]'); - * const request = { - * name: formattedName, - * topic: formattedTopic, - * }; - * client.createSubscription(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createSubscription(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.createSubscription(request, options, callback); - } - - /** - * Gets the configuration details of a subscription. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.subscription - * Required. The name of the subscription to get. - * Format is `projects/{project}/subscriptions/{sub}`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Subscription]{@link google.pubsub.v1.Subscription}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Subscription]{@link google.pubsub.v1.Subscription}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const formattedSubscription = client.subscriptionPath('[PROJECT]', '[SUBSCRIPTION]'); - * client.getSubscription({subscription: formattedSubscription}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getSubscription(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - subscription: request.subscription, - }); - - return this._innerApiCalls.getSubscription(request, options, callback); - } - - /** - * Updates an existing subscription. Note that certain properties of a - * subscription, such as its topic, are not modifiable. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.subscription - * Required. The updated subscription object. - * - * This object should have the same structure as [Subscription]{@link google.pubsub.v1.Subscription} - * @param {Object} request.updateMask - * Required. Indicates which fields in the provided subscription to update. - * Must be specified and non-empty. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Subscription]{@link google.pubsub.v1.Subscription}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Subscription]{@link google.pubsub.v1.Subscription}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const ackDeadlineSeconds = 42; - * const subscription = { - * ackDeadlineSeconds: ackDeadlineSeconds, - * }; - * const pathsElement = 'ack_deadline_seconds'; - * const paths = [pathsElement]; - * const updateMask = { - * paths: paths, - * }; - * const request = { - * subscription: subscription, - * updateMask: updateMask, - * }; - * client.updateSubscription(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateSubscription(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'subscription.name': request.subscription.name, - }); - - return this._innerApiCalls.updateSubscription(request, options, callback); - } - - /** - * Lists matching subscriptions. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.project - * Required. The name of the project in which to list subscriptions. - * Format is `projects/{project-id}`. - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [Subscription]{@link google.pubsub.v1.Subscription}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListSubscriptionsResponse]{@link google.pubsub.v1.ListSubscriptionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Subscription]{@link google.pubsub.v1.Subscription}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Subscription]{@link google.pubsub.v1.Subscription} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListSubscriptionsResponse]{@link google.pubsub.v1.ListSubscriptionsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedProject = client.projectPath('[PROJECT]'); - * - * client.listSubscriptions({project: formattedProject}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedProject = client.projectPath('[PROJECT]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listSubscriptions(nextRequest, options).then(callback); - * } - * } - * client.listSubscriptions({project: formattedProject}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listSubscriptions(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - project: request.project, - }); - - return this._innerApiCalls.listSubscriptions(request, options, callback); - } - - /** - * Equivalent to {@link listSubscriptions}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listSubscriptions} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.project - * Required. The name of the project in which to list subscriptions. - * Format is `projects/{project-id}`. - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [Subscription]{@link google.pubsub.v1.Subscription} on 'data' event. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const formattedProject = client.projectPath('[PROJECT]'); - * client.listSubscriptionsStream({project: formattedProject}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listSubscriptionsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listSubscriptions.createStream( - this._innerApiCalls.listSubscriptions, - request, - options - ); - } - - /** - * Deletes an existing subscription. All messages retained in the subscription - * are immediately dropped. Calls to `Pull` after deletion will return - * `NOT_FOUND`. After a subscription is deleted, a new one may be created with - * the same name, but the new one has no association with the old - * subscription or its topic unless the same topic is specified. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.subscription - * Required. The subscription to delete. - * Format is `projects/{project}/subscriptions/{sub}`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const formattedSubscription = client.subscriptionPath('[PROJECT]', '[SUBSCRIPTION]'); - * client.deleteSubscription({subscription: formattedSubscription}).catch(err => { - * console.error(err); - * }); - */ - deleteSubscription(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - subscription: request.subscription, - }); - - return this._innerApiCalls.deleteSubscription(request, options, callback); - } - - /** - * Modifies the ack deadline for a specific message. This method is useful - * to indicate that more time is needed to process a message by the - * subscriber, or to make the message available for redelivery if the - * processing was interrupted. Note that this does not modify the - * subscription-level `ackDeadlineSeconds` used for subsequent messages. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.subscription - * Required. The name of the subscription. - * Format is `projects/{project}/subscriptions/{sub}`. - * @param {string[]} request.ackIds - * Required. List of acknowledgment IDs. - * @param {number} request.ackDeadlineSeconds - * Required. The new ack deadline with respect to the time this request was - * sent to the Pub/Sub system. For example, if the value is 10, the new ack - * deadline will expire 10 seconds after the `ModifyAckDeadline` call was - * made. Specifying zero might immediately make the message available for - * delivery to another subscriber client. This typically results in an - * increase in the rate of message redeliveries (that is, duplicates). - * The minimum deadline you can specify is 0 seconds. - * The maximum deadline you can specify is 600 seconds (10 minutes). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const formattedSubscription = client.subscriptionPath('[PROJECT]', '[SUBSCRIPTION]'); - * const ackIds = []; - * const ackDeadlineSeconds = 0; - * const request = { - * subscription: formattedSubscription, - * ackIds: ackIds, - * ackDeadlineSeconds: ackDeadlineSeconds, - * }; - * client.modifyAckDeadline(request).catch(err => { - * console.error(err); - * }); - */ - modifyAckDeadline(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - subscription: request.subscription, - }); - - return this._innerApiCalls.modifyAckDeadline(request, options, callback); - } - - /** - * Acknowledges the messages associated with the `ack_ids` in the - * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages - * from the subscription. - * - * Acknowledging a message whose ack deadline has expired may succeed, - * but such a message may be redelivered later. Acknowledging a message more - * than once will not result in an error. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.subscription - * Required. The subscription whose message is being acknowledged. - * Format is `projects/{project}/subscriptions/{sub}`. - * @param {string[]} request.ackIds - * Required. The acknowledgment ID for the messages being acknowledged that - * was returned by the Pub/Sub system in the `Pull` response. Must not be - * empty. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const formattedSubscription = client.subscriptionPath('[PROJECT]', '[SUBSCRIPTION]'); - * const ackIds = []; - * const request = { - * subscription: formattedSubscription, - * ackIds: ackIds, - * }; - * client.acknowledge(request).catch(err => { - * console.error(err); - * }); - */ - acknowledge(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - subscription: request.subscription, - }); - - return this._innerApiCalls.acknowledge(request, options, callback); - } - - /** - * Pulls messages from the server. The server may return `UNAVAILABLE` if - * there are too many concurrent pull requests pending for the given - * subscription. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.subscription - * Required. The subscription from which messages should be pulled. - * Format is `projects/{project}/subscriptions/{sub}`. - * @param {number} request.maxMessages - * Required. The maximum number of messages to return for this request. Must - * be a positive integer. The Pub/Sub system may return fewer than the number - * specified. - * @param {boolean} [request.returnImmediately] - * Optional. If this field set to true, the system will respond immediately - * even if it there are no messages available to return in the `Pull` - * response. Otherwise, the system may wait (for a bounded amount of time) - * until at least one message is available, rather than returning no messages. - * Warning: setting this field to `true` is discouraged because it adversely - * impacts the performance of `Pull` operations. We recommend that users do - * not set this field. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [PullResponse]{@link google.pubsub.v1.PullResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [PullResponse]{@link google.pubsub.v1.PullResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const formattedSubscription = client.subscriptionPath('[PROJECT]', '[SUBSCRIPTION]'); - * const maxMessages = 0; - * const request = { - * subscription: formattedSubscription, - * maxMessages: maxMessages, - * }; - * client.pull(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - pull(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - subscription: request.subscription, - }); - - return this._innerApiCalls.pull(request, options, callback); - } - - /** - * Establishes a stream with the server, which sends messages down to the - * client. The client streams acknowledgements and ack deadline modifications - * back to the server. The server will close the stream and return the status - * on any error. The server may close the stream with status `UNAVAILABLE` to - * reassign server-side resources, in which case, the client should - * re-establish the stream. Flow control can be achieved by configuring the - * underlying RPC channel. - * - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which is both readable and writable. It accepts objects - * representing [StreamingPullRequest]{@link google.pubsub.v1.StreamingPullRequest} for write() method, and - * will emit objects representing [StreamingPullResponse]{@link google.pubsub.v1.StreamingPullResponse} on 'data' event asynchronously. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const stream = client.streamingPull().on('data', response => { - * // doThingsWith(response) - * }); - * const formattedSubscription = client.subscriptionPath('[PROJECT]', '[SUBSCRIPTION]'); - * const streamAckDeadlineSeconds = 0; - * const request = { - * subscription: formattedSubscription, - * streamAckDeadlineSeconds: streamAckDeadlineSeconds, - * }; - * // Write request objects. - * stream.write(request); - */ - streamingPull(options) { - options = options || {}; - - return this._innerApiCalls.streamingPull(options); - } - - /** - * Modifies the `PushConfig` for a specified subscription. - * - * This may be used to change a push subscription to a pull one (signified by - * an empty `PushConfig`) or vice versa, or change the endpoint URL and other - * attributes of a push subscription. Messages will accumulate for delivery - * continuously through the call regardless of changes to the `PushConfig`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.subscription - * Required. The name of the subscription. - * Format is `projects/{project}/subscriptions/{sub}`. - * @param {Object} request.pushConfig - * Required. The push configuration for future deliveries. - * - * An empty `pushConfig` indicates that the Pub/Sub system should - * stop pushing messages from the given subscription and allow - * messages to be pulled and acknowledged - effectively pausing - * the subscription if `Pull` or `StreamingPull` is not called. - * - * This object should have the same structure as [PushConfig]{@link google.pubsub.v1.PushConfig} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const formattedSubscription = client.subscriptionPath('[PROJECT]', '[SUBSCRIPTION]'); - * const pushConfig = {}; - * const request = { - * subscription: formattedSubscription, - * pushConfig: pushConfig, - * }; - * client.modifyPushConfig(request).catch(err => { - * console.error(err); - * }); - */ - modifyPushConfig(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - subscription: request.subscription, - }); - - return this._innerApiCalls.modifyPushConfig(request, options, callback); - } - - /** - * Lists the existing snapshots. Snapshots are used in - * Seek - * operations, which allow - * you to manage message acknowledgments in bulk. That is, you can set the - * acknowledgment state of messages in an existing subscription to the state - * captured by a snapshot. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.project - * Required. The name of the project in which to list snapshots. - * Format is `projects/{project-id}`. - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [Snapshot]{@link google.pubsub.v1.Snapshot}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListSnapshotsResponse]{@link google.pubsub.v1.ListSnapshotsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Snapshot]{@link google.pubsub.v1.Snapshot}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Snapshot]{@link google.pubsub.v1.Snapshot} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListSnapshotsResponse]{@link google.pubsub.v1.ListSnapshotsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedProject = client.projectPath('[PROJECT]'); - * - * client.listSnapshots({project: formattedProject}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedProject = client.projectPath('[PROJECT]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listSnapshots(nextRequest, options).then(callback); - * } - * } - * client.listSnapshots({project: formattedProject}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listSnapshots(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - project: request.project, - }); - - return this._innerApiCalls.listSnapshots(request, options, callback); - } - - /** - * Equivalent to {@link listSnapshots}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listSnapshots} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.project - * Required. The name of the project in which to list snapshots. - * Format is `projects/{project-id}`. - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [Snapshot]{@link google.pubsub.v1.Snapshot} on 'data' event. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const formattedProject = client.projectPath('[PROJECT]'); - * client.listSnapshotsStream({project: formattedProject}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listSnapshotsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listSnapshots.createStream( - this._innerApiCalls.listSnapshots, - request, - options - ); - } - - /** - * Creates a snapshot from the requested subscription. Snapshots are used in - * Seek - * operations, which allow - * you to manage message acknowledgments in bulk. That is, you can set the - * acknowledgment state of messages in an existing subscription to the state - * captured by a snapshot. - *

If the snapshot already exists, returns `ALREADY_EXISTS`. - * If the requested subscription doesn't exist, returns `NOT_FOUND`. - * If the backlog in the subscription is too old -- and the resulting snapshot - * would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. - * See also the `Snapshot.expire_time` field. If the name is not provided in - * the request, the server will assign a random - * name for this snapshot on the same project as the subscription, conforming - * to the - * [resource name - * format](https://cloud.google.com/pubsub/docs/admin#resource_names). The - * generated name is populated in the returned Snapshot object. Note that for - * REST API requests, you must specify a name in the request. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. User-provided name for this snapshot. If the name is not provided - * in the request, the server will assign a random name for this snapshot on - * the same project as the subscription. Note that for REST API requests, you - * must specify a name. See the resource - * name rules. Format is `projects/{project}/snapshots/{snap}`. - * @param {string} request.subscription - * Required. The subscription whose backlog the snapshot retains. - * Specifically, the created snapshot is guaranteed to retain: - * (a) The existing backlog on the subscription. More precisely, this is - * defined as the messages in the subscription's backlog that are - * unacknowledged upon the successful completion of the - * `CreateSnapshot` request; as well as: - * (b) Any messages published to the subscription's topic following the - * successful completion of the CreateSnapshot request. - * Format is `projects/{project}/subscriptions/{sub}`. - * @param {Object.} [request.labels] - * See Creating and - * managing labels. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Snapshot]{@link google.pubsub.v1.Snapshot}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Snapshot]{@link google.pubsub.v1.Snapshot}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.snapshotPath('[PROJECT]', '[SNAPSHOT]'); - * const formattedSubscription = client.subscriptionPath('[PROJECT]', '[SUBSCRIPTION]'); - * const request = { - * name: formattedName, - * subscription: formattedSubscription, - * }; - * client.createSnapshot(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createSnapshot(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.createSnapshot(request, options, callback); - } - - /** - * Updates an existing snapshot. Snapshots are used in - * Seek - * operations, which allow - * you to manage message acknowledgments in bulk. That is, you can set the - * acknowledgment state of messages in an existing subscription to the state - * captured by a snapshot. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.snapshot - * Required. The updated snapshot object. - * - * This object should have the same structure as [Snapshot]{@link google.pubsub.v1.Snapshot} - * @param {Object} request.updateMask - * Required. Indicates which fields in the provided snapshot to update. - * Must be specified and non-empty. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Snapshot]{@link google.pubsub.v1.Snapshot}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Snapshot]{@link google.pubsub.v1.Snapshot}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const seconds = 123456; - * const expireTime = { - * seconds: seconds, - * }; - * const snapshot = { - * expireTime: expireTime, - * }; - * const pathsElement = 'expire_time'; - * const paths = [pathsElement]; - * const updateMask = { - * paths: paths, - * }; - * const request = { - * snapshot: snapshot, - * updateMask: updateMask, - * }; - * client.updateSnapshot(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateSnapshot(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'snapshot.name': request.snapshot.name, - }); - - return this._innerApiCalls.updateSnapshot(request, options, callback); - } - - /** - * Removes an existing snapshot. Snapshots are used in - * Seek - * operations, which allow - * you to manage message acknowledgments in bulk. That is, you can set the - * acknowledgment state of messages in an existing subscription to the state - * captured by a snapshot.

- * When the snapshot is deleted, all messages retained in the snapshot - * are immediately dropped. After a snapshot is deleted, a new one may be - * created with the same name, but the new one has no association with the old - * snapshot or its subscription, unless the same subscription is specified. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.snapshot - * Required. The name of the snapshot to delete. - * Format is `projects/{project}/snapshots/{snap}`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const formattedSnapshot = client.snapshotPath('[PROJECT]', '[SNAPSHOT]'); - * client.deleteSnapshot({snapshot: formattedSnapshot}).catch(err => { - * console.error(err); - * }); - */ - deleteSnapshot(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - snapshot: request.snapshot, - }); - - return this._innerApiCalls.deleteSnapshot(request, options, callback); - } - - /** - * Seeks an existing subscription to a point in time or to a given snapshot, - * whichever is provided in the request. Snapshots are used in - * Seek - * operations, which allow - * you to manage message acknowledgments in bulk. That is, you can set the - * acknowledgment state of messages in an existing subscription to the state - * captured by a snapshot. Note that both the subscription and the snapshot - * must be on the same topic. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.subscription - * Required. The subscription to affect. - * @param {Object} [request.time] - * The time to seek to. - * Messages retained in the subscription that were published before this - * time are marked as acknowledged, and messages retained in the - * subscription that were published after this time are marked as - * unacknowledged. Note that this operation affects only those messages - * retained in the subscription (configured by the combination of - * `message_retention_duration` and `retain_acked_messages`). For example, - * if `time` corresponds to a point before the message retention - * window (or to a point before the system's notion of the subscription - * creation time), only retained messages will be marked as unacknowledged, - * and already-expunged messages will not be restored. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {string} [request.snapshot] - * The snapshot to seek to. The snapshot's topic must be the same as that of - * the provided subscription. - * Format is `projects/{project}/snapshots/{snap}`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [SeekResponse]{@link google.pubsub.v1.SeekResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SeekResponse]{@link google.pubsub.v1.SeekResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const formattedSubscription = client.subscriptionPath('[PROJECT]', '[SUBSCRIPTION]'); - * client.seek({subscription: formattedSubscription}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - seek(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - subscription: request.subscription, - }); - - return this._innerApiCalls.seek(request, options, callback); - } - - /** - * Sets the access control policy on the specified resource. Replaces - * any existing policy. - * - * Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and - * PERMISSION_DENIED - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {Object} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * - * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.subscriptionPath('[PROJECT]', '[SUBSCRIPTION]'); - * const policy = {}; - * const request = { - * resource: formattedResource, - * policy: policy, - * }; - * client.setIamPolicy(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - setIamPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.setIamPolicy(request, options, callback); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.subscriptionPath('[PROJECT]', '[SUBSCRIPTION]'); - * client.getIamPolicy({resource: formattedResource}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getIamPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.getIamPolicy(request, options, callback); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const pubsub = require('@google-cloud/pubsub'); - * - * const client = new pubsub.v1.SubscriberClient({ - * // optional auth parameters. - * }); - * - * const formattedResource = client.subscriptionPath('[PROJECT]', '[SUBSCRIPTION]'); - * const permissions = []; - * const request = { - * resource: formattedResource, - * permissions: permissions, - * }; - * client.testIamPermissions(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - testIamPermissions(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - resource: request.resource, - }); - - return this._innerApiCalls.testIamPermissions(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified project resource name string. - * - * @param {String} project - * @returns {String} - */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Return a fully-qualified snapshot resource name string. - * - * @param {String} project - * @param {String} snapshot - * @returns {String} - */ - snapshotPath(project, snapshot) { - return this._pathTemplates.snapshotPathTemplate.render({ - project: project, - snapshot: snapshot, - }); - } - - /** - * Return a fully-qualified subscription resource name string. - * - * @param {String} project - * @param {String} subscription - * @returns {String} - */ - subscriptionPath(project, subscription) { - return this._pathTemplates.subscriptionPathTemplate.render({ - project: project, - subscription: subscription, - }); - } - - /** - * Return a fully-qualified topic resource name string. - * - * @param {String} project - * @param {String} topic - * @returns {String} - */ - topicPath(project, topic) { - return this._pathTemplates.topicPathTemplate.render({ - project: project, - topic: topic, - }); - } - - /** - * Parse the projectName from a project resource. - * - * @param {String} projectName - * A fully-qualified path representing a project resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Parse the snapshotName from a snapshot resource. - * - * @param {String} snapshotName - * A fully-qualified path representing a snapshot resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromSnapshotName(snapshotName) { - return this._pathTemplates.snapshotPathTemplate.match(snapshotName).project; - } - - /** - * Parse the snapshotName from a snapshot resource. - * - * @param {String} snapshotName - * A fully-qualified path representing a snapshot resources. - * @returns {String} - A string representing the snapshot. - */ - matchSnapshotFromSnapshotName(snapshotName) { - return this._pathTemplates.snapshotPathTemplate.match(snapshotName) - .snapshot; - } - - /** - * Parse the subscriptionName from a subscription resource. - * - * @param {String} subscriptionName - * A fully-qualified path representing a subscription resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromSubscriptionName(subscriptionName) { - return this._pathTemplates.subscriptionPathTemplate.match(subscriptionName) - .project; - } - - /** - * Parse the subscriptionName from a subscription resource. - * - * @param {String} subscriptionName - * A fully-qualified path representing a subscription resources. - * @returns {String} - A string representing the subscription. - */ - matchSubscriptionFromSubscriptionName(subscriptionName) { - return this._pathTemplates.subscriptionPathTemplate.match(subscriptionName) - .subscription; - } - - /** - * Parse the topicName from a topic resource. - * - * @param {String} topicName - * A fully-qualified path representing a topic resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromTopicName(topicName) { - return this._pathTemplates.topicPathTemplate.match(topicName).project; - } - - /** - * Parse the topicName from a topic resource. - * - * @param {String} topicName - * A fully-qualified path representing a topic resources. - * @returns {String} - A string representing the topic. - */ - matchTopicFromTopicName(topicName) { - return this._pathTemplates.topicPathTemplate.match(topicName).topic; - } -} - -module.exports = SubscriberClient; diff --git a/src/v1/subscriber_client.ts b/src/v1/subscriber_client.ts new file mode 100644 index 000000000..097a264c4 --- /dev/null +++ b/src/v1/subscriber_client.ts @@ -0,0 +1,2243 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import * as gapicConfig from './subscriber_client_config.json'; +import {IamClient} from '../helper'; + +const version = require('../../../package.json').version; + +/** + * The service that an application uses to manipulate subscriptions and to + * consume messages from a subscription via the `Pull` method or by + * establishing a bi-directional stream using the `StreamingPull` method. + * @class + * @memberof v1 + */ +export class SubscriberClient { + private _terminated = false; + private _iamClient: IamClient; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + subscriberStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SubscriberClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof SubscriberClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof SubscriberClient).scopes; + 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; + + this._iamClient = new IamClient(opts); + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectTopicPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/topics/{topic}' + ), + snapshotPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/snapshots/{snapshot}' + ), + subscriptionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/subscriptions/{subscription}' + ), + }; + + // 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 = { + listSubscriptions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'subscriptions' + ), + listSnapshots: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'snapshots' + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + streamingPull: new this._gaxModule.StreamDescriptor( + gax.StreamType.BIDI_STREAMING + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.pubsub.v1.Subscriber', + 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 = {}; + } + + /** + * 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.subscriberStub) { + return this.subscriberStub; + } + + // Put together the "service stub" for + // google.pubsub.v1.Subscriber. + this.subscriberStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.pubsub.v1.Subscriber' + ) + : // tslint:disable-next-line no-any + (this._protos as any).google.pubsub.v1.Subscriber, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const subscriberStubMethods = [ + 'createSubscription', + 'getSubscription', + 'updateSubscription', + 'listSubscriptions', + 'deleteSubscription', + 'modifyAckDeadline', + 'acknowledge', + 'pull', + 'streamingPull', + 'modifyPushConfig', + 'getSnapshot', + 'listSnapshots', + 'createSnapshot', + 'updateSnapshot', + 'deleteSnapshot', + 'seek', + ]; + for (const methodName of subscriberStubMethods) { + const callPromise = this.subscriberStub.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 apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.subscriberStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'pubsub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'pubsub.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/pubsub', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + createSubscription( + request: protos.google.pubsub.v1.ISubscription, + options?: gax.CallOptions + ): Promise< + [ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription | undefined, + {} | undefined + ] + >; + createSubscription( + request: protos.google.pubsub.v1.ISubscription, + options: gax.CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription | null | undefined, + {} | null | undefined + > + ): void; + createSubscription( + request: protos.google.pubsub.v1.ISubscription, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a subscription to a given topic. See the + * + * resource name rules. + * If the subscription already exists, returns `ALREADY_EXISTS`. + * If the corresponding topic doesn't exist, returns `NOT_FOUND`. + * + * If the name is not provided in the request, the server will assign a random + * name for this subscription on the same project as the topic, conforming + * to the + * [resource name + * format](https://cloud.google.com/pubsub/docs/admin#resource_names). The + * generated name is populated in the returned Subscription object. Note that + * for REST API requests, you must specify a name in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the subscription. It must have the format + * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + * start with a letter, and contain only letters (`[A-Za-z]`), numbers + * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + * in length, and it must not start with `"goog"`. + * @param {string} request.topic + * Required. The name of the topic from which this subscription is receiving + * messages. Format is `projects/{project}/topics/{topic}`. The value of this + * field will be `_deleted-topic_` if the topic has been deleted. + * @param {google.pubsub.v1.PushConfig} request.pushConfig + * If push delivery is used with this subscription, this field is + * used to configure it. An empty `pushConfig` signifies that the subscriber + * will pull and ack messages using API methods. + * @param {number} request.ackDeadlineSeconds + * The approximate amount of time (on a best-effort basis) Pub/Sub waits for + * the subscriber to acknowledge receipt before resending the message. In the + * interval after the message is delivered and before it is acknowledged, it + * is considered to be outstanding. During that time period, the + * message will not be redelivered (on a best-effort basis). + * + * For pull subscriptions, this value is used as the initial value for the ack + * deadline. To override this value for a given message, call + * `ModifyAckDeadline` with the corresponding `ack_id` if using + * non-streaming pull or send the `ack_id` in a + * `StreamingModifyAckDeadlineRequest` if using streaming pull. + * The minimum custom deadline you can specify is 10 seconds. + * The maximum custom deadline you can specify is 600 seconds (10 minutes). + * If this parameter is 0, a default value of 10 seconds is used. + * + * For push delivery, this value is also used to set the request timeout for + * the call to the push endpoint. + * + * If the subscriber never acknowledges the message, the Pub/Sub + * system will eventually redeliver the message. + * @param {boolean} request.retainAckedMessages + * Indicates whether to retain acknowledged messages. If true, then + * messages are not expunged from the subscription's backlog, even if they are + * acknowledged, until they fall out of the `message_retention_duration` + * window. This must be true if you would like to + * + * Seek to a timestamp. + * @param {google.protobuf.Duration} request.messageRetentionDuration + * How long to retain unacknowledged messages in the subscription's backlog, + * from the moment a message is published. + * If `retain_acked_messages` is true, then this also configures the retention + * of acknowledged messages, and thus configures how far back in time a `Seek` + * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10 + * minutes. + * @param {number[]} request.labels + * See Creating and + * managing labels. + * @param {boolean} request.enableMessageOrdering + * If true, messages published with the same `ordering_key` in `PubsubMessage` + * will be delivered to the subscribers in the order in which they + * are received by the Pub/Sub system. Otherwise, they may be delivered in + * any order. + * EXPERIMENTAL: This feature is part of a closed alpha release. This + * API might be changed in backward-incompatible ways and is not recommended + * for production use. It is not subject to any SLA or deprecation policy. + * @param {google.pubsub.v1.ExpirationPolicy} request.expirationPolicy + * A policy that specifies the conditions for this subscription's expiration. + * A subscription is considered active as long as any connected subscriber is + * successfully consuming messages from the subscription or is issuing + * operations on the subscription. If `expiration_policy` is not set, a + * *default policy* with `ttl` of 31 days will be used. The minimum allowed + * value for `expiration_policy.ttl` is 1 day. + * @param {string} request.filter + * An expression written in the Cloud Pub/Sub filter language. If non-empty, + * then only `PubsubMessage`s whose `attributes` field matches the filter are + * delivered on this subscription. If empty, then no messages are filtered + * out. + * EXPERIMENTAL: This feature is part of a closed alpha release. This + * API might be changed in backward-incompatible ways and is not recommended + * for production use. It is not subject to any SLA or deprecation policy. + * @param {google.pubsub.v1.DeadLetterPolicy} request.deadLetterPolicy + * A policy that specifies the conditions for dead lettering messages in + * this subscription. If dead_letter_policy is not set, dead lettering + * is disabled. + * + * The Cloud Pub/Sub service account associated with this subscriptions's + * parent project (i.e., + * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have + * permission to Acknowledge() messages on this subscription. + * EXPERIMENTAL: This feature is part of a closed alpha release. This + * API might be changed in backward-incompatible ways and is not recommended + * for production use. It is not subject to any SLA or deprecation policy. + * @param {google.pubsub.v1.RetryPolicy} request.retryPolicy + * A policy that specifies how Cloud Pub/Sub retries message delivery for this + * subscription. + * + * If not set, the default retry policy is applied. This generally implies + * that messages will be retried as soon as possible for healthy subscribers. + * RetryPolicy will be triggered on NACKs or acknowledgement deadline + * exceeded events for a given message. + * EXPERIMENTAL: This API might be changed in backward-incompatible + * ways and is not recommended for production use. It is not subject to any + * SLA or deprecation policy. + * @param {object} [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 [Subscription]{@link google.pubsub.v1.Subscription}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createSubscription( + request: protos.google.pubsub.v1.ISubscription, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.ISubscription | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.createSubscription(request, options, callback); + } + getSubscription( + request: protos.google.pubsub.v1.IGetSubscriptionRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest | undefined, + {} | undefined + ] + >; + getSubscription( + request: protos.google.pubsub.v1.IGetSubscriptionRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest | null | undefined, + {} | null | undefined + > + ): void; + getSubscription( + request: protos.google.pubsub.v1.IGetSubscriptionRequest, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the configuration details of a subscription. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The name of the subscription to get. + * Format is `projects/{project}/subscriptions/{sub}`. + * @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 [Subscription]{@link google.pubsub.v1.Subscription}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getSubscription( + request: protos.google.pubsub.v1.IGetSubscriptionRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IGetSubscriptionRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + subscription: request.subscription || '', + }); + this.initialize(); + return this.innerApiCalls.getSubscription(request, options, callback); + } + updateSubscription( + request: protos.google.pubsub.v1.IUpdateSubscriptionRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest | undefined, + {} | undefined + ] + >; + updateSubscription( + request: protos.google.pubsub.v1.IUpdateSubscriptionRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest | null | undefined, + {} | null | undefined + > + ): void; + updateSubscription( + request: protos.google.pubsub.v1.IUpdateSubscriptionRequest, + callback: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates an existing subscription. Note that certain properties of a + * subscription, such as its topic, are not modifiable. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.pubsub.v1.Subscription} request.subscription + * Required. The updated subscription object. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Indicates which fields in the provided subscription to update. + * Must be specified and non-empty. + * @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 [Subscription]{@link google.pubsub.v1.Subscription}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateSubscription( + request: protos.google.pubsub.v1.IUpdateSubscriptionRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.pubsub.v1.ISubscription, + protos.google.pubsub.v1.IUpdateSubscriptionRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'subscription.name': request.subscription!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateSubscription(request, options, callback); + } + deleteSubscription( + request: protos.google.pubsub.v1.IDeleteSubscriptionRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest | undefined, + {} | undefined + ] + >; + deleteSubscription( + request: protos.google.pubsub.v1.IDeleteSubscriptionRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteSubscription( + request: protos.google.pubsub.v1.IDeleteSubscriptionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes an existing subscription. All messages retained in the subscription + * are immediately dropped. Calls to `Pull` after deletion will return + * `NOT_FOUND`. After a subscription is deleted, a new one may be created with + * the same name, but the new one has no association with the old + * subscription or its topic unless the same topic is specified. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The subscription to delete. + * Format is `projects/{project}/subscriptions/{sub}`. + * @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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteSubscription( + request: protos.google.pubsub.v1.IDeleteSubscriptionRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSubscriptionRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + subscription: request.subscription || '', + }); + this.initialize(); + return this.innerApiCalls.deleteSubscription(request, options, callback); + } + modifyAckDeadline( + request: protos.google.pubsub.v1.IModifyAckDeadlineRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest | undefined, + {} | undefined + ] + >; + modifyAckDeadline( + request: protos.google.pubsub.v1.IModifyAckDeadlineRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest | null | undefined, + {} | null | undefined + > + ): void; + modifyAckDeadline( + request: protos.google.pubsub.v1.IModifyAckDeadlineRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Modifies the ack deadline for a specific message. This method is useful + * to indicate that more time is needed to process a message by the + * subscriber, or to make the message available for redelivery if the + * processing was interrupted. Note that this does not modify the + * subscription-level `ackDeadlineSeconds` used for subsequent messages. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The name of the subscription. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {string[]} request.ackIds + * Required. List of acknowledgment IDs. + * @param {number} request.ackDeadlineSeconds + * Required. The new ack deadline with respect to the time this request was + * sent to the Pub/Sub system. For example, if the value is 10, the new ack + * deadline will expire 10 seconds after the `ModifyAckDeadline` call was + * made. Specifying zero might immediately make the message available for + * delivery to another subscriber client. This typically results in an + * increase in the rate of message redeliveries (that is, duplicates). + * The minimum deadline you can specify is 0 seconds. + * The maximum deadline you can specify is 600 seconds (10 minutes). + * @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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + modifyAckDeadline( + request: protos.google.pubsub.v1.IModifyAckDeadlineRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyAckDeadlineRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + subscription: request.subscription || '', + }); + this.initialize(); + return this.innerApiCalls.modifyAckDeadline(request, options, callback); + } + acknowledge( + request: protos.google.pubsub.v1.IAcknowledgeRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest | undefined, + {} | undefined + ] + >; + acknowledge( + request: protos.google.pubsub.v1.IAcknowledgeRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest | null | undefined, + {} | null | undefined + > + ): void; + acknowledge( + request: protos.google.pubsub.v1.IAcknowledgeRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Acknowledges the messages associated with the `ack_ids` in the + * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages + * from the subscription. + * + * Acknowledging a message whose ack deadline has expired may succeed, + * but such a message may be redelivered later. Acknowledging a message more + * than once will not result in an error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The subscription whose message is being acknowledged. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {string[]} request.ackIds + * Required. The acknowledgment ID for the messages being acknowledged that + * was returned by the Pub/Sub system in the `Pull` response. Must not be + * empty. + * @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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + acknowledge( + request: protos.google.pubsub.v1.IAcknowledgeRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IAcknowledgeRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + subscription: request.subscription || '', + }); + this.initialize(); + return this.innerApiCalls.acknowledge(request, options, callback); + } + pull( + request: protos.google.pubsub.v1.IPullRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest | undefined, + {} | undefined + ] + >; + pull( + request: protos.google.pubsub.v1.IPullRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest | null | undefined, + {} | null | undefined + > + ): void; + pull( + request: protos.google.pubsub.v1.IPullRequest, + callback: Callback< + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Pulls messages from the server. The server may return `UNAVAILABLE` if + * there are too many concurrent pull requests pending for the given + * subscription. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The subscription from which messages should be pulled. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {boolean} [request.returnImmediately] + * Optional. If this field set to true, the system will respond immediately + * even if it there are no messages available to return in the `Pull` + * response. Otherwise, the system may wait (for a bounded amount of time) + * until at least one message is available, rather than returning no messages. + * Warning: setting this field to `true` is discouraged because it adversely + * impacts the performance of `Pull` operations. We recommend that users do + * not set this field. + * @param {number} request.maxMessages + * Required. The maximum number of messages to return for this request. Must + * be a positive integer. The Pub/Sub system may return fewer than the number + * specified. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PullResponse]{@link google.pubsub.v1.PullResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + pull( + request: protos.google.pubsub.v1.IPullRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.pubsub.v1.IPullResponse, + protos.google.pubsub.v1.IPullRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + subscription: request.subscription || '', + }); + this.initialize(); + return this.innerApiCalls.pull(request, options, callback); + } + modifyPushConfig( + request: protos.google.pubsub.v1.IModifyPushConfigRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest | undefined, + {} | undefined + ] + >; + modifyPushConfig( + request: protos.google.pubsub.v1.IModifyPushConfigRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest | null | undefined, + {} | null | undefined + > + ): void; + modifyPushConfig( + request: protos.google.pubsub.v1.IModifyPushConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Modifies the `PushConfig` for a specified subscription. + * + * This may be used to change a push subscription to a pull one (signified by + * an empty `PushConfig`) or vice versa, or change the endpoint URL and other + * attributes of a push subscription. Messages will accumulate for delivery + * continuously through the call regardless of changes to the `PushConfig`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The name of the subscription. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {google.pubsub.v1.PushConfig} request.pushConfig + * Required. The push configuration for future deliveries. + * + * An empty `pushConfig` indicates that the Pub/Sub system should + * stop pushing messages from the given subscription and allow + * messages to be pulled and acknowledged - effectively pausing + * the subscription if `Pull` or `StreamingPull` is not called. + * @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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + modifyPushConfig( + request: protos.google.pubsub.v1.IModifyPushConfigRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IModifyPushConfigRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + subscription: request.subscription || '', + }); + this.initialize(); + return this.innerApiCalls.modifyPushConfig(request, options, callback); + } + getSnapshot( + request: protos.google.pubsub.v1.IGetSnapshotRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest | undefined, + {} | undefined + ] + >; + getSnapshot( + request: protos.google.pubsub.v1.IGetSnapshotRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest | null | undefined, + {} | null | undefined + > + ): void; + getSnapshot( + request: protos.google.pubsub.v1.IGetSnapshotRequest, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the configuration details of a snapshot. Snapshots are used in + * Seek + * operations, which allow you to manage message acknowledgments in bulk. That + * is, you can set the acknowledgment state of messages in an existing + * subscription to the state captured by a snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.snapshot + * Required. The name of the snapshot to get. + * Format is `projects/{project}/snapshots/{snap}`. + * @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 [Snapshot]{@link google.pubsub.v1.Snapshot}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getSnapshot( + request: protos.google.pubsub.v1.IGetSnapshotRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IGetSnapshotRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + snapshot: request.snapshot || '', + }); + this.initialize(); + return this.innerApiCalls.getSnapshot(request, options, callback); + } + createSnapshot( + request: protos.google.pubsub.v1.ICreateSnapshotRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest | undefined, + {} | undefined + ] + >; + createSnapshot( + request: protos.google.pubsub.v1.ICreateSnapshotRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest | null | undefined, + {} | null | undefined + > + ): void; + createSnapshot( + request: protos.google.pubsub.v1.ICreateSnapshotRequest, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a snapshot from the requested subscription. Snapshots are used in + * Seek + * operations, which allow + * you to manage message acknowledgments in bulk. That is, you can set the + * acknowledgment state of messages in an existing subscription to the state + * captured by a snapshot. + *

If the snapshot already exists, returns `ALREADY_EXISTS`. + * If the requested subscription doesn't exist, returns `NOT_FOUND`. + * If the backlog in the subscription is too old -- and the resulting snapshot + * would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. + * See also the `Snapshot.expire_time` field. If the name is not provided in + * the request, the server will assign a random + * name for this snapshot on the same project as the subscription, conforming + * to the + * [resource name + * format](https://cloud.google.com/pubsub/docs/admin#resource_names). The + * generated name is populated in the returned Snapshot object. Note that for + * REST API requests, you must specify a name in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. User-provided name for this snapshot. If the name is not provided + * in the request, the server will assign a random name for this snapshot on + * the same project as the subscription. Note that for REST API requests, you + * must specify a name. See the resource + * name rules. Format is `projects/{project}/snapshots/{snap}`. + * @param {string} request.subscription + * Required. The subscription whose backlog the snapshot retains. + * Specifically, the created snapshot is guaranteed to retain: + * (a) The existing backlog on the subscription. More precisely, this is + * defined as the messages in the subscription's backlog that are + * unacknowledged upon the successful completion of the + * `CreateSnapshot` request; as well as: + * (b) Any messages published to the subscription's topic following the + * successful completion of the CreateSnapshot request. + * Format is `projects/{project}/subscriptions/{sub}`. + * @param {number[]} request.labels + * See Creating and + * managing labels. + * @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 [Snapshot]{@link google.pubsub.v1.Snapshot}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createSnapshot( + request: protos.google.pubsub.v1.ICreateSnapshotRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.ICreateSnapshotRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.createSnapshot(request, options, callback); + } + updateSnapshot( + request: protos.google.pubsub.v1.IUpdateSnapshotRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest | undefined, + {} | undefined + ] + >; + updateSnapshot( + request: protos.google.pubsub.v1.IUpdateSnapshotRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest | null | undefined, + {} | null | undefined + > + ): void; + updateSnapshot( + request: protos.google.pubsub.v1.IUpdateSnapshotRequest, + callback: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates an existing snapshot. Snapshots are used in + * Seek + * operations, which allow + * you to manage message acknowledgments in bulk. That is, you can set the + * acknowledgment state of messages in an existing subscription to the state + * captured by a snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.pubsub.v1.Snapshot} request.snapshot + * Required. The updated snapshot object. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Indicates which fields in the provided snapshot to update. + * Must be specified and non-empty. + * @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 [Snapshot]{@link google.pubsub.v1.Snapshot}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateSnapshot( + request: protos.google.pubsub.v1.IUpdateSnapshotRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.pubsub.v1.ISnapshot, + protos.google.pubsub.v1.IUpdateSnapshotRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'snapshot.name': request.snapshot!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateSnapshot(request, options, callback); + } + deleteSnapshot( + request: protos.google.pubsub.v1.IDeleteSnapshotRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest | undefined, + {} | undefined + ] + >; + deleteSnapshot( + request: protos.google.pubsub.v1.IDeleteSnapshotRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteSnapshot( + request: protos.google.pubsub.v1.IDeleteSnapshotRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Removes an existing snapshot. Snapshots are used in + * Seek + * operations, which allow + * you to manage message acknowledgments in bulk. That is, you can set the + * acknowledgment state of messages in an existing subscription to the state + * captured by a snapshot.

+ * When the snapshot is deleted, all messages retained in the snapshot + * are immediately dropped. After a snapshot is deleted, a new one may be + * created with the same name, but the new one has no association with the old + * snapshot or its subscription, unless the same subscription is specified. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.snapshot + * Required. The name of the snapshot to delete. + * Format is `projects/{project}/snapshots/{snap}`. + * @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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteSnapshot( + request: protos.google.pubsub.v1.IDeleteSnapshotRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.pubsub.v1.IDeleteSnapshotRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + snapshot: request.snapshot || '', + }); + this.initialize(); + return this.innerApiCalls.deleteSnapshot(request, options, callback); + } + seek( + request: protos.google.pubsub.v1.ISeekRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest | undefined, + {} | undefined + ] + >; + seek( + request: protos.google.pubsub.v1.ISeekRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest | null | undefined, + {} | null | undefined + > + ): void; + seek( + request: protos.google.pubsub.v1.ISeekRequest, + callback: Callback< + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Seeks an existing subscription to a point in time or to a given snapshot, + * whichever is provided in the request. Snapshots are used in + * Seek + * operations, which allow + * you to manage message acknowledgments in bulk. That is, you can set the + * acknowledgment state of messages in an existing subscription to the state + * captured by a snapshot. Note that both the subscription and the snapshot + * must be on the same topic. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.subscription + * Required. The subscription to affect. + * @param {google.protobuf.Timestamp} request.time + * The time to seek to. + * Messages retained in the subscription that were published before this + * time are marked as acknowledged, and messages retained in the + * subscription that were published after this time are marked as + * unacknowledged. Note that this operation affects only those messages + * retained in the subscription (configured by the combination of + * `message_retention_duration` and `retain_acked_messages`). For example, + * if `time` corresponds to a point before the message retention + * window (or to a point before the system's notion of the subscription + * creation time), only retained messages will be marked as unacknowledged, + * and already-expunged messages will not be restored. + * @param {string} request.snapshot + * The snapshot to seek to. The snapshot's topic must be the same as that of + * the provided subscription. + * Format is `projects/{project}/snapshots/{snap}`. + * @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 [SeekResponse]{@link google.pubsub.v1.SeekResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + seek( + request: protos.google.pubsub.v1.ISeekRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.pubsub.v1.ISeekResponse, + protos.google.pubsub.v1.ISeekRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + subscription: request.subscription || '', + }); + this.initialize(); + return this.innerApiCalls.seek(request, options, callback); + } + + /** + * Establishes a stream with the server, which sends messages down to the + * client. The client streams acknowledgements and ack deadline modifications + * back to the server. The server will close the stream and return the status + * on any error. The server may close the stream with status `UNAVAILABLE` to + * reassign server-side resources, in which case, the client should + * re-establish the stream. Flow control can be achieved by configuring the + * underlying RPC channel. + * + * @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 is both readable and writable. It accepts objects + * representing [StreamingPullRequest]{@link google.pubsub.v1.StreamingPullRequest} for write() method, and + * will emit objects representing [StreamingPullResponse]{@link google.pubsub.v1.StreamingPullResponse} on 'data' event asynchronously. + */ + streamingPull(options?: gax.CallOptions): gax.CancellableStream { + this.initialize(); + return this.innerApiCalls.streamingPull(options); + } + + listSubscriptions( + request: protos.google.pubsub.v1.IListSubscriptionsRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.pubsub.v1.ISubscription[], + protos.google.pubsub.v1.IListSubscriptionsRequest | null, + protos.google.pubsub.v1.IListSubscriptionsResponse + ] + >; + listSubscriptions( + request: protos.google.pubsub.v1.IListSubscriptionsRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSubscriptionsRequest, + protos.google.pubsub.v1.IListSubscriptionsResponse | null | undefined, + protos.google.pubsub.v1.ISubscription + > + ): void; + listSubscriptions( + request: protos.google.pubsub.v1.IListSubscriptionsRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSubscriptionsRequest, + protos.google.pubsub.v1.IListSubscriptionsResponse | null | undefined, + protos.google.pubsub.v1.ISubscription + > + ): void; + /** + * Lists matching subscriptions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list subscriptions. + * Format is `projects/{project-id}`. + * @param {number} request.pageSize + * Maximum number of subscriptions to return. + * @param {string} request.pageToken + * The value returned by the last `ListSubscriptionsResponse`; indicates that + * this is a continuation of a prior `ListSubscriptions` call, and that the + * system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Subscription]{@link google.pubsub.v1.Subscription}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Subscription]{@link google.pubsub.v1.Subscription} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListSubscriptionsRequest]{@link google.pubsub.v1.ListSubscriptionsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListSubscriptionsResponse]{@link google.pubsub.v1.ListSubscriptionsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listSubscriptions( + request: protos.google.pubsub.v1.IListSubscriptionsRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< + protos.google.pubsub.v1.IListSubscriptionsRequest, + protos.google.pubsub.v1.IListSubscriptionsResponse | null | undefined, + protos.google.pubsub.v1.ISubscription + >, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListSubscriptionsRequest, + protos.google.pubsub.v1.IListSubscriptionsResponse | null | undefined, + protos.google.pubsub.v1.ISubscription + > + ): Promise< + [ + protos.google.pubsub.v1.ISubscription[], + protos.google.pubsub.v1.IListSubscriptionsRequest | null, + protos.google.pubsub.v1.IListSubscriptionsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listSubscriptions(request, options, callback); + } + + /** + * Equivalent to {@link listSubscriptions}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listSubscriptions} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list subscriptions. + * Format is `projects/{project-id}`. + * @param {number} request.pageSize + * Maximum number of subscriptions to return. + * @param {string} request.pageToken + * The value returned by the last `ListSubscriptionsResponse`; indicates that + * this is a continuation of a prior `ListSubscriptions` call, and that the + * system should return the next page of data. + * @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 [Subscription]{@link google.pubsub.v1.Subscription} on 'data' event. + */ + listSubscriptionsStream( + request?: protos.google.pubsub.v1.IListSubscriptionsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listSubscriptions.createStream( + this.innerApiCalls.listSubscriptions as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listSubscriptions}, but 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.project + * Required. The name of the project in which to list subscriptions. + * Format is `projects/{project-id}`. + * @param {number} request.pageSize + * Maximum number of subscriptions to return. + * @param {string} request.pageToken + * The value returned by the last `ListSubscriptionsResponse`; indicates that + * this is a continuation of a prior `ListSubscriptions` call, and that the + * system should return the next page of data. + * @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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listSubscriptionsAsync( + request?: protos.google.pubsub.v1.IListSubscriptionsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listSubscriptions.asyncIterate( + this.innerApiCalls['listSubscriptions'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + listSnapshots( + request: protos.google.pubsub.v1.IListSnapshotsRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.pubsub.v1.ISnapshot[], + protos.google.pubsub.v1.IListSnapshotsRequest | null, + protos.google.pubsub.v1.IListSnapshotsResponse + ] + >; + listSnapshots( + request: protos.google.pubsub.v1.IListSnapshotsRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSnapshotsRequest, + protos.google.pubsub.v1.IListSnapshotsResponse | null | undefined, + protos.google.pubsub.v1.ISnapshot + > + ): void; + listSnapshots( + request: protos.google.pubsub.v1.IListSnapshotsRequest, + callback: PaginationCallback< + protos.google.pubsub.v1.IListSnapshotsRequest, + protos.google.pubsub.v1.IListSnapshotsResponse | null | undefined, + protos.google.pubsub.v1.ISnapshot + > + ): void; + /** + * Lists the existing snapshots. Snapshots are used in + * Seek + * operations, which allow + * you to manage message acknowledgments in bulk. That is, you can set the + * acknowledgment state of messages in an existing subscription to the state + * captured by a snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list snapshots. + * Format is `projects/{project-id}`. + * @param {number} request.pageSize + * Maximum number of snapshots to return. + * @param {string} request.pageToken + * The value returned by the last `ListSnapshotsResponse`; indicates that this + * is a continuation of a prior `ListSnapshots` call, and that the system + * should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Snapshot]{@link google.pubsub.v1.Snapshot}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Snapshot]{@link google.pubsub.v1.Snapshot} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListSnapshotsRequest]{@link google.pubsub.v1.ListSnapshotsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListSnapshotsResponse]{@link google.pubsub.v1.ListSnapshotsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listSnapshots( + request: protos.google.pubsub.v1.IListSnapshotsRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< + protos.google.pubsub.v1.IListSnapshotsRequest, + protos.google.pubsub.v1.IListSnapshotsResponse | null | undefined, + protos.google.pubsub.v1.ISnapshot + >, + callback?: PaginationCallback< + protos.google.pubsub.v1.IListSnapshotsRequest, + protos.google.pubsub.v1.IListSnapshotsResponse | null | undefined, + protos.google.pubsub.v1.ISnapshot + > + ): Promise< + [ + protos.google.pubsub.v1.ISnapshot[], + protos.google.pubsub.v1.IListSnapshotsRequest | null, + protos.google.pubsub.v1.IListSnapshotsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listSnapshots(request, options, callback); + } + + /** + * Equivalent to {@link listSnapshots}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listSnapshots} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. The name of the project in which to list snapshots. + * Format is `projects/{project-id}`. + * @param {number} request.pageSize + * Maximum number of snapshots to return. + * @param {string} request.pageToken + * The value returned by the last `ListSnapshotsResponse`; indicates that this + * is a continuation of a prior `ListSnapshots` call, and that the system + * should return the next page of data. + * @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 [Snapshot]{@link google.pubsub.v1.Snapshot} on 'data' event. + */ + listSnapshotsStream( + request?: protos.google.pubsub.v1.IListSnapshotsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listSnapshots.createStream( + this.innerApiCalls.listSnapshots as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listSnapshots}, but 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.project + * Required. The name of the project in which to list snapshots. + * Format is `projects/{project-id}`. + * @param {number} request.pageSize + * Maximum number of snapshots to return. + * @param {string} request.pageToken + * The value returned by the last `ListSnapshotsResponse`; indicates that this + * is a continuation of a prior `ListSnapshots` call, and that the system + * should return the next page of data. + * @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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listSnapshotsAsync( + request?: protos.google.pubsub.v1.IListSnapshotsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listSnapshots.asyncIterate( + this.innerApiCalls['listSnapshots'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectTopic resource name string. + * + * @param {string} project + * @param {string} topic + * @returns {string} Resource name string. + */ + projectTopicPath(project: string, topic: string) { + return this.pathTemplates.projectTopicPathTemplate.render({ + project, + topic, + }); + } + + /** + * Parse the project from ProjectTopic resource. + * + * @param {string} projectTopicName + * A fully-qualified path representing project_topic resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTopicName(projectTopicName: string) { + return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName) + .project; + } + + /** + * Parse the topic from ProjectTopic resource. + * + * @param {string} projectTopicName + * A fully-qualified path representing project_topic resource. + * @returns {string} A string representing the topic. + */ + matchTopicFromProjectTopicName(projectTopicName: string) { + return this.pathTemplates.projectTopicPathTemplate.match(projectTopicName) + .topic; + } + + /** + * Return a fully-qualified snapshot resource name string. + * + * @param {string} project + * @param {string} snapshot + * @returns {string} Resource name string. + */ + snapshotPath(project: string, snapshot: string) { + return this.pathTemplates.snapshotPathTemplate.render({ + project, + snapshot, + }); + } + + /** + * Parse the project from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).project; + } + + /** + * Parse the snapshot from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the snapshot. + */ + matchSnapshotFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).snapshot; + } + + /** + * Return a fully-qualified subscription resource name string. + * + * @param {string} project + * @param {string} subscription + * @returns {string} Resource name string. + */ + subscriptionPath(project: string, subscription: string) { + return this.pathTemplates.subscriptionPathTemplate.render({ + project, + subscription, + }); + } + + /** + * Parse the project from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .project; + } + + /** + * Parse the subscription from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the subscription. + */ + matchSubscriptionFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .subscription; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.subscriberStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } + /** + * This part will be added into src/v1/key_management_service_client.ts by synth.py. + * KMS service requires IAM client for [setIamPolicy, getIamPolicy, testIamPerssion] methods. + * But we don't support it now in micro-generators for rerouting one service to another and mix them in. + * New feature request link: [https://github.com/googleapis/gapic-generator-typescript/issues/315] + * + * So this is manually written for providing methods to the KMS client. + * IamClient is created for KMS client in the constructor using src/helper.ts. + * [setIamPolicy, getIamPolicy, testIamPerssion] methods are created which is calling the corresponding methods from IamClient in `helper.ts`. + */ + + getIamPolicy( + request: protos.google.iam.v1.GetIamPolicyRequest, + options: gax.CallOptions, + callback: protos.google.iam.v1.IAMPolicy.GetIamPolicyCallback + ) { + return this._iamClient.getIamPolicy(request, options, callback); + } + setIamPolicy( + request: protos.google.iam.v1.SetIamPolicyRequest, + options: gax.CallOptions, + callback: protos.google.iam.v1.IAMPolicy.SetIamPolicyCallback + ) { + return this._iamClient.setIamPolicy(request, options, callback); + } + testIamPermissions( + request: protos.google.iam.v1.TestIamPermissionsRequest, + options: gax.CallOptions, + callback?: protos.google.iam.v1.IAMPolicy.TestIamPermissionsCallback + ) { + return this._iamClient.testIamPermissions(request, options, callback); + } +} diff --git a/src/v1/subscriber_client_config.json b/src/v1/subscriber_client_config.json index c85466874..aad28643d 100644 --- a/src/v1/subscriber_client_config.json +++ b/src/v1/subscriber_client_config.json @@ -2,19 +2,24 @@ "interfaces": { "google.pubsub.v1.Subscriber": { "retry_codes": { + "non_idempotent": [], "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unknown_aborted_unavailable": [ + "UNKNOWN", "ABORTED", - "UNAVAILABLE", - "UNKNOWN" + "UNAVAILABLE" ], - "non_idempotent": [ + "unavailable": [ "UNAVAILABLE" ], - "streaming_pull": [ - "ABORTED", + "deadline_exceeded_resource_exhausted_aborted_internal_unavailable": [ "DEADLINE_EXCEEDED", - "INTERNAL", "RESOURCE_EXHAUSTED", + "ABORTED", + "INTERNAL", "UNAVAILABLE" ] }, @@ -24,118 +29,90 @@ "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, + "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 - }, - "messaging": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 25000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 25000, - "total_timeout_millis": 600000 - }, - "streaming_messaging": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 } }, "methods": { "CreateSubscription": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "unknown_aborted_unavailable", "retry_params_name": "default" }, "GetSubscription": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "unknown_aborted_unavailable", "retry_params_name": "default" }, "UpdateSubscription": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "ListSubscriptions": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "unknown_aborted_unavailable", "retry_params_name": "default" }, "DeleteSubscription": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "ModifyAckDeadline": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "Acknowledge": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "messaging" + "retry_codes_name": "unavailable", + "retry_params_name": "default" }, "Pull": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "messaging" + "retry_codes_name": "unknown_aborted_unavailable", + "retry_params_name": "default" }, "StreamingPull": { "timeout_millis": 900000, - "retry_codes_name": "streaming_pull", - "retry_params_name": "streaming_messaging" + "retry_codes_name": "deadline_exceeded_resource_exhausted_aborted_internal_unavailable", + "retry_params_name": "default" }, "ModifyPushConfig": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_aborted_unavailable", "retry_params_name": "default" }, "ListSnapshots": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "unknown_aborted_unavailable", "retry_params_name": "default" }, "CreateSnapshot": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "UpdateSnapshot": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "DeleteSnapshot": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "Seek": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "unknown_aborted_unavailable", "retry_params_name": "default" } } diff --git a/src/v1/subscriber_proto_list.json b/src/v1/subscriber_proto_list.json index 6e307cc9f..23484bf66 100644 --- a/src/v1/subscriber_proto_list.json +++ b/src/v1/subscriber_proto_list.json @@ -1,4 +1,3 @@ [ - "../../protos/google/iam/v1/iam_policy.proto", "../../protos/google/pubsub/v1/pubsub.proto" ] diff --git a/synth.metadata b/synth.metadata index aed09da13..bfd981203 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,27 +1,19 @@ { - "updateTime": "2020-03-05T12:33:04.202496Z", + "updateTime": "2020-04-08T18:29:29.306214Z", "sources": [ - { - "generator": { - "name": "artman", - "version": "1.0.0", - "dockerImage": "googleapis/artman@sha256:f37f2464788cb551299209b4fcab4eb323533154488c2ef9ec0c75d7c2b4b482" - } - }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "638253bf86d1ce1c314108a089b7351440c2f0bf", - "internalRef": "298971070", - "log": "638253bf86d1ce1c314108a089b7351440c2f0bf\nfix: add java_multiple_files option for automl text_sentiment.proto\n\nPiperOrigin-RevId: 298971070\n\n373d655703bf914fb8b0b1cc4071d772bac0e0d1\nUpdate Recs AI Beta public bazel file\n\nPiperOrigin-RevId: 298961623\n\ndcc5d00fc8a8d8b56f16194d7c682027b2c66a3b\nfix: add java_multiple_files option for automl classification.proto\n\nPiperOrigin-RevId: 298953301\n\na3f791827266f3496a6a5201d58adc4bb265c2a3\nchore: automl/v1 publish annotations and retry config\n\nPiperOrigin-RevId: 298942178\n\n01c681586d8d6dbd60155289b587aee678530bd9\nMark return_immediately in PullRequest deprecated.\n\nPiperOrigin-RevId: 298893281\n\nc9f5e9c4bfed54bbd09227e990e7bded5f90f31c\nRemove out of date documentation for predicate support on the Storage API\n\nPiperOrigin-RevId: 298883309\n\nfd5b3b8238d783b04692a113ffe07c0363f5de0f\ngenerate webrisk v1 proto\n\nPiperOrigin-RevId: 298847934\n\n541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\na78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n" + "sha": "d398d687aad9eab4c6ceee9cd5e012fa61f7e28c", + "internalRef": "305496764" } }, { - "template": { - "name": "node_library", - "origin": "synthtool.gcp", - "version": "2020.2.4" + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "8cf0f5d93a70c3dcb0b4999d3152c46d4d9264bf" } } ], @@ -31,9 +23,8 @@ "source": "googleapis", "apiName": "pubsub", "apiVersion": "v1", - "language": "nodejs", - "generator": "gapic", - "config": "google/pubsub/artman_pubsub.yaml" + "language": "typescript", + "generator": "gapic-generator-typescript" } } ] diff --git a/synth.py b/synth.py index 34149f068..1fb6841f5 100644 --- a/synth.py +++ b/synth.py @@ -2,84 +2,69 @@ import synthtool.gcp as gcp import logging import subprocess +import json import os logging.basicConfig(level=logging.DEBUG) -AUTOSYNTH_MULTIPLE_COMMITS = True - - -gapic = gcp.GAPICGenerator() +gapic = gcp.GAPICMicrogenerator() common_templates = gcp.CommonTemplates() # tasks has two product names, and a poorly named artman yaml version = 'v1' -library = gapic.node_library( - 'pubsub', version, config_path="/google/pubsub/artman_pubsub.yaml") +library = gapic.typescript_library( + 'pubsub', + version, + generator_args={ + 'grpc-service-config': f'google/pubsub/{version}/pubsub_grpc_service_config.json', + 'package-name': f'@google-cloud/pubsub', + 'main-service': f'pubsub', + 'bundle-config': f'google/pubsub/{version}/pubsub_gapic.yaml', + 'template': f'typescript_gapic' + }, + proto_path=f'/google/pubsub/{version}', + extra_proto_files=['google/cloud/common_resources.proto'] +) # skip index, protos, package.json, and README.md s.copy( library, - excludes=['package.json', 'README.md', 'src/index.js']) + excludes=['package.json', 'README.md', 'src/index.ts']) templates = common_templates.node_library(source_location='build/src') s.copy(templates) -# https://github.com/googleapis/gapic-generator/issues/2127 -s.replace("src/v1/subscriber_client.js", - " }\n\s*/\*\*\n\s+\* The DNS address for this API service\.", - "\n // note: editing generated code\n" - " this.waitForReady = function(deadline, callback) {\n" - " return subscriberStub.then(\n" - " stub => stub.waitForReady(deadline, callback),\n" - " callback\n" - " );\n" - " };\n" - " this.getSubscriberStub = function() {\n" - " return subscriberStub;\n" - " };\n" - "\g<0>") +# TODO: remove this surgery once IAM service injected in nodejs-gax https://github.com/googleapis/gax-nodejs/pull/762/ +# surgery in client.ts file to call IAM service +clients = ['publisher', 'subscriber'] +for client_name in clients: + client_file = f'src/v1/{client_name}_client.ts' + s.replace(client_file, + f'import \* as gapicConfig from \'\.\/{client_name}_client_config\.json\';', + f'import * as gapicConfig from \'./%s_client_config.json\';\nimport {{IamClient}} from \'../helper\';' % client_name, + ) -# The JavaScript generator didn't implement close(). TypeScript gapic does, -# so this should be removed when we merge that. -s.replace("src/v1/publisher_client.js", - " \* Parse the projectName from a project resource.\n", - " * Terminate the GRPC channel and close the client.\n" - " * note: editing generated code\n" - " *\n" - " * The client will no longer be usable and all future behavior is undefined.\n" - " */\n" - " close() {\n" - " return this.publisherStub.then(stub => {\n" - " stub.close();\n" - " });\n" - " }\n" - " \n" - " /**\n" - " \g<0>") -s.replace("src/v1/publisher_client.js", - " const publisherStubMethods = \\[\n", - " // note: editing generated code\n" - " this.publisherStub = publisherStub;\n" - " \g<0>") + s.replace(client_file, + 'private \_terminated = false;', + 'private _terminated = false; \n private _iamClient: IamClient;') -# Update path discovery due to build/ dir and TypeScript conversion. -s.replace("src/v1/publisher_client.js", "../../package.json", "../../../package.json") -s.replace("src/v1/subscriber_client.js", "../../package.json", "../../../package.json") + s.replace(client_file, + '\/\/ Determine the client header string.', + 'this._iamClient = new IamClient(opts); \n // Determine the client header string.') -# [START fix-dead-link] -s.replace('src/**/doc/google/protobuf/doc_timestamp.js', - 'https:\/\/cloud\.google\.com[\s\*]*http:\/\/(.*)[\s\*]*\)', - r"https://\1)") + # TODO: it should be removed once pubsub upgrade gts 2.0.0 + # fix tslint issue due to mismatch gts version with gapic-generator-typescript + s.replace(client_file, '\/\/ eslint\-disable\-next\-line\ \@typescript\-eslint\/no\-explicit\-any', + '// tslint:disable-next-line no-any') -s.replace('src/**/doc/google/protobuf/doc_timestamp.js', - 'toISOString\]', - 'toISOString)') -# [END fix-dead-link] + with open('helperMethods.ts.tmpl', 'r') as helper_file: + content = helper_file.read() + s.replace(client_file, '^}', content) -# No browser support for TypeScript libraries yet -os.unlink('webpack.config.js') -os.unlink('src/browser.js') +# TODO: it should be removed once pubsub upgrade gts 2.0.0 +# fix tslint issue due to mismatch gts version with gapic-generator-typescript +s.replace('test/gapic_publisher_v1.ts', + 'const\ expectedResponse\ \=\ \[new\ String\(\)\,\ new\ String\(\)\,\ new\ String\(\)\];', 'const expectedResponse: string[] | undefined = [];') # Node.js specific cleanup subprocess.run(['npm', 'install']) diff --git a/system-test/pubsub.ts b/system-test/pubsub.ts index 1aab7783c..09447865e 100644 --- a/system-test/pubsub.ts +++ b/system-test/pubsub.ts @@ -26,8 +26,10 @@ import { Subscription, Topic, } from '../src'; -import {Policy} from '../src/iam'; +import {Policy, IamPermissionsMap} from '../src/iam'; import {MessageOptions} from '../src/topic'; +import {Metadata, MetadataValue} from 'google-gax'; +import {google} from '../protos/protos'; type Resource = Topic | Subscription | Snapshot; @@ -161,7 +163,7 @@ describe('pubsub', () => { pubsub .getTopicsStream() .on('error', done) - .on('data', topic => { + .on('data', (topic: Topic) => { topicsEmitted.push(topic); }) .on('end', () => { @@ -200,21 +202,25 @@ describe('pubsub', () => { it('should confirm if a topic exists', done => { const topic = pubsub.topic(TOPIC_NAMES[0]); - topic.exists((err, exists) => { - assert.ifError(err); - assert.strictEqual(exists, true); - done(); - }); + topic.exists( + (err: Error | null | undefined, exists: boolean | null | undefined) => { + assert.ifError(err); + assert.strictEqual(exists, true); + done(); + } + ); }); it('should confirm if a topic does not exist', done => { const topic = pubsub.topic('should-not-exist'); - topic.exists((err, exists) => { - assert.ifError(err); - assert.strictEqual(exists, false); - done(); - }); + topic.exists( + (err: Error | null | undefined, exists: boolean | null | undefined) => { + assert.ifError(err); + assert.strictEqual(exists, false); + done(); + } + ); }); it('should publish a message', done => { @@ -224,11 +230,17 @@ describe('pubsub', () => { orderingKey: 'a', }; - topic.publishMessage(message, (err, messageId) => { - assert.ifError(err); - assert.strictEqual(typeof messageId, 'string'); - done(); - }); + topic.publishMessage( + message, + ( + err: Error | null | undefined, + messageId: string | null | undefined + ) => { + assert.ifError(err); + assert.strictEqual(typeof messageId, 'string'); + done(); + } + ); }); it('should publish a message with attributes', async () => { @@ -243,11 +255,16 @@ describe('pubsub', () => { it('should get the metadata of a topic', done => { const topic = pubsub.topic(TOPIC_NAMES[0]); - topic.getMetadata((err, metadata) => { - assert.ifError(err); - assert.strictEqual(metadata!.name, topic.name); - done(); - }); + topic.getMetadata( + ( + err: ServiceError | null | undefined, + metadata: google.pubsub.v1.ITopic | null | undefined + ) => { + assert.ifError(err); + assert.strictEqual(metadata!.name, topic.name); + done(); + } + ); }); describe('ordered messages', () => { @@ -377,23 +394,27 @@ describe('pubsub', () => { subscription.create(err => { if (!err) { assert.fail('Should not have created subscription successfully.'); - return; } // ...and it should fail, because the subscription name is unique to the // project, and not the topic. - assert.strictEqual(err.code, 6); + assert.strictEqual(err!.code, 6); done(); }); }); it('should list all subscriptions registered to the topic', done => { - topic.getSubscriptions((err, subs) => { - assert.ifError(err); - assert.strictEqual(subs!.length, SUBSCRIPTIONS.length); - assert(subs![0] instanceof Subscription); - done(); - }); + topic.getSubscriptions( + ( + err: Error | null | undefined, + subs: Subscription[] | null | undefined + ) => { + assert.ifError(err); + assert.strictEqual(subs!.length, SUBSCRIPTIONS.length); + assert(subs![0] instanceof Subscription); + done(); + } + ); }); it('should list all topic subscriptions as a stream', done => { @@ -401,7 +422,7 @@ describe('pubsub', () => { topic .getSubscriptionsStream() .on('error', done) - .on('data', subscription => { + .on('data', (subscription: {}) => { subscriptionsEmitted.push(subscription); }) .on('end', () => { @@ -426,7 +447,7 @@ describe('pubsub', () => { pubsub .getSubscriptionsStream() .on('error', done) - .on('data', subscription => { + .on('data', (subscription: Subscription) => { subscriptionEmitted = subscription instanceof Subscription; }) .on('end', () => { @@ -437,11 +458,17 @@ describe('pubsub', () => { it('should allow creation and deletion of a subscription', done => { const subName = generateSubName(); - topic.createSubscription(subName, (err, sub) => { - assert.ifError(err); - assert(sub instanceof Subscription); - sub!.delete(done); - }); + topic.createSubscription( + subName, + ( + err: Error | null | undefined, + sub: Subscription | null | undefined + ) => { + assert.ifError(err); + assert(sub instanceof Subscription); + sub!.delete(done); + } + ); }); it('should honor the autoCreate option', done => { @@ -453,21 +480,25 @@ describe('pubsub', () => { it('should confirm if a sub exists', done => { const sub = topic.subscription(SUB_NAMES[0]); - sub.exists((err, exists) => { - assert.ifError(err); - assert.strictEqual(exists, true); - done(); - }); + sub.exists( + (err: Error | null | undefined, exists: boolean | null | undefined) => { + assert.ifError(err); + assert.strictEqual(exists, true); + done(); + } + ); }); it('should confirm if a sub does not exist', done => { const sub = topic.subscription('should-not-exist'); - sub.exists((err, exists) => { - assert.ifError(err); - assert.strictEqual(exists, false); - done(); - }); + sub.exists( + (err: Error | null | undefined, exists: boolean | null | undefined) => { + assert.ifError(err); + assert.strictEqual(exists, false); + done(); + } + ); }); it('should create a subscription with message retention', done => { @@ -479,24 +510,36 @@ describe('pubsub', () => { name: '', }; - topic.createSubscription(subName, callOptions, (err, sub) => { - assert.ifError(err); - - sub!.getMetadata((err, metadata) => { + topic.createSubscription( + subName, + callOptions, + ( + err: Error | null | undefined, + sub: Subscription | null | undefined + ) => { assert.ifError(err); - assert.strictEqual( - Number(metadata!.messageRetentionDuration!.seconds), - threeDaysInSeconds - ); - assert.strictEqual( - Number(metadata!.messageRetentionDuration!.nanos), - 0 - ); + sub!.getMetadata( + ( + err: Error | null | undefined, + metadata: google.pubsub.v1.ISubscription | null | undefined + ) => { + assert.ifError(err); - sub!.delete(done); - }); - }); + assert.strictEqual( + Number(metadata!.messageRetentionDuration!.seconds), + threeDaysInSeconds + ); + assert.strictEqual( + Number(metadata!.messageRetentionDuration!.nanos), + 0 + ); + + sub!.delete(done); + } + ); + } + ); }); it('should set metadata for a subscription', () => { @@ -524,7 +567,7 @@ describe('pubsub', () => { it('should error when using a non-existent subscription', done => { const subscription = topic.subscription(generateSubName()); - subscription.on('error', err => { + subscription.on('error', (err: {code: number}) => { assert.strictEqual(err.code, 5); subscription.close(done); }); @@ -540,7 +583,8 @@ describe('pubsub', () => { subscription.on('error', done); - subscription.on('message', message => { + // tslint:disable-next-line: no-any + subscription.on('message', (message: {data: any}) => { assert.deepStrictEqual(message.data, Buffer.from('hello')); if (++messageCount === 10) { @@ -597,18 +641,21 @@ describe('pubsub', () => { const subscription = topic.subscription(SUB_NAMES[0]); const data = crypto.randomBytes(9000000); // 9mb - topic.publishMessage({data}, (err, messageId) => { - assert.ifError(err); + topic.publishMessage( + {data}, + (err: ServiceError | null, messageId: string | null | undefined) => { + assert.ifError(err); - subscription.on('error', done).on('message', (message: Message) => { - if (message.id !== messageId) { - return; - } + subscription.on('error', done).on('message', (message: Message) => { + if (message.id !== messageId) { + return; + } - assert.deepStrictEqual(data, message.data); - subscription.close(done); - }); - }); + assert.deepStrictEqual(data, message.data); + subscription.close(done); + }); + } + ); }); // can be ran manually to test options/memory usage/etc. @@ -661,7 +708,7 @@ describe('pubsub', () => { console.log(`${duplicates} messages redelivered.`); console.log(`${acksPerMin} acks/m on average.`); - subscription.close(err => { + subscription.close((err: unknown) => { if (err) { deferred.reject(err); } else { @@ -692,14 +739,16 @@ describe('pubsub', () => { it('should get a policy', done => { const topic = pubsub.topic(TOPIC_NAMES[0]); - topic.iam.getPolicy((err, policy) => { - assert.ifError(err); + topic.iam.getPolicy( + (err: ServiceError | null, policy: Policy | null | undefined) => { + assert.ifError(err); - assert.deepStrictEqual(policy!.bindings, []); - assert.strictEqual(policy!.version, 0); + assert.deepStrictEqual(policy!.bindings, []); + assert.strictEqual(policy!.version, 0); - done(); - }); + done(); + } + ); }); it('should set a policy', done => { @@ -732,14 +781,20 @@ describe('pubsub', () => { const topic = pubsub.topic(TOPIC_NAMES[0]); const testPermissions = ['pubsub.topics.get', 'pubsub.topics.update']; - topic.iam.testPermissions(testPermissions, (err, permissions) => { - assert.ifError(err); - assert.deepStrictEqual(permissions, { - 'pubsub.topics.get': true, - 'pubsub.topics.update': true, - }); - done(); - }); + topic.iam.testPermissions( + testPermissions, + ( + err: ServiceError | null, + permissions: IamPermissionsMap | null | undefined + ) => { + assert.ifError(err); + assert.deepStrictEqual(permissions, { + 'pubsub.topics.get': true, + 'pubsub.topics.update': true, + }); + done(); + } + ); }); }); @@ -771,13 +826,18 @@ describe('pubsub', () => { }); it('should get a list of snapshots', done => { - pubsub.getSnapshots((err, snapshots) => { - assert.ifError(err); - assert(snapshots!.length > 0); - const names = snapshots!.map(getSnapshotName); - assert(names.includes(SNAPSHOT_NAME)); - done(); - }); + pubsub.getSnapshots( + ( + err: Error | null | undefined, + snapshots: Snapshot[] | null | undefined + ) => { + assert.ifError(err); + assert(snapshots!.length > 0); + const names = snapshots!.map(getSnapshotName); + assert(names.includes(SNAPSHOT_NAME)); + done(); + } + ); }); it('should get a list of snapshots as a stream', done => { @@ -785,7 +845,7 @@ describe('pubsub', () => { pubsub .getSnapshotsStream() .on('error', done) - .on('data', snapshot => snapshots.push(snapshot)) + .on('data', (snapshot: Snapshot) => snapshots.push(snapshot)) .on('end', () => { assert(snapshots.length > 0); const names = snapshots.map(getSnapshotName); @@ -812,7 +872,7 @@ describe('pubsub', () => { .then(() => { return topic.publish(Buffer.from('Hello, world!')); }) - .then(_messageId => { + .then((_messageId: string) => { messageId = _messageId; }); }); @@ -821,7 +881,7 @@ describe('pubsub', () => { let messageCount = 0; subscription.on('error', done); - subscription.on('message', message => { + subscription.on('message', (message: {id: string; ack: () => void}) => { if (message.id !== messageId) { return; } @@ -841,26 +901,30 @@ describe('pubsub', () => { let messageCount = 0; subscription.on('error', done); - subscription.on('message', message => { - if (message.id !== messageId) { - return; - } + subscription.on( + 'message', + // tslint:disable-next-line: no-any + (message: {id: string; ack: () => void; publishTime: any}) => { + if (message.id !== messageId) { + return; + } - message.ack(); + message.ack(); - if (++messageCount === 1) { - subscription.seek( - message.publishTime, - (err: ServiceError | null) => { - assert.ifError(err); - } - ); - return; - } + if (++messageCount === 1) { + subscription.seek( + message.publishTime, + (err: ServiceError | null) => { + assert.ifError(err); + } + ); + return; + } - assert.strictEqual(messageCount, 2); - subscription.close(done); - }); + assert.strictEqual(messageCount, 2); + subscription.close(done); + } + ); }); it('should seek to a future date (purge)', done => { @@ -878,12 +942,15 @@ describe('pubsub', () => { }) .then(() => { subscription.on('error', done); - subscription.on('message', message => { - // If we get the default message from before() then this fails. - assert.equal(message.data.toString(), testText); - message.ack(); - subscription.close(done); - }); + subscription.on( + 'message', + (message: {data: {toString: () => string}; ack: () => void}) => { + // If we get the default message from before() then this fails. + assert.equal(message.data.toString(), testText); + message.ack(); + subscription.close(done); + } + ); }); }); }); diff --git a/test/gapic-v1.js b/test/gapic-v1.js deleted file mode 100644 index 7a8679778..000000000 --- a/test/gapic-v1.js +++ /dev/null @@ -1,1968 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -'use strict'; - -const assert = require('assert'); -const {describe, it} = require('mocha'); -const {PassThrough} = require('stream'); - -const pubsubModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -const error = new Error(); -error.code = FAKE_STATUS_CODE; - -describe('PublisherClient', () => { - it('has servicePath', () => { - const servicePath = pubsubModule.v1.PublisherClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = pubsubModule.v1.PublisherClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = pubsubModule.v1.PublisherClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no options', () => { - const client = new pubsubModule.v1.PublisherClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new pubsubModule.v1.PublisherClient({fallback: true}); - assert(client); - }); - - describe('createTopic', () => { - it('invokes createTopic without error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.topicPath('[PROJECT]', '[TOPIC]'); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const kmsKeyName = 'kmsKeyName2094986649'; - const expectedResponse = { - name: name2, - kmsKeyName: kmsKeyName, - }; - - // Mock Grpc layer - client._innerApiCalls.createTopic = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createTopic(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createTopic with error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.topicPath('[PROJECT]', '[TOPIC]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.createTopic = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createTopic(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateTopic', () => { - it('invokes updateTopic without error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const topic = {}; - const updateMask = {}; - const request = { - topic: topic, - updateMask: updateMask, - }; - - // Mock response - const name = 'name3373707'; - const kmsKeyName = 'kmsKeyName2094986649'; - const expectedResponse = { - name: name, - kmsKeyName: kmsKeyName, - }; - - // Mock Grpc layer - client._innerApiCalls.updateTopic = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateTopic(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateTopic with error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const topic = {}; - const updateMask = {}; - const request = { - topic: topic, - updateMask: updateMask, - }; - - // Mock Grpc layer - client._innerApiCalls.updateTopic = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateTopic(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('publish', () => { - it('invokes publish without error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedTopic = client.topicPath('[PROJECT]', '[TOPIC]'); - const data = '-86'; - const messagesElement = { - data: data, - }; - const messages = [messagesElement]; - const request = { - topic: formattedTopic, - messages: messages, - }; - - // Mock response - const messageIdsElement = 'messageIdsElement-744837059'; - const messageIds = [messageIdsElement]; - const expectedResponse = { - messageIds: messageIds, - }; - - // Mock Grpc layer - client._innerApiCalls.publish = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.publish(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes publish with error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedTopic = client.topicPath('[PROJECT]', '[TOPIC]'); - const data = '-86'; - const messagesElement = { - data: data, - }; - const messages = [messagesElement]; - const request = { - topic: formattedTopic, - messages: messages, - }; - - // Mock Grpc layer - client._innerApiCalls.publish = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.publish(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getTopic', () => { - it('invokes getTopic without error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedTopic = client.topicPath('[PROJECT]', '[TOPIC]'); - const request = { - topic: formattedTopic, - }; - - // Mock response - const name = 'name3373707'; - const kmsKeyName = 'kmsKeyName2094986649'; - const expectedResponse = { - name: name, - kmsKeyName: kmsKeyName, - }; - - // Mock Grpc layer - client._innerApiCalls.getTopic = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getTopic(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getTopic with error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedTopic = client.topicPath('[PROJECT]', '[TOPIC]'); - const request = { - topic: formattedTopic, - }; - - // Mock Grpc layer - client._innerApiCalls.getTopic = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getTopic(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listTopics', () => { - it('invokes listTopics without error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedProject = client.projectPath('[PROJECT]'); - const request = { - project: formattedProject, - }; - - // Mock response - const nextPageToken = ''; - const topicsElement = {}; - const topics = [topicsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - topics: topics, - }; - - // Mock Grpc layer - client._innerApiCalls.listTopics = (actualRequest, options, callback) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.topics); - }; - - client.listTopics(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.topics); - done(); - }); - }); - - it('invokes listTopics with error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedProject = client.projectPath('[PROJECT]'); - const request = { - project: formattedProject, - }; - - // Mock Grpc layer - client._innerApiCalls.listTopics = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listTopics(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listTopicSubscriptions', () => { - it('invokes listTopicSubscriptions without error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedTopic = client.topicPath('[PROJECT]', '[TOPIC]'); - const request = { - topic: formattedTopic, - }; - - // Mock response - const nextPageToken = ''; - const subscriptionsElement = 'subscriptionsElement1698708147'; - const subscriptions = [subscriptionsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - subscriptions: subscriptions, - }; - - // Mock Grpc layer - client._innerApiCalls.listTopicSubscriptions = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.subscriptions); - }; - - client.listTopicSubscriptions(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.subscriptions); - done(); - }); - }); - - it('invokes listTopicSubscriptions with error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedTopic = client.topicPath('[PROJECT]', '[TOPIC]'); - const request = { - topic: formattedTopic, - }; - - // Mock Grpc layer - client._innerApiCalls.listTopicSubscriptions = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listTopicSubscriptions(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteTopic', () => { - it('invokes deleteTopic without error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedTopic = client.topicPath('[PROJECT]', '[TOPIC]'); - const request = { - topic: formattedTopic, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteTopic = mockSimpleGrpcMethod(request); - - client.deleteTopic(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteTopic with error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedTopic = client.topicPath('[PROJECT]', '[TOPIC]'); - const request = { - topic: formattedTopic, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteTopic = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteTopic(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.topicPath('[PROJECT]', '[TOPIC]'); - const policy = {}; - const request = { - resource: formattedResource, - policy: policy, - }; - - // Mock response - const version = 351608024; - const etag = '21'; - const expectedResponse = { - version: version, - etag: etag, - }; - - // Mock Grpc layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.setIamPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes setIamPolicy with error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.topicPath('[PROJECT]', '[TOPIC]'); - const policy = {}; - const request = { - resource: formattedResource, - policy: policy, - }; - - // Mock Grpc layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.setIamPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.topicPath('[PROJECT]', '[TOPIC]'); - const request = { - resource: formattedResource, - }; - - // Mock response - const version = 351608024; - const etag = '21'; - const expectedResponse = { - version: version, - etag: etag, - }; - - // Mock Grpc layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getIamPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getIamPolicy with error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.topicPath('[PROJECT]', '[TOPIC]'); - const request = { - resource: formattedResource, - }; - - // Mock Grpc layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getIamPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.topicPath('[PROJECT]', '[TOPIC]'); - const permissions = []; - const request = { - resource: formattedResource, - permissions: permissions, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.testIamPermissions(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes testIamPermissions with error', done => { - const client = new pubsubModule.v1.PublisherClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.topicPath('[PROJECT]', '[TOPIC]'); - const permissions = []; - const request = { - resource: formattedResource, - permissions: permissions, - }; - - // Mock Grpc layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.testIamPermissions(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); -}); -describe('SubscriberClient', () => { - it('has servicePath', () => { - const servicePath = pubsubModule.v1.SubscriberClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = pubsubModule.v1.SubscriberClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = pubsubModule.v1.SubscriberClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no options', () => { - const client = new pubsubModule.v1.SubscriberClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new pubsubModule.v1.SubscriberClient({fallback: true}); - assert(client); - }); - - describe('createSubscription', () => { - it('invokes createSubscription without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const formattedTopic = client.topicPath('[PROJECT]', '[TOPIC]'); - const request = { - name: formattedName, - topic: formattedTopic, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const topic2 = 'topic2-1139259102'; - const ackDeadlineSeconds = 2135351438; - const retainAckedMessages = false; - const enableMessageOrdering = true; - const expectedResponse = { - name: name2, - topic: topic2, - ackDeadlineSeconds: ackDeadlineSeconds, - retainAckedMessages: retainAckedMessages, - enableMessageOrdering: enableMessageOrdering, - }; - - // Mock Grpc layer - client._innerApiCalls.createSubscription = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createSubscription(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createSubscription with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const formattedTopic = client.topicPath('[PROJECT]', '[TOPIC]'); - const request = { - name: formattedName, - topic: formattedTopic, - }; - - // Mock Grpc layer - client._innerApiCalls.createSubscription = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createSubscription(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getSubscription', () => { - it('invokes getSubscription without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const request = { - subscription: formattedSubscription, - }; - - // Mock response - const name = 'name3373707'; - const topic = 'topic110546223'; - const ackDeadlineSeconds = 2135351438; - const retainAckedMessages = false; - const enableMessageOrdering = true; - const expectedResponse = { - name: name, - topic: topic, - ackDeadlineSeconds: ackDeadlineSeconds, - retainAckedMessages: retainAckedMessages, - enableMessageOrdering: enableMessageOrdering, - }; - - // Mock Grpc layer - client._innerApiCalls.getSubscription = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getSubscription(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getSubscription with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const request = { - subscription: formattedSubscription, - }; - - // Mock Grpc layer - client._innerApiCalls.getSubscription = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getSubscription(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateSubscription', () => { - it('invokes updateSubscription without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const ackDeadlineSeconds = 42; - const subscription = { - ackDeadlineSeconds: ackDeadlineSeconds, - }; - const pathsElement = 'ack_deadline_seconds'; - const paths = [pathsElement]; - const updateMask = { - paths: paths, - }; - const request = { - subscription: subscription, - updateMask: updateMask, - }; - - // Mock response - const name = 'name3373707'; - const topic = 'topic110546223'; - const ackDeadlineSeconds2 = 921632575; - const retainAckedMessages = false; - const enableMessageOrdering = true; - const expectedResponse = { - name: name, - topic: topic, - ackDeadlineSeconds: ackDeadlineSeconds2, - retainAckedMessages: retainAckedMessages, - enableMessageOrdering: enableMessageOrdering, - }; - - // Mock Grpc layer - client._innerApiCalls.updateSubscription = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateSubscription(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateSubscription with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const ackDeadlineSeconds = 42; - const subscription = { - ackDeadlineSeconds: ackDeadlineSeconds, - }; - const pathsElement = 'ack_deadline_seconds'; - const paths = [pathsElement]; - const updateMask = { - paths: paths, - }; - const request = { - subscription: subscription, - updateMask: updateMask, - }; - - // Mock Grpc layer - client._innerApiCalls.updateSubscription = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateSubscription(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listSubscriptions', () => { - it('invokes listSubscriptions without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedProject = client.projectPath('[PROJECT]'); - const request = { - project: formattedProject, - }; - - // Mock response - const nextPageToken = ''; - const subscriptionsElement = {}; - const subscriptions = [subscriptionsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - subscriptions: subscriptions, - }; - - // Mock Grpc layer - client._innerApiCalls.listSubscriptions = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.subscriptions); - }; - - client.listSubscriptions(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.subscriptions); - done(); - }); - }); - - it('invokes listSubscriptions with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedProject = client.projectPath('[PROJECT]'); - const request = { - project: formattedProject, - }; - - // Mock Grpc layer - client._innerApiCalls.listSubscriptions = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listSubscriptions(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteSubscription', () => { - it('invokes deleteSubscription without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const request = { - subscription: formattedSubscription, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteSubscription = mockSimpleGrpcMethod(request); - - client.deleteSubscription(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteSubscription with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const request = { - subscription: formattedSubscription, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteSubscription = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteSubscription(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('modifyAckDeadline', () => { - it('invokes modifyAckDeadline without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const ackIds = []; - const ackDeadlineSeconds = 2135351438; - const request = { - subscription: formattedSubscription, - ackIds: ackIds, - ackDeadlineSeconds: ackDeadlineSeconds, - }; - - // Mock Grpc layer - client._innerApiCalls.modifyAckDeadline = mockSimpleGrpcMethod(request); - - client.modifyAckDeadline(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes modifyAckDeadline with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const ackIds = []; - const ackDeadlineSeconds = 2135351438; - const request = { - subscription: formattedSubscription, - ackIds: ackIds, - ackDeadlineSeconds: ackDeadlineSeconds, - }; - - // Mock Grpc layer - client._innerApiCalls.modifyAckDeadline = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.modifyAckDeadline(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('acknowledge', () => { - it('invokes acknowledge without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const ackIds = []; - const request = { - subscription: formattedSubscription, - ackIds: ackIds, - }; - - // Mock Grpc layer - client._innerApiCalls.acknowledge = mockSimpleGrpcMethod(request); - - client.acknowledge(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes acknowledge with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const ackIds = []; - const request = { - subscription: formattedSubscription, - ackIds: ackIds, - }; - - // Mock Grpc layer - client._innerApiCalls.acknowledge = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.acknowledge(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('pull', () => { - it('invokes pull without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const maxMessages = 496131527; - const request = { - subscription: formattedSubscription, - maxMessages: maxMessages, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.pull = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.pull(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes pull with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const maxMessages = 496131527; - const request = { - subscription: formattedSubscription, - maxMessages: maxMessages, - }; - - // Mock Grpc layer - client._innerApiCalls.pull = mockSimpleGrpcMethod(request, null, error); - - client.pull(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('streamingPull', () => { - it('invokes streamingPull without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const streamAckDeadlineSeconds = 1875467245; - const request = { - subscription: formattedSubscription, - streamAckDeadlineSeconds: streamAckDeadlineSeconds, - }; - - // Mock response - const receivedMessagesElement = {}; - const receivedMessages = [receivedMessagesElement]; - const expectedResponse = { - receivedMessages: receivedMessages, - }; - - // Mock Grpc layer - client._innerApiCalls.streamingPull = mockBidiStreamingGrpcMethod( - request, - expectedResponse - ); - - const stream = client - .streamingPull() - .on('data', response => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', err => { - done(err); - }); - - stream.write(request); - }); - - it('invokes streamingPull with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const streamAckDeadlineSeconds = 1875467245; - const request = { - subscription: formattedSubscription, - streamAckDeadlineSeconds: streamAckDeadlineSeconds, - }; - - // Mock Grpc layer - client._innerApiCalls.streamingPull = mockBidiStreamingGrpcMethod( - request, - null, - error - ); - - const stream = client - .streamingPull() - .on('data', () => { - assert.fail(); - }) - .on('error', err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - - stream.write(request); - }); - }); - - describe('modifyPushConfig', () => { - it('invokes modifyPushConfig without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const pushConfig = {}; - const request = { - subscription: formattedSubscription, - pushConfig: pushConfig, - }; - - // Mock Grpc layer - client._innerApiCalls.modifyPushConfig = mockSimpleGrpcMethod(request); - - client.modifyPushConfig(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes modifyPushConfig with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const pushConfig = {}; - const request = { - subscription: formattedSubscription, - pushConfig: pushConfig, - }; - - // Mock Grpc layer - client._innerApiCalls.modifyPushConfig = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.modifyPushConfig(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('listSnapshots', () => { - it('invokes listSnapshots without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedProject = client.projectPath('[PROJECT]'); - const request = { - project: formattedProject, - }; - - // Mock response - const nextPageToken = ''; - const snapshotsElement = {}; - const snapshots = [snapshotsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - snapshots: snapshots, - }; - - // Mock Grpc layer - client._innerApiCalls.listSnapshots = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.snapshots); - }; - - client.listSnapshots(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.snapshots); - done(); - }); - }); - - it('invokes listSnapshots with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedProject = client.projectPath('[PROJECT]'); - const request = { - project: formattedProject, - }; - - // Mock Grpc layer - client._innerApiCalls.listSnapshots = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listSnapshots(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createSnapshot', () => { - it('invokes createSnapshot without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.snapshotPath('[PROJECT]', '[SNAPSHOT]'); - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const request = { - name: formattedName, - subscription: formattedSubscription, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const topic = 'topic110546223'; - const expectedResponse = { - name: name2, - topic: topic, - }; - - // Mock Grpc layer - client._innerApiCalls.createSnapshot = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createSnapshot(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createSnapshot with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.snapshotPath('[PROJECT]', '[SNAPSHOT]'); - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const request = { - name: formattedName, - subscription: formattedSubscription, - }; - - // Mock Grpc layer - client._innerApiCalls.createSnapshot = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createSnapshot(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateSnapshot', () => { - it('invokes updateSnapshot without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const seconds = 123456; - const expireTime = { - seconds: seconds, - }; - const snapshot = { - expireTime: expireTime, - }; - const pathsElement = 'expire_time'; - const paths = [pathsElement]; - const updateMask = { - paths: paths, - }; - const request = { - snapshot: snapshot, - updateMask: updateMask, - }; - - // Mock response - const name = 'name3373707'; - const topic = 'topic110546223'; - const expectedResponse = { - name: name, - topic: topic, - }; - - // Mock Grpc layer - client._innerApiCalls.updateSnapshot = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateSnapshot(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateSnapshot with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const seconds = 123456; - const expireTime = { - seconds: seconds, - }; - const snapshot = { - expireTime: expireTime, - }; - const pathsElement = 'expire_time'; - const paths = [pathsElement]; - const updateMask = { - paths: paths, - }; - const request = { - snapshot: snapshot, - updateMask: updateMask, - }; - - // Mock Grpc layer - client._innerApiCalls.updateSnapshot = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateSnapshot(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteSnapshot', () => { - it('invokes deleteSnapshot without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSnapshot = client.snapshotPath('[PROJECT]', '[SNAPSHOT]'); - const request = { - snapshot: formattedSnapshot, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteSnapshot = mockSimpleGrpcMethod(request); - - client.deleteSnapshot(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteSnapshot with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSnapshot = client.snapshotPath('[PROJECT]', '[SNAPSHOT]'); - const request = { - snapshot: formattedSnapshot, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteSnapshot = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteSnapshot(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('seek', () => { - it('invokes seek without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const request = { - subscription: formattedSubscription, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.seek = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.seek(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes seek with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedSubscription = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const request = { - subscription: formattedSubscription, - }; - - // Mock Grpc layer - client._innerApiCalls.seek = mockSimpleGrpcMethod(request, null, error); - - client.seek(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const policy = {}; - const request = { - resource: formattedResource, - policy: policy, - }; - - // Mock response - const version = 351608024; - const etag = '21'; - const expectedResponse = { - version: version, - etag: etag, - }; - - // Mock Grpc layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.setIamPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes setIamPolicy with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const policy = {}; - const request = { - resource: formattedResource, - policy: policy, - }; - - // Mock Grpc layer - client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.setIamPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const request = { - resource: formattedResource, - }; - - // Mock response - const version = 351608024; - const etag = '21'; - const expectedResponse = { - version: version, - etag: etag, - }; - - // Mock Grpc layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getIamPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getIamPolicy with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const request = { - resource: formattedResource, - }; - - // Mock Grpc layer - client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getIamPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const permissions = []; - const request = { - resource: formattedResource, - permissions: permissions, - }; - - // Mock response - const expectedResponse = {}; - - // Mock Grpc layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.testIamPermissions(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes testIamPermissions with error', done => { - const client = new pubsubModule.v1.SubscriberClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedResource = client.subscriptionPath( - '[PROJECT]', - '[SUBSCRIPTION]' - ); - const permissions = []; - const request = { - resource: formattedResource, - permissions: permissions, - }; - - // Mock Grpc layer - client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.testIamPermissions(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); -}); - -function mockSimpleGrpcMethod(expectedRequest, response, error) { - return function(actualRequest, options, callback) { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} - -function mockBidiStreamingGrpcMethod(expectedRequest, response, error) { - return () => { - const mockStream = new PassThrough({ - objectMode: true, - transform: (chunk, enc, callback) => { - assert.deepStrictEqual(chunk, expectedRequest); - if (error) { - callback(error); - } else { - callback(null, response); - } - }, - }); - return mockStream; - }; -} diff --git a/test/gapic_publisher_v1.ts b/test/gapic_publisher_v1.ts new file mode 100644 index 000000000..8f0d1682c --- /dev/null +++ b/test/gapic_publisher_v1.ts @@ -0,0 +1,1783 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 publisherModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.PublisherClient', () => { + it('has servicePath', () => { + const servicePath = publisherModule.v1.PublisherClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = publisherModule.v1.PublisherClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = publisherModule.v1.PublisherClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new publisherModule.v1.PublisherClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new publisherModule.v1.PublisherClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.publisherStub, undefined); + await client.initialize(); + assert(client.publisherStub); + }); + + it('has close method', () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new publisherModule.v1.PublisherClient({ + 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 publisherModule.v1.PublisherClient({ + 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('createTopic', () => { + it('invokes createTopic without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + client.innerApiCalls.createTopic = stubSimpleCall(expectedResponse); + const [response] = await client.createTopic(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createTopic as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createTopic without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + client.innerApiCalls.createTopic = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createTopic( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ITopic | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createTopic as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createTopic with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createTopic = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.createTopic(request); + }, expectedError); + assert( + (client.innerApiCalls.createTopic as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateTopic', () => { + it('invokes updateTopic without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateTopicRequest() + ); + request.topic = {}; + request.topic.name = ''; + const expectedHeaderRequestParams = 'topic.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + client.innerApiCalls.updateTopic = stubSimpleCall(expectedResponse); + const [response] = await client.updateTopic(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateTopic as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateTopic without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateTopicRequest() + ); + request.topic = {}; + request.topic.name = ''; + const expectedHeaderRequestParams = 'topic.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + client.innerApiCalls.updateTopic = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateTopic( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ITopic | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateTopic as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateTopic with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateTopicRequest() + ); + request.topic = {}; + request.topic.name = ''; + const expectedHeaderRequestParams = 'topic.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTopic = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.updateTopic(request); + }, expectedError); + assert( + (client.innerApiCalls.updateTopic as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('publish', () => { + it('invokes publish without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PublishRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.PublishResponse() + ); + client.innerApiCalls.publish = stubSimpleCall(expectedResponse); + const [response] = await client.publish(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.publish as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes publish without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PublishRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.PublishResponse() + ); + client.innerApiCalls.publish = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.publish( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.IPublishResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.publish as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes publish with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PublishRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.publish = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { + await client.publish(request); + }, expectedError); + assert( + (client.innerApiCalls.publish as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getTopic', () => { + it('invokes getTopic without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetTopicRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + client.innerApiCalls.getTopic = stubSimpleCall(expectedResponse); + const [response] = await client.getTopic(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getTopic as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getTopic without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetTopicRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Topic() + ); + client.innerApiCalls.getTopic = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getTopic( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ITopic | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getTopic as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getTopic with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetTopicRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getTopic = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { + await client.getTopic(request); + }, expectedError); + assert( + (client.innerApiCalls.getTopic as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteTopic', () => { + it('invokes deleteTopic without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteTopicRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTopic = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTopic(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteTopic as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteTopic without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteTopicRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTopic = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteTopic( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteTopic as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteTopic with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteTopicRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTopic = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteTopic(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteTopic as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listTopics', () => { + it('invokes listTopics without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + ]; + client.innerApiCalls.listTopics = stubSimpleCall(expectedResponse); + const [response] = await client.listTopics(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listTopics as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listTopics without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + ]; + client.innerApiCalls.listTopics = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listTopics( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ITopic[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listTopics as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listTopics with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listTopics = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.listTopics(request); + }, expectedError); + assert( + (client.innerApiCalls.listTopics as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listTopicsStream without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + ]; + client.descriptors.page.listTopics.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listTopicsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Topic[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Topic) => { + 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.listTopics.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTopics, request) + ); + assert.strictEqual( + (client.descriptors.page.listTopics.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listTopicsStream with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listTopics.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listTopicsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Topic[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Topic) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listTopics.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTopics, request) + ); + assert.strictEqual( + (client.descriptors.page.listTopics.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTopics without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + generateSampleMessage(new protos.google.pubsub.v1.Topic()), + ]; + client.descriptors.page.listTopics.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.pubsub.v1.ITopic[] = []; + const iterable = client.listTopicsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTopics.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listTopics.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTopics with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listTopics.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listTopicsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.pubsub.v1.ITopic[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTopics.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listTopics.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listTopicSubscriptions', () => { + it('invokes listTopicSubscriptions without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse: string[] | undefined = []; + client.innerApiCalls.listTopicSubscriptions = stubSimpleCall( + expectedResponse + ); + const [response] = await client.listTopicSubscriptions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listTopicSubscriptions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listTopicSubscriptions without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse: string[] | undefined = []; + client.innerApiCalls.listTopicSubscriptions = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listTopicSubscriptions( + request, + (err?: Error | null, result?: string[] | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listTopicSubscriptions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listTopicSubscriptions with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listTopicSubscriptions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.listTopicSubscriptions(request); + }, expectedError); + assert( + (client.innerApiCalls.listTopicSubscriptions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listTopicSubscriptionsStream without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedResponse: string[] | undefined = []; + client.descriptors.page.listTopicSubscriptions.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listTopicSubscriptionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + 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.listTopicSubscriptions + .createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTopicSubscriptions, request) + ); + assert.strictEqual( + (client.descriptors.page.listTopicSubscriptions + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listTopicSubscriptionsStream with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedError = new Error('expected'); + client.descriptors.page.listTopicSubscriptions.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listTopicSubscriptionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listTopicSubscriptions + .createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTopicSubscriptions, request) + ); + assert.strictEqual( + (client.descriptors.page.listTopicSubscriptions + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTopicSubscriptions without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedResponse: string[] | undefined = []; + client.descriptors.page.listTopicSubscriptions.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: string[] = []; + const iterable = client.listTopicSubscriptionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTopicSubscriptions + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listTopicSubscriptions + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTopicSubscriptions with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSubscriptionsRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedError = new Error('expected'); + client.descriptors.page.listTopicSubscriptions.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listTopicSubscriptionsAsync(request); + await assert.rejects(async () => { + const responses: string[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTopicSubscriptions + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listTopicSubscriptions + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listTopicSnapshots', () => { + it('invokes listTopicSnapshots without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse: string[] | undefined = []; + client.innerApiCalls.listTopicSnapshots = stubSimpleCall( + expectedResponse + ); + const [response] = await client.listTopicSnapshots(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listTopicSnapshots as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listTopicSnapshots without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse: string[] | undefined = []; + client.innerApiCalls.listTopicSnapshots = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listTopicSnapshots( + request, + (err?: Error | null, result?: string[] | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listTopicSnapshots as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listTopicSnapshots with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listTopicSnapshots = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.listTopicSnapshots(request); + }, expectedError); + assert( + (client.innerApiCalls.listTopicSnapshots as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listTopicSnapshotsStream without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedResponse: string[] | undefined = []; + client.descriptors.page.listTopicSnapshots.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listTopicSnapshotsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + 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.listTopicSnapshots.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTopicSnapshots, request) + ); + assert.strictEqual( + (client.descriptors.page.listTopicSnapshots + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listTopicSnapshotsStream with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedError = new Error('expected'); + client.descriptors.page.listTopicSnapshots.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listTopicSnapshotsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listTopicSnapshots.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTopicSnapshots, request) + ); + assert.strictEqual( + (client.descriptors.page.listTopicSnapshots + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTopicSnapshots without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedResponse: string[] | undefined = []; + client.descriptors.page.listTopicSnapshots.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: string[] = []; + const iterable = client.listTopicSnapshotsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTopicSnapshots + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listTopicSnapshots + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listTopicSnapshots with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListTopicSnapshotsRequest() + ); + request.topic = ''; + const expectedHeaderRequestParams = 'topic='; + const expectedError = new Error('expected'); + client.descriptors.page.listTopicSnapshots.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listTopicSnapshotsAsync(request); + await assert.rejects(async () => { + const responses: string[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTopicSnapshots + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listTopicSnapshots + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectTopic', () => { + const fakePath = '/rendered/path/projectTopic'; + const expectedParameters = { + project: 'projectValue', + topic: 'topicValue', + }; + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectTopicPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTopicPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTopicPath', () => { + const result = client.projectTopicPath('projectValue', 'topicValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectTopicPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectTopicName', () => { + const result = client.matchProjectFromProjectTopicName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectTopicPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTopicFromProjectTopicName', () => { + const result = client.matchTopicFromProjectTopicName(fakePath); + assert.strictEqual(result, 'topicValue'); + assert( + (client.pathTemplates.projectTopicPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('snapshot', () => { + const fakePath = '/rendered/path/snapshot'; + const expectedParameters = { + project: 'projectValue', + snapshot: 'snapshotValue', + }; + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.snapshotPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.snapshotPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('snapshotPath', () => { + const result = client.snapshotPath('projectValue', 'snapshotValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.snapshotPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSnapshotName', () => { + const result = client.matchProjectFromSnapshotName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSnapshotFromSnapshotName', () => { + const result = client.matchSnapshotFromSnapshotName(fakePath); + assert.strictEqual(result, 'snapshotValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('subscription', () => { + const fakePath = '/rendered/path/subscription'; + const expectedParameters = { + project: 'projectValue', + subscription: 'subscriptionValue', + }; + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.subscriptionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.subscriptionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('subscriptionPath', () => { + const result = client.subscriptionPath( + 'projectValue', + 'subscriptionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.subscriptionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSubscriptionName', () => { + const result = client.matchProjectFromSubscriptionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSubscriptionFromSubscriptionName', () => { + const result = client.matchSubscriptionFromSubscriptionName(fakePath); + assert.strictEqual(result, 'subscriptionValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/test/gapic_subscriber_v1.ts b/test/gapic_subscriber_v1.ts new file mode 100644 index 000000000..f5ef3f952 --- /dev/null +++ b/test/gapic_subscriber_v1.ts @@ -0,0 +1,2550 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 subscriberModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +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 stubBidiStreamingCall( + response?: ResponseType, + error?: Error +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +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.SubscriberClient', () => { + it('has servicePath', () => { + const servicePath = subscriberModule.v1.SubscriberClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = subscriberModule.v1.SubscriberClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = subscriberModule.v1.SubscriberClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new subscriberModule.v1.SubscriberClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new subscriberModule.v1.SubscriberClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.subscriberStub, undefined); + await client.initialize(); + assert(client.subscriberStub); + }); + + it('has close method', () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new subscriberModule.v1.SubscriberClient({ + 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 subscriberModule.v1.SubscriberClient({ + 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('createSubscription', () => { + it('invokes createSubscription without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + client.innerApiCalls.createSubscription = stubSimpleCall( + expectedResponse + ); + const [response] = await client.createSubscription(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createSubscription as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createSubscription without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + client.innerApiCalls.createSubscription = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createSubscription( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISubscription | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createSubscription as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createSubscription with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createSubscription = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.createSubscription(request); + }, expectedError); + assert( + (client.innerApiCalls.createSubscription as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getSubscription', () => { + it('invokes getSubscription without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSubscriptionRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + client.innerApiCalls.getSubscription = stubSimpleCall(expectedResponse); + const [response] = await client.getSubscription(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSubscription as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getSubscription without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSubscriptionRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + client.innerApiCalls.getSubscription = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getSubscription( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISubscription | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSubscription as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getSubscription with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSubscriptionRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getSubscription = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getSubscription(request); + }, expectedError); + assert( + (client.innerApiCalls.getSubscription as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateSubscription', () => { + it('invokes updateSubscription without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSubscriptionRequest() + ); + request.subscription = {}; + request.subscription.name = ''; + const expectedHeaderRequestParams = 'subscription.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + client.innerApiCalls.updateSubscription = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateSubscription(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSubscription as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateSubscription without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSubscriptionRequest() + ); + request.subscription = {}; + request.subscription.name = ''; + const expectedHeaderRequestParams = 'subscription.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Subscription() + ); + client.innerApiCalls.updateSubscription = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateSubscription( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISubscription | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSubscription as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateSubscription with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSubscriptionRequest() + ); + request.subscription = {}; + request.subscription.name = ''; + const expectedHeaderRequestParams = 'subscription.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSubscription = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.updateSubscription(request); + }, expectedError); + assert( + (client.innerApiCalls.updateSubscription as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteSubscription', () => { + it('invokes deleteSubscription without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSubscriptionRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSubscription = stubSimpleCall( + expectedResponse + ); + const [response] = await client.deleteSubscription(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteSubscription as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteSubscription without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSubscriptionRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSubscription = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteSubscription( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteSubscription as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteSubscription with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSubscriptionRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSubscription = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteSubscription(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteSubscription as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('modifyAckDeadline', () => { + it('invokes modifyAckDeadline without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyAckDeadlineRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.modifyAckDeadline = stubSimpleCall(expectedResponse); + const [response] = await client.modifyAckDeadline(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.modifyAckDeadline as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes modifyAckDeadline without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyAckDeadlineRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.modifyAckDeadline = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.modifyAckDeadline( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.modifyAckDeadline as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes modifyAckDeadline with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyAckDeadlineRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.modifyAckDeadline = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.modifyAckDeadline(request); + }, expectedError); + assert( + (client.innerApiCalls.modifyAckDeadline as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('acknowledge', () => { + it('invokes acknowledge without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.AcknowledgeRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.acknowledge = stubSimpleCall(expectedResponse); + const [response] = await client.acknowledge(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.acknowledge as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes acknowledge without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.AcknowledgeRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.acknowledge = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.acknowledge( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.acknowledge as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes acknowledge with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.AcknowledgeRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.acknowledge = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.acknowledge(request); + }, expectedError); + assert( + (client.innerApiCalls.acknowledge as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('pull', () => { + it('invokes pull without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PullRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.PullResponse() + ); + client.innerApiCalls.pull = stubSimpleCall(expectedResponse); + const [response] = await client.pull(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.pull as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes pull without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PullRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.PullResponse() + ); + client.innerApiCalls.pull = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pull( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.IPullResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.pull as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes pull with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.PullRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.pull = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { + await client.pull(request); + }, expectedError); + assert( + (client.innerApiCalls.pull as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('modifyPushConfig', () => { + it('invokes modifyPushConfig without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyPushConfigRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.modifyPushConfig = stubSimpleCall(expectedResponse); + const [response] = await client.modifyPushConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.modifyPushConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes modifyPushConfig without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyPushConfigRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.modifyPushConfig = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.modifyPushConfig( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.modifyPushConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes modifyPushConfig with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ModifyPushConfigRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.modifyPushConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.modifyPushConfig(request); + }, expectedError); + assert( + (client.innerApiCalls.modifyPushConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getSnapshot', () => { + it('invokes getSnapshot without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSnapshotRequest() + ); + request.snapshot = ''; + const expectedHeaderRequestParams = 'snapshot='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot() + ); + client.innerApiCalls.getSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.getSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getSnapshot without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSnapshotRequest() + ); + request.snapshot = ''; + const expectedHeaderRequestParams = 'snapshot='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot() + ); + client.innerApiCalls.getSnapshot = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getSnapshot( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISnapshot | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getSnapshot with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.GetSnapshotRequest() + ); + request.snapshot = ''; + const expectedHeaderRequestParams = 'snapshot='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getSnapshot = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getSnapshot(request); + }, expectedError); + assert( + (client.innerApiCalls.getSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createSnapshot', () => { + it('invokes createSnapshot without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSnapshotRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot() + ); + client.innerApiCalls.createSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.createSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createSnapshot without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSnapshotRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot() + ); + client.innerApiCalls.createSnapshot = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createSnapshot( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISnapshot | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createSnapshot with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.CreateSnapshotRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createSnapshot = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.createSnapshot(request); + }, expectedError); + assert( + (client.innerApiCalls.createSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateSnapshot', () => { + it('invokes updateSnapshot without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSnapshotRequest() + ); + request.snapshot = {}; + request.snapshot.name = ''; + const expectedHeaderRequestParams = 'snapshot.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot() + ); + client.innerApiCalls.updateSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.updateSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateSnapshot without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSnapshotRequest() + ); + request.snapshot = {}; + request.snapshot.name = ''; + const expectedHeaderRequestParams = 'snapshot.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.Snapshot() + ); + client.innerApiCalls.updateSnapshot = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateSnapshot( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISnapshot | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateSnapshot with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.UpdateSnapshotRequest() + ); + request.snapshot = {}; + request.snapshot.name = ''; + const expectedHeaderRequestParams = 'snapshot.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSnapshot = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.updateSnapshot(request); + }, expectedError); + assert( + (client.innerApiCalls.updateSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteSnapshot', () => { + it('invokes deleteSnapshot without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSnapshotRequest() + ); + request.snapshot = ''; + const expectedHeaderRequestParams = 'snapshot='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteSnapshot without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSnapshotRequest() + ); + request.snapshot = ''; + const expectedHeaderRequestParams = 'snapshot='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSnapshot = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteSnapshot( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteSnapshot with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.DeleteSnapshotRequest() + ); + request.snapshot = ''; + const expectedHeaderRequestParams = 'snapshot='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSnapshot = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteSnapshot(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('seek', () => { + it('invokes seek without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.SeekRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.SeekResponse() + ); + client.innerApiCalls.seek = stubSimpleCall(expectedResponse); + const [response] = await client.seek(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.seek as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes seek without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.SeekRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.SeekResponse() + ); + client.innerApiCalls.seek = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.seek( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISeekResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.seek as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes seek with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.SeekRequest() + ); + request.subscription = ''; + const expectedHeaderRequestParams = 'subscription='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.seek = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => { + await client.seek(request); + }, expectedError); + assert( + (client.innerApiCalls.seek as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('streamingPull', () => { + it('invokes streamingPull without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.StreamingPullRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.pubsub.v1.StreamingPullResponse() + ); + client.innerApiCalls.streamingPull = stubBidiStreamingCall( + expectedResponse + ); + const stream = client.streamingPull(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.pubsub.v1.StreamingPullResponse) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.streamingPull as SinonStub) + .getCall(0) + .calledWithExactly(undefined) + ); + assert.deepStrictEqual( + (((stream as unknown) as PassThrough)._transform as SinonStub).getCall( + 0 + ).args[0], + request + ); + }); + + it('invokes streamingPull with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.StreamingPullRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.streamingPull = stubBidiStreamingCall( + undefined, + expectedError + ); + const stream = client.streamingPull(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.pubsub.v1.StreamingPullResponse) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.innerApiCalls.streamingPull as SinonStub) + .getCall(0) + .calledWithExactly(undefined) + ); + assert.deepStrictEqual( + (((stream as unknown) as PassThrough)._transform as SinonStub).getCall( + 0 + ).args[0], + request + ); + }); + }); + + describe('listSubscriptions', () => { + it('invokes listSubscriptions without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + ]; + client.innerApiCalls.listSubscriptions = stubSimpleCall(expectedResponse); + const [response] = await client.listSubscriptions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listSubscriptions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listSubscriptions without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + ]; + client.innerApiCalls.listSubscriptions = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listSubscriptions( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISubscription[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listSubscriptions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listSubscriptions with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listSubscriptions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.listSubscriptions(request); + }, expectedError); + assert( + (client.innerApiCalls.listSubscriptions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listSubscriptionsStream without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + ]; + client.descriptors.page.listSubscriptions.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listSubscriptionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Subscription[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Subscription) => { + 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.listSubscriptions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSubscriptions, request) + ); + assert.strictEqual( + (client.descriptors.page.listSubscriptions + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listSubscriptionsStream with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listSubscriptions.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSubscriptionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Subscription[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Subscription) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listSubscriptions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSubscriptions, request) + ); + assert.strictEqual( + (client.descriptors.page.listSubscriptions + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSubscriptions without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + generateSampleMessage(new protos.google.pubsub.v1.Subscription()), + ]; + client.descriptors.page.listSubscriptions.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.pubsub.v1.ISubscription[] = []; + const iterable = client.listSubscriptionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSubscriptions + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listSubscriptions + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSubscriptions with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSubscriptionsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listSubscriptions.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSubscriptionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.pubsub.v1.ISubscription[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSubscriptions + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listSubscriptions + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listSnapshots', () => { + it('invokes listSnapshots without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + ]; + client.innerApiCalls.listSnapshots = stubSimpleCall(expectedResponse); + const [response] = await client.listSnapshots(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listSnapshots as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listSnapshots without error using callback', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + ]; + client.innerApiCalls.listSnapshots = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listSnapshots( + request, + ( + err?: Error | null, + result?: protos.google.pubsub.v1.ISnapshot[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listSnapshots as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listSnapshots with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listSnapshots = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.listSnapshots(request); + }, expectedError); + assert( + (client.innerApiCalls.listSnapshots as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listSnapshotsStream without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + ]; + client.descriptors.page.listSnapshots.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listSnapshotsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Snapshot[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Snapshot) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listSnapshots.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSnapshots, request) + ); + assert.strictEqual( + (client.descriptors.page.listSnapshots + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listSnapshotsStream with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listSnapshots.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSnapshotsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.pubsub.v1.Snapshot[] = []; + stream.on('data', (response: protos.google.pubsub.v1.Snapshot) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listSnapshots.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSnapshots, request) + ); + assert.strictEqual( + (client.descriptors.page.listSnapshots + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSnapshots without error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + generateSampleMessage(new protos.google.pubsub.v1.Snapshot()), + ]; + client.descriptors.page.listSnapshots.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.pubsub.v1.ISnapshot[] = []; + const iterable = client.listSnapshotsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSnapshots + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listSnapshots + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSnapshots with error', async () => { + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.pubsub.v1.ListSnapshotsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listSnapshots.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSnapshotsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.pubsub.v1.ISnapshot[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSnapshots + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listSnapshots + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectTopic', () => { + const fakePath = '/rendered/path/projectTopic'; + const expectedParameters = { + project: 'projectValue', + topic: 'topicValue', + }; + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectTopicPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTopicPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTopicPath', () => { + const result = client.projectTopicPath('projectValue', 'topicValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectTopicPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectTopicName', () => { + const result = client.matchProjectFromProjectTopicName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectTopicPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTopicFromProjectTopicName', () => { + const result = client.matchTopicFromProjectTopicName(fakePath); + assert.strictEqual(result, 'topicValue'); + assert( + (client.pathTemplates.projectTopicPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('snapshot', () => { + const fakePath = '/rendered/path/snapshot'; + const expectedParameters = { + project: 'projectValue', + snapshot: 'snapshotValue', + }; + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.snapshotPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.snapshotPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('snapshotPath', () => { + const result = client.snapshotPath('projectValue', 'snapshotValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.snapshotPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSnapshotName', () => { + const result = client.matchProjectFromSnapshotName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSnapshotFromSnapshotName', () => { + const result = client.matchSnapshotFromSnapshotName(fakePath); + assert.strictEqual(result, 'snapshotValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('subscription', () => { + const fakePath = '/rendered/path/subscription'; + const expectedParameters = { + project: 'projectValue', + subscription: 'subscriptionValue', + }; + const client = new subscriberModule.v1.SubscriberClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.subscriptionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.subscriptionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('subscriptionPath', () => { + const result = client.subscriptionPath( + 'projectValue', + 'subscriptionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.subscriptionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSubscriptionName', () => { + const result = client.matchProjectFromSubscriptionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSubscriptionFromSubscriptionName', () => { + const result = client.matchSubscriptionFromSubscriptionName(fakePath); + assert.strictEqual(result, 'subscriptionValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/test/message-stream.ts b/test/message-stream.ts index 3b32bb109..6783aa78e 100644 --- a/test/message-stream.ts +++ b/test/message-stream.ts @@ -109,8 +109,13 @@ class FakeGrpcStream extends Duplex { class FakeGaxClient { client: FakeGrpcClient; + subscriberStub: Promise; constructor() { this.client = new FakeGrpcClient(); + this.subscriberStub = this.getSubscriberStub(); + } + initialize() { + return this.subscriberStub; } async getSubscriberStub(): Promise { return this.client; diff --git a/test/pubsub.ts b/test/pubsub.ts index 78bb05b81..0d5fa3cf1 100644 --- a/test/pubsub.ts +++ b/test/pubsub.ts @@ -23,7 +23,7 @@ import {CallOptions, ChannelCredentials, ServiceError} from '@grpc/grpc-js'; import * as proxyquire from 'proxyquire'; import * as sinon from 'sinon'; -import {google} from '../proto/pubsub'; +import {google} from '../protos/protos'; import * as pubsubTypes from '../src/pubsub'; import {Snapshot} from '../src/snapshot'; import * as subby from '../src/subscription'; @@ -295,10 +295,6 @@ describe('PubSub', () => { it('should set isEmulator to false by default', () => { assert.strictEqual(pubsub.isEmulator, false); }); - - it('should localize a Promise override', () => { - assert.strictEqual(pubsub.Promise, OPTIONS.promise); - }); }); describe('createSubscription', () => { @@ -784,7 +780,8 @@ describe('PubSub', () => { return snapshot as Snapshot; }); - pubsub.getSnapshots((err, snapshots) => { + // tslint:disable-next-line: no-any + pubsub.getSnapshots((err: any, snapshots: any) => { assert.ifError(err); assert.strictEqual(snapshots![0], snapshot); assert.strictEqual(snapshots![0].metadata, apiResponse.snapshots[0]); @@ -1009,7 +1006,8 @@ describe('PubSub', () => { return topic as Topic; }; - pubsub.getTopics((err, topics) => { + // tslint:disable-next-line: no-any + pubsub.getTopics((err: any, topics: any) => { assert.ifError(err); assert.strictEqual(topics![0], topic); assert.strictEqual(topics![0].metadata, apiResponse.topics[0]); diff --git a/test/topic.ts b/test/topic.ts index 6303c34e3..07fd5363a 100644 --- a/test/topic.ts +++ b/test/topic.ts @@ -20,7 +20,7 @@ import {ServiceError} from '@grpc/grpc-js'; import * as proxyquire from 'proxyquire'; import * as sinon from 'sinon'; -import {google} from '../proto/pubsub'; +import {google} from '../protos/protos'; import {ExistsCallback, RequestCallback, RequestConfig} from '../src/pubsub'; import { CreateSubscriptionOptions, diff --git a/tsconfig.json b/tsconfig.json index 31be13957..c78f1c884 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,10 +2,17 @@ "extends": "./node_modules/gts/tsconfig-google.json", "compilerOptions": { "rootDir": ".", - "outDir": "build" + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] }, "include": [ + "src/*.ts", "src/**/*.ts", + "test/*.ts", "test/**/*.ts", "system-test/*.ts" ] diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 000000000..c53b4c466 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'pubsub', + filename: './pubsub.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', +};