From cd423e8b4bdc27ab632864a19c57e63b9ec7f204 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 1 Aug 2023 22:33:57 +0000 Subject: [PATCH] chore(deps): upgrade dependencies for Node.js images Source-Link: https://github.com/googleapis/synthtool/commit/1dd93a39c888d50dfaf270d7fcd5b5feb66a4f7f Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:3ad01f4c6671efb094b43f7d3a3e0b9510bd6501f2e65e874dd525373e29de75 --- .github/.OwlBot.lock.yaml | 4 +- README.md | 16 +- protos/protos.d.ts | 1493 +++++++ protos/protos.js | 3853 +++++++++++++++++ protos/protos.json | 292 ++ samples/createAvroSchema.js | 14 +- samples/createBigQuerySubscription.js | 32 +- samples/createProtoSchema.js | 14 +- samples/createPushSubscription.js | 27 +- samples/createSubscription.js | 23 +- .../createSubscriptionWithDeadLetterPolicy.js | 32 +- ...eateSubscriptionWithExactlyOnceDelivery.js | 28 +- samples/createSubscriptionWithFiltering.js | 32 +- samples/createSubscriptionWithOrdering.js | 28 +- samples/createTopic.js | 6 +- samples/createTopicWithSchema.js | 26 +- samples/deleteSchema.js | 6 +- samples/deleteSubscription.js | 6 +- samples/deleteTopic.js | 6 +- samples/detachSubscription.js | 6 +- samples/getSchema.js | 6 +- samples/getSubscriptionPolicy.js | 12 +- samples/getTopicPolicy.js | 10 +- samples/listAllTopics.js | 8 +- samples/listSchemas.js | 6 +- samples/listSubscriptions.js | 8 +- samples/listTopicSubscriptions.js | 16 +- samples/listenForAvroRecords.js | 22 +- samples/listenForErrors.js | 14 +- samples/listenForMessages.js | 12 +- ...istenForMessagesWithExactlyOnceDelivery.js | 20 +- samples/listenForProtobufMessages.js | 21 +- samples/listenWithCustomAttributes.js | 21 +- samples/modifyPushConfig.js | 27 +- samples/publishAvroRecords.js | 23 +- samples/publishBatchedMessages.js | 32 +- samples/publishMessage.js | 22 +- samples/publishMessageWithCustomAttributes.js | 27 +- samples/publishOrderedMessage.js | 32 +- samples/publishProtobufMessages.js | 15 +- samples/publishWithFlowControl.js | 12 +- samples/publishWithRetrySettings.js | 45 +- samples/quickstart.js | 20 +- samples/removeDeadLetterPolicy.js | 27 +- samples/resumePublish.js | 24 +- samples/setSubscriptionPolicy.js | 34 +- samples/setTopicPolicy.js | 34 +- samples/subscribeWithFlowControlSettings.js | 28 +- samples/synchronousPull.js | 27 +- .../synchronousPullWithDeliveryAttempts.js | 28 +- samples/testSubscriptionPermissions.js | 18 +- samples/testTopicPermissions.js | 20 +- samples/updateDeadLetterPolicy.js | 29 +- 53 files changed, 6172 insertions(+), 472 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index de4fa0a5d..0c47c8b71 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest - digest: sha256:ef104a520c849ffde60495342ecf099dfb6256eab0fbd173228f447bc73d1aa9 -# created: 2023-07-10T21:36:52.433664553Z + digest: sha256:3ad01f4c6671efb094b43f7d3a3e0b9510bd6501f2e65e874dd525373e29de75 +# created: 2023-08-01T22:29:52.50398591Z diff --git a/README.md b/README.md index 0b3091c38..9640f7017 100644 --- a/README.md +++ b/README.md @@ -66,15 +66,15 @@ npm install @google-cloud/pubsub ```javascript // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); async function quickstart( - projectId = 'your-project-id', // Your Google Cloud Platform project ID - topicNameOrId = 'my-topic', // Name for the new topic to create - subscriptionName = 'my-sub' // Name for the new subscription to create +projectId = 'your-project-id', // Your Google Cloud Platform project ID +topicNameOrId = 'my-topic', // Name for the new topic to create +subscriptionName = 'my-sub' // Name for the new subscription to create ) { // Instantiates a client - const pubsub = new PubSub({projectId}); + const pubsub = new PubSub({ projectId }); // Creates a new topic const [topic] = await pubsub.createTopic(topicNameOrId); @@ -84,19 +84,19 @@ async function quickstart( const [subscription] = await topic.createSubscription(subscriptionName); // Receive callbacks for new messages on the subscription - subscription.on('message', message => { + subscription.on('message', (message) => { console.log('Received message:', message.data.toString()); process.exit(0); }); // Receive callbacks for errors on the subscription - subscription.on('error', error => { + subscription.on('error', (error) => { console.error('Received error:', error); process.exit(1); }); // Send a message to the topic - topic.publishMessage({data: Buffer.from('Test message!')}); + topic.publishMessage({ data: Buffer.from('Test message!') }); } ``` diff --git a/protos/protos.d.ts b/protos/protos.d.ts index e466657f6..443f61fb3 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -8656,6 +8656,1448 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + /** FieldBehavior enum. */ enum FieldBehavior { FIELD_BEHAVIOR_UNSPECIFIED = 0, @@ -10762,6 +12204,9 @@ export namespace google { /** MessageOptions mapEntry */ mapEntry?: (boolean|null); + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + /** MessageOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -10790,6 +12235,9 @@ export namespace google { /** MessageOptions mapEntry. */ public mapEntry: boolean; + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + /** MessageOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -10895,6 +12343,15 @@ export namespace google { /** FieldOptions weak */ weak?: (boolean|null); + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions target */ + target?: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType|null); + /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -10935,6 +12392,15 @@ export namespace google { /** FieldOptions weak. */ public weak: boolean; + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions target. */ + public target: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType); + /** FieldOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -11031,6 +12497,27 @@ export namespace google { JS_STRING = 1, JS_NUMBER = 2 } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } } /** Properties of an OneofOptions. */ @@ -11139,6 +12626,9 @@ export namespace google { /** EnumOptions deprecated */ deprecated?: (boolean|null); + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + /** EnumOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } @@ -11158,6 +12648,9 @@ export namespace google { /** EnumOptions deprecated. */ public deprecated: boolean; + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + /** EnumOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; diff --git a/protos/protos.js b/protos/protos.js index 12b95492d..2495a560e 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -20326,6 +20326,3615 @@ return CustomHttpPattern; })(); + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + /** * FieldBehavior enum. * @name google.api.FieldBehavior @@ -26274,6 +29883,7 @@ * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor * @property {boolean|null} [deprecated] MessageOptions deprecated * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource */ @@ -26326,6 +29936,14 @@ */ MessageOptions.prototype.mapEntry = false; + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + /** * MessageOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -26374,6 +29992,8 @@ writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); if (message.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(); @@ -26429,6 +30049,10 @@ message.mapEntry = reader.bool(); break; } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -26486,6 +30110,9 @@ if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) if (typeof message.mapEntry !== "boolean") return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -26523,6 +30150,8 @@ message.deprecated = Boolean(object.deprecated); if (object.mapEntry != null) message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); @@ -26561,6 +30190,7 @@ object.noStandardDescriptorAccessor = false; object.deprecated = false; object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; object[".google.api.resource"] = null; } if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) @@ -26571,6 +30201,8 @@ object.deprecated = message.deprecated; if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -26623,6 +30255,9 @@ * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy * @property {boolean|null} [deprecated] FieldOptions deprecated * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {google.protobuf.FieldOptions.OptionTargetType|null} [target] FieldOptions target * @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 @@ -26701,6 +30336,30 @@ */ FieldOptions.prototype.weak = false; + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions target. + * @member {google.protobuf.FieldOptions.OptionTargetType} target + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.target = 0; + /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -26763,6 +30422,12 @@ writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.target); 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(); @@ -26836,6 +30501,18 @@ message.weak = reader.bool(); break; } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 18: { + message.target = reader.int32(); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -26925,6 +30602,34 @@ if (message.weak != null && message.hasOwnProperty("weak")) if (typeof message.weak !== "boolean") return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.target != null && message.hasOwnProperty("target")) + switch (message.target) { + default: + return "target: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -27022,6 +30727,76 @@ message.deprecated = Boolean(object.deprecated); if (object.weak != null) message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + switch (object.target) { + default: + if (typeof object.target === "number") { + message.target = object.target; + break; + } + break; + case "TARGET_TYPE_UNKNOWN": + case 0: + message.target = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.target = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.target = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.target = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.target = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.target = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.target = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.target = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.target = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.target = 9; + break; + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); @@ -27110,6 +30885,9 @@ object.jstype = options.enums === String ? "JS_NORMAL" : 0; object.weak = false; object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.target = options.enums === String ? "TARGET_TYPE_UNKNOWN" : 0; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) @@ -27126,6 +30904,12 @@ object.weak = message.weak; if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.target != null && message.hasOwnProperty("target")) + object.target = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.target] === undefined ? message.target : $root.google.protobuf.FieldOptions.OptionTargetType[message.target] : message.target; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -27199,6 +30983,52 @@ return values; })(); + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + return FieldOptions; })(); @@ -27434,6 +31264,7 @@ * @interface IEnumOptions * @property {boolean|null} [allowAlias] EnumOptions allowAlias * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption */ @@ -27469,6 +31300,14 @@ */ EnumOptions.prototype.deprecated = false; + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + /** * EnumOptions uninterpretedOption. * @member {Array.} uninterpretedOption @@ -27505,6 +31344,8 @@ writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); if (message.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(); @@ -27550,6 +31391,10 @@ message.deprecated = reader.bool(); break; } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; @@ -27597,6 +31442,9 @@ if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -27625,6 +31473,8 @@ message.allowAlias = Boolean(object.allowAlias); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); @@ -27656,11 +31506,14 @@ if (options.defaults) { object.allowAlias = false; object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = 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.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) diff --git a/protos/protos.json b/protos/protos.json index 646f8fce8..d92936908 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -2179,6 +2179,248 @@ "id": 1050, "extend": "google.protobuf.ServiceOptions" }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, "fieldBehavior": { "rule": "repeated", "type": "google.api.FieldBehavior", @@ -2828,6 +3070,13 @@ "type": "bool", "id": 7 }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -2911,6 +3160,21 @@ "default": false } }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "target": { + "type": "OptionTargetType", + "id": 18 + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -2943,6 +3207,27 @@ "JS_STRING": 1, "JS_NUMBER": 2 } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } } } }, @@ -2974,6 +3259,13 @@ "default": false } }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", diff --git a/samples/createAvroSchema.js b/samples/createAvroSchema.js index 5de29cd4d..8a9df2957 100644 --- a/samples/createAvroSchema.js +++ b/samples/createAvroSchema.js @@ -37,9 +37,9 @@ // const avscFile = 'path/to/an/avro/schema/file/(.avsc)/formatted/in/json'; // Imports the Google Cloud client library -const {PubSub, SchemaTypes} = require('@google-cloud/pubsub'); +const { PubSub, SchemaTypes } = require("@google-cloud/pubsub"); -const fs = require('fs'); +const fs = require("fs"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -58,13 +58,13 @@ async function createAvroSchema(schemaNameOrId, avscFile) { // [END pubsub_create_avro_schema] function main( - schemaNameOrId = 'YOUR_SCHEMA_NAME_OR_ID', - avscFile = 'path/to/an/avro/schema/file/(.avsc)/formatted/in/json' -) { - createAvroSchema(schemaNameOrId, avscFile).catch(err => { +schemaNameOrId = 'YOUR_SCHEMA_NAME_OR_ID', +avscFile = 'path/to/an/avro/schema/file/(.avsc)/formatted/in/json') +{ + createAvroSchema(schemaNameOrId, avscFile).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/createBigQuerySubscription.js b/samples/createBigQuerySubscription.js index fc1da43dc..7cd345936 100644 --- a/samples/createBigQuerySubscription.js +++ b/samples/createBigQuerySubscription.js @@ -38,44 +38,44 @@ // const bigqueryTableId = 'YOUR_TABLE_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); async function createBigQuerySubscription( - topicNameOrId, - subscriptionNameOrId, - bigqueryTableId -) { +topicNameOrId, +subscriptionNameOrId, +bigqueryTableId) +{ const options = { bigqueryConfig: { table: bigqueryTableId, - writeMetadata: true, - }, + writeMetadata: true + } }; - await pubSubClient - .topic(topicNameOrId) - .createSubscription(subscriptionNameOrId, options); + await pubSubClient. + topic(topicNameOrId). + createSubscription(subscriptionNameOrId, options); console.log(`Subscription ${subscriptionNameOrId} created.`); } // [END pubsub_create_bigquery_subscription] function main( - topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', - bigqueryTableId = 'YOUR_TABLE_ID' -) { +topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', +bigqueryTableId = 'YOUR_TABLE_ID') +{ createBigQuerySubscription( topicNameOrId, subscriptionNameOrId, bigqueryTableId - ).catch(err => { + ).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/createProtoSchema.js b/samples/createProtoSchema.js index 23fc341ba..c313982c3 100644 --- a/samples/createProtoSchema.js +++ b/samples/createProtoSchema.js @@ -37,9 +37,9 @@ // const protoFile = 'path/to/a/proto/schema/file/(.proto)/formatted/in/protcol/buffers'; // Imports the Google Cloud client library -const {PubSub, SchemaTypes} = require('@google-cloud/pubsub'); +const { PubSub, SchemaTypes } = require("@google-cloud/pubsub"); -const fs = require('fs'); +const fs = require("fs"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -58,13 +58,13 @@ async function createProtoSchema(schemaNameOrId, protoFile) { // [END pubsub_create_proto_schema] function main( - schemaNameOrId = 'YOUR_SCHEMA_NAME_OR_ID', - protoFile = 'path/to/a/proto/schema/file/(.proto)/formatted/in/protcol/buffers' -) { - createProtoSchema(schemaNameOrId, protoFile).catch(err => { +schemaNameOrId = 'YOUR_SCHEMA_NAME_OR_ID', +protoFile = 'path/to/a/proto/schema/file/(.proto)/formatted/in/protcol/buffers') +{ + createProtoSchema(schemaNameOrId, protoFile).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/createPushSubscription.js b/samples/createPushSubscription.js index 12afa91b5..c343a7d83 100644 --- a/samples/createPushSubscription.js +++ b/samples/createPushSubscription.js @@ -37,35 +37,38 @@ // const subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); -async function createPushSubscription(topicNameOrId, subscriptionNameOrId) { +async function createPushSubscription( +topicNameOrId, +subscriptionNameOrId) +{ const options = { pushConfig: { // Set to an HTTPS endpoint of your choice. If necessary, register // (authorize) the domain on which the server is hosted. - pushEndpoint: `https://${pubSubClient.projectId}.appspot.com/push`, - }, + pushEndpoint: `https://${pubSubClient.projectId}.appspot.com/push` + } }; - await pubSubClient - .topic(topicNameOrId) - .createSubscription(subscriptionNameOrId, options); + await pubSubClient. + topic(topicNameOrId). + createSubscription(subscriptionNameOrId, options); console.log(`Subscription ${subscriptionNameOrId} created.`); } // [END pubsub_create_push_subscription] function main( - topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID' -) { - createPushSubscription(topicNameOrId, subscriptionNameOrId).catch(err => { +topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID') +{ + createPushSubscription(topicNameOrId, subscriptionNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/createSubscription.js b/samples/createSubscription.js index d0424fbf4..a33dcff53 100644 --- a/samples/createSubscription.js +++ b/samples/createSubscription.js @@ -37,28 +37,31 @@ // const subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require('@google-cloud/pubsub'); // Creates a client; cache this for further use const pubSubClient = new PubSub(); -async function createSubscription(topicNameOrId, subscriptionNameOrId) { +async function createSubscription( +topicNameOrId, +subscriptionNameOrId) +{ // Creates a new subscription - await pubSubClient - .topic(topicNameOrId) - .createSubscription(subscriptionNameOrId); + await pubSubClient. + topic(topicNameOrId). + createSubscription(subscriptionNameOrId); console.log(`Subscription ${subscriptionNameOrId} created.`); } // [END pubsub_create_pull_subscription] function main( - topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID' -) { - createSubscription(topicNameOrId, subscriptionNameOrId).catch(err => { +topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID') +{ + createSubscription(topicNameOrId, subscriptionNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/createSubscriptionWithDeadLetterPolicy.js b/samples/createSubscriptionWithDeadLetterPolicy.js index 708efc18a..48a93cb20 100644 --- a/samples/createSubscriptionWithDeadLetterPolicy.js +++ b/samples/createSubscriptionWithDeadLetterPolicy.js @@ -38,26 +38,26 @@ // const deadLetterTopicNameOrId = 'YOUR_DEAD_LETTER_TOPIC_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); async function createSubscriptionWithDeadLetterPolicy( - topicNameOrId, - subscriptionNameOrId, - deadLetterTopicNameOrId -) { +topicNameOrId, +subscriptionNameOrId, +deadLetterTopicNameOrId) +{ // Creates a new subscription const options = { deadLetterPolicy: { deadLetterTopic: pubSubClient.topic(deadLetterTopicNameOrId).name, - maxDeliveryAttempts: 10, - }, + maxDeliveryAttempts: 10 + } }; - await pubSubClient - .topic(topicNameOrId) - .createSubscription(subscriptionNameOrId, options); + await pubSubClient. + topic(topicNameOrId). + createSubscription(subscriptionNameOrId, options); console.log( `Created subscription ${subscriptionNameOrId} with dead letter topic ${deadLetterTopicNameOrId}.` ); @@ -68,18 +68,18 @@ async function createSubscriptionWithDeadLetterPolicy( // [END pubsub_dead_letter_create_subscription] function main( - topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', - deadLetterTopicNameOrId = 'YOUR_DEAD_LETTER_TOPIC_NAME_OR_ID' -) { +topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', +deadLetterTopicNameOrId = 'YOUR_DEAD_LETTER_TOPIC_NAME_OR_ID') +{ createSubscriptionWithDeadLetterPolicy( topicNameOrId, subscriptionNameOrId, deadLetterTopicNameOrId - ).catch(err => { + ).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/createSubscriptionWithExactlyOnceDelivery.js b/samples/createSubscriptionWithExactlyOnceDelivery.js index 6bbcb1422..4cf017642 100644 --- a/samples/createSubscriptionWithExactlyOnceDelivery.js +++ b/samples/createSubscriptionWithExactlyOnceDelivery.js @@ -37,21 +37,21 @@ // const subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); async function createSubscriptionWithExactlyOnceDelivery( - topicNameOrId, - subscriptionNameOrId -) { +topicNameOrId, +subscriptionNameOrId) +{ // Creates a new subscription - await pubSubClient - .topic(topicNameOrId) - .createSubscription(subscriptionNameOrId, { - enableExactlyOnceDelivery: true, - }); + await pubSubClient. + topic(topicNameOrId). + createSubscription(subscriptionNameOrId, { + enableExactlyOnceDelivery: true + }); console.log( `Created subscription ${subscriptionNameOrId} with exactly-once delivery.` ); @@ -62,16 +62,16 @@ async function createSubscriptionWithExactlyOnceDelivery( // [END pubsub_create_subscription_with_exactly_once_delivery] function main( - topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID' -) { +topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID') +{ createSubscriptionWithExactlyOnceDelivery( topicNameOrId, subscriptionNameOrId - ).catch(err => { + ).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/createSubscriptionWithFiltering.js b/samples/createSubscriptionWithFiltering.js index 9fddeadeb..3bfb11087 100644 --- a/samples/createSubscriptionWithFiltering.js +++ b/samples/createSubscriptionWithFiltering.js @@ -38,22 +38,22 @@ // const filterString = 'YOUR_FILTER_STRING'; // e.g. 'attributes.author="unknown"' // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); async function createSubscriptionWithFilter( - topicNameOrId, - subscriptionNameOrId, - filterString -) { +topicNameOrId, +subscriptionNameOrId, +filterString) +{ // Creates a new subscription - await pubSubClient - .topic(topicNameOrId) - .createSubscription(subscriptionNameOrId, { - filter: filterString, - }); + await pubSubClient. + topic(topicNameOrId). + createSubscription(subscriptionNameOrId, { + filter: filterString + }); console.log( `Created subscription ${subscriptionNameOrId} with filter ${filterString}.` ); @@ -61,18 +61,18 @@ async function createSubscriptionWithFilter( // [END pubsub_create_subscription_with_filter] function main( - topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', - filterString = 'YOUR_FILTER_STRING' -) { +topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', +filterString = 'YOUR_FILTER_STRING') +{ createSubscriptionWithFilter( topicNameOrId, subscriptionNameOrId, filterString - ).catch(err => { + ).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/createSubscriptionWithOrdering.js b/samples/createSubscriptionWithOrdering.js index 933260704..a4c426f5d 100644 --- a/samples/createSubscriptionWithOrdering.js +++ b/samples/createSubscriptionWithOrdering.js @@ -37,21 +37,21 @@ // const subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); async function createSubscriptionWithOrdering( - topicNameOrId, - subscriptionNameOrId -) { +topicNameOrId, +subscriptionNameOrId) +{ // Creates a new subscription - await pubSubClient - .topic(topicNameOrId) - .createSubscription(subscriptionNameOrId, { - enableMessageOrdering: true, - }); + await pubSubClient. + topic(topicNameOrId). + createSubscription(subscriptionNameOrId, { + enableMessageOrdering: true + }); console.log( `Created subscription ${subscriptionNameOrId} with ordering enabled.` ); @@ -62,15 +62,15 @@ async function createSubscriptionWithOrdering( // [END pubsub_enable_subscription_ordering] function main( - topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID' -) { +topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID') +{ createSubscriptionWithOrdering(topicNameOrId, subscriptionNameOrId).catch( - err => { + (err) => { console.error(err.message); process.exitCode = 1; } ); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/createTopic.js b/samples/createTopic.js index fe5308366..e4f38807f 100644 --- a/samples/createTopic.js +++ b/samples/createTopic.js @@ -36,7 +36,7 @@ // const topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -49,10 +49,10 @@ async function createTopic(topicNameOrId) { // [END pubsub_create_topic] async function main(topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID') { - createTopic(topicNameOrId).catch(err => { + createTopic(topicNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/createTopicWithSchema.js b/samples/createTopicWithSchema.js index 7639fc432..f45f100a1 100644 --- a/samples/createTopicWithSchema.js +++ b/samples/createTopicWithSchema.js @@ -38,16 +38,16 @@ // const encodingType = 'BINARY'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); async function createTopicWithSchema( - topicNameOrId, - schemaNameOrId, - encodingType -) { +topicNameOrId, +schemaNameOrId, +encodingType) +{ // Get the fully qualified schema name. const schema = pubSubClient.schema(schemaNameOrId); const fullName = await schema.getName(); @@ -58,24 +58,24 @@ async function createTopicWithSchema( name: topicNameOrId, schemaSettings: { schema: fullName, - encoding: encodingType, - }, + encoding: encodingType + } }); console.log(`Topic ${topicNameOrId} created with schema ${fullName}.`); } // [END pubsub_create_topic_with_schema] function main( - topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', - schemaNameOrId = 'YOUR_SCHEMA_NAME_OR_ID', - encodingType = 'BINARY' -) { +topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', +schemaNameOrId = 'YOUR_SCHEMA_NAME_OR_ID', +encodingType = 'BINARY') +{ createTopicWithSchema(topicNameOrId, schemaNameOrId, encodingType).catch( - err => { + (err) => { console.error(err.message); process.exitCode = 1; } ); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/deleteSchema.js b/samples/deleteSchema.js index 8fad88224..50bc52298 100644 --- a/samples/deleteSchema.js +++ b/samples/deleteSchema.js @@ -36,7 +36,7 @@ // const schemaNameOrId = 'YOUR_SCHEMA_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -50,10 +50,10 @@ async function deleteSchema(schemaNameOrId) { // [END pubsub_delete_schema] function main(schemaNameOrId = 'YOUR_SCHEMA_NAME_OR_ID') { - deleteSchema(schemaNameOrId).catch(err => { + deleteSchema(schemaNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/deleteSubscription.js b/samples/deleteSubscription.js index 5dd30682a..3f21a39e4 100644 --- a/samples/deleteSubscription.js +++ b/samples/deleteSubscription.js @@ -36,7 +36,7 @@ // const subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -49,10 +49,10 @@ async function deleteSubscription(subscriptionNameOrId) { // [END pubsub_delete_subscription] function main(subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID') { - deleteSubscription(subscriptionNameOrId).catch(err => { + deleteSubscription(subscriptionNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/deleteTopic.js b/samples/deleteTopic.js index 69f8419c7..71708b931 100644 --- a/samples/deleteTopic.js +++ b/samples/deleteTopic.js @@ -36,7 +36,7 @@ // const topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -54,10 +54,10 @@ async function deleteTopic(topicNameOrId) { // [END pubsub_delete_topic] function main(topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID') { - deleteTopic(topicNameOrId).catch(err => { + deleteTopic(topicNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/detachSubscription.js b/samples/detachSubscription.js index 14b5c7bdc..18a41d793 100644 --- a/samples/detachSubscription.js +++ b/samples/detachSubscription.js @@ -36,7 +36,7 @@ // const subscriptionNameOrId = 'YOUR_EXISTING_SUBSCRIPTION_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -60,10 +60,10 @@ async function detachSubscription(subscriptionNameOrId) { // [END pubsub_detach_subscription] function main(subscriptionNameOrId = 'YOUR_EXISTING_SUBSCRIPTION_NAME_OR_ID') { - detachSubscription(subscriptionNameOrId).catch(err => { + detachSubscription(subscriptionNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/getSchema.js b/samples/getSchema.js index a2be2c32d..6d188aa95 100644 --- a/samples/getSchema.js +++ b/samples/getSchema.js @@ -36,7 +36,7 @@ // const schemaNameOrId = 'YOUR_SCHEMA_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -50,10 +50,10 @@ async function getSchema(schemaNameOrId) { // [END pubsub_get_schema] function main(schemaNameOrId = 'YOUR_SCHEMA_NAME_OR_ID') { - getSchema(schemaNameOrId).catch(err => { + getSchema(schemaNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/getSubscriptionPolicy.js b/samples/getSubscriptionPolicy.js index 23b1e64c8..bea550ffe 100644 --- a/samples/getSubscriptionPolicy.js +++ b/samples/getSubscriptionPolicy.js @@ -36,26 +36,26 @@ // const subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); async function getSubscriptionPolicy(subscriptionNameOrId) { // Retrieves the IAM policy for the subscription - const [policy] = await pubSubClient - .subscription(subscriptionNameOrId) - .iam.getPolicy(); + const [policy] = await pubSubClient. + subscription(subscriptionNameOrId). + iam.getPolicy(); console.log(`Policy for subscription: ${JSON.stringify(policy.bindings)}.`); } // [END pubsub_get_subscription_policy] function main(subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID') { - getSubscriptionPolicy(subscriptionNameOrId).catch(err => { + getSubscriptionPolicy(subscriptionNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/getTopicPolicy.js b/samples/getTopicPolicy.js index 43307c576..6ea743ceb 100644 --- a/samples/getTopicPolicy.js +++ b/samples/getTopicPolicy.js @@ -36,23 +36,25 @@ // const topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); async function getTopicPolicy(topicNameOrId) { // Retrieves the IAM policy for the topic - const [policy] = await pubSubClient.topic(topicNameOrId).iam.getPolicy(); + const [policy] = await pubSubClient. + topic(topicNameOrId). + iam.getPolicy(); console.log('Policy for topic: %j.', policy.bindings); } // [END pubsub_get_topic_policy] function main(topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID') { - getTopicPolicy(topicNameOrId).catch(err => { + getTopicPolicy(topicNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/listAllTopics.js b/samples/listAllTopics.js index faaf2903f..5be11fdf2 100644 --- a/samples/listAllTopics.js +++ b/samples/listAllTopics.js @@ -31,7 +31,7 @@ // [START pubsub_list_topics] // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -40,15 +40,15 @@ async function listAllTopics() { // Lists all topics in the current project const [topics] = await pubSubClient.getTopics(); console.log('Topics:'); - topics.forEach(topic => console.log(topic.name)); + topics.forEach((topic) => console.log(topic.name)); } // [END pubsub_list_topics] function main() { - listAllTopics().catch(err => { + listAllTopics().catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(); +main(); \ No newline at end of file diff --git a/samples/listSchemas.js b/samples/listSchemas.js index d7d340041..62263f839 100644 --- a/samples/listSchemas.js +++ b/samples/listSchemas.js @@ -32,7 +32,7 @@ // [START pubsub_list_schemas] // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -46,10 +46,10 @@ async function listSchemas() { // [END pubsub_list_schemas] function main() { - listSchemas().catch(err => { + listSchemas().catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(); +main(); \ No newline at end of file diff --git a/samples/listSubscriptions.js b/samples/listSubscriptions.js index df80fd150..c9ba90088 100644 --- a/samples/listSubscriptions.js +++ b/samples/listSubscriptions.js @@ -31,7 +31,7 @@ // [START pubsub_list_subscriptions] // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -40,7 +40,9 @@ async function listSubscriptions() { // Lists all subscriptions in the current project const [subscriptions] = await pubSubClient.getSubscriptions(); console.log('Subscriptions:'); - subscriptions.forEach(subscription => console.log(subscription.name)); + subscriptions.forEach((subscription) => + console.log(subscription.name) + ); } // [END pubsub_list_subscriptions] @@ -48,4 +50,4 @@ function main() { listSubscriptions().catch(console.error); } -main(); +main(); \ No newline at end of file diff --git a/samples/listTopicSubscriptions.js b/samples/listTopicSubscriptions.js index cd27e93a9..8648ff99d 100644 --- a/samples/listTopicSubscriptions.js +++ b/samples/listTopicSubscriptions.js @@ -36,27 +36,29 @@ // const topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); async function listTopicSubscriptions(topicNameOrId) { // Lists all subscriptions for the topic - const [subscriptions] = await pubSubClient - .topic(topicNameOrId) - .getSubscriptions(); + const [subscriptions] = await pubSubClient. + topic(topicNameOrId). + getSubscriptions(); console.log(`Subscriptions for ${topicNameOrId}:`); - subscriptions.forEach(subscription => console.log(subscription.name)); + subscriptions.forEach((subscription) => + console.log(subscription.name) + ); } // [END pubsub_list_topic_subscriptions] function main(topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID') { - listTopicSubscriptions(topicNameOrId).catch(err => { + listTopicSubscriptions(topicNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/listenForAvroRecords.js b/samples/listenForAvroRecords.js index b0dbc7aee..dbe9780a3 100644 --- a/samples/listenForAvroRecords.js +++ b/samples/listenForAvroRecords.js @@ -37,13 +37,13 @@ // const timeout = 60; // Imports the Google Cloud client library -const {PubSub, Schema, Encodings} = require('@google-cloud/pubsub'); +const { PubSub, Schema, Encodings } = require("@google-cloud/pubsub"); // Node FS library, to load definitions -const fs = require('fs'); +const fs = require("fs"); // And the Apache Avro library -const avro = require('avro-js'); +const avro = require("avro-js"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -53,14 +53,14 @@ function listenForAvroRecords(subscriptionNameOrId, timeout) { const subscription = pubSubClient.subscription(subscriptionNameOrId); // Make an encoder using the official avro-js library. - const definition = fs - .readFileSync('system-test/fixtures/provinces.avsc') - .toString(); + const definition = fs. + readFileSync('system-test/fixtures/provinces.avsc'). + toString(); const type = avro.parse(definition); // Create an event handler to handle messages let messageCount = 0; - const messageHandler = async message => { + const messageHandler = async (message) => { // "Ack" (acknowledge receipt of) the message message.ack(); @@ -97,9 +97,9 @@ function listenForAvroRecords(subscriptionNameOrId, timeout) { // [END pubsub_subscribe_avro_records] function main( - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', - timeout = 60 -) { +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', +timeout = 60) +{ timeout = Number(timeout); try { @@ -110,4 +110,4 @@ function main( } } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/listenForErrors.js b/samples/listenForErrors.js index 75f1c1bae..e943763de 100644 --- a/samples/listenForErrors.js +++ b/samples/listenForErrors.js @@ -37,7 +37,7 @@ // const timeout = 10; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -47,7 +47,7 @@ function listenForErrors(subscriptionNameOrId, timeout) { const subscription = pubSubClient.subscription(subscriptionNameOrId); // Create an event handler to handle messages - const messageHandler = message => { + const messageHandler = (message) => { // Do something with the message console.log(`Message: ${message}`); @@ -56,7 +56,7 @@ function listenForErrors(subscriptionNameOrId, timeout) { }; // Create an event handler to handle errors - const errorHandler = error => { + const errorHandler = (error) => { // Do something with the error console.error(`ERROR: ${error}`); throw error; @@ -75,11 +75,11 @@ function listenForErrors(subscriptionNameOrId, timeout) { // [END pubsub_subscriber_error_listener] function main( - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', - timeout = 10 -) { +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', +timeout = 10) +{ timeout = Number(timeout); listenForErrors(subscriptionNameOrId, timeout); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/listenForMessages.js b/samples/listenForMessages.js index 3f3f35547..7466a739c 100644 --- a/samples/listenForMessages.js +++ b/samples/listenForMessages.js @@ -38,7 +38,7 @@ // const timeout = 60; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -49,7 +49,7 @@ function listenForMessages(subscriptionNameOrId, timeout) { // Create an event handler to handle messages let messageCount = 0; - const messageHandler = message => { + const messageHandler = (message) => { console.log(`Received message ${message.id}:`); console.log(`\tData: ${message.data}`); console.log(`\tAttributes: ${message.attributes}`); @@ -72,11 +72,11 @@ function listenForMessages(subscriptionNameOrId, timeout) { // [END pubsub_quickstart_subscriber] function main( - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', - timeout = 60 -) { +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', +timeout = 60) +{ timeout = Number(timeout); listenForMessages(subscriptionNameOrId, timeout); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/listenForMessagesWithExactlyOnceDelivery.js b/samples/listenForMessagesWithExactlyOnceDelivery.js index 1027761a0..be4558106 100644 --- a/samples/listenForMessagesWithExactlyOnceDelivery.js +++ b/samples/listenForMessagesWithExactlyOnceDelivery.js @@ -36,21 +36,21 @@ // const subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); async function listenForMessagesWithExactlyOnceDelivery( - subscriptionNameOrId, - timeout -) { +subscriptionNameOrId, +timeout) +{ // References an existing subscription const subscription = pubSubClient.subscription(subscriptionNameOrId); // Create an event handler to handle messages let messageCount = 0; - const messageHandler = async message => { + const messageHandler = async (message) => { console.log(`Received message ${message.id}:`); console.log(`\tData: ${message.data}`); console.log(`\tAttributes: ${message.attributes}`); @@ -88,16 +88,16 @@ async function listenForMessagesWithExactlyOnceDelivery( // [END pubsub_subscriber_exactly_once] function main( - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', - timeout = 60 -) { +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', +timeout = 60) +{ listenForMessagesWithExactlyOnceDelivery( subscriptionNameOrId, Number(timeout) - ).catch(err => { + ).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/listenForProtobufMessages.js b/samples/listenForProtobufMessages.js index 933797fb2..42f069877 100644 --- a/samples/listenForProtobufMessages.js +++ b/samples/listenForProtobufMessages.js @@ -37,15 +37,18 @@ // const timeout = 60; // Imports the Google Cloud client library -const {PubSub, Schema, Encodings} = require('@google-cloud/pubsub'); +const { PubSub, Schema, Encodings } = require("@google-cloud/pubsub"); // And the protobufjs library -const protobuf = require('protobufjs'); +const protobuf = require("protobufjs"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); -async function listenForProtobufMessages(subscriptionNameOrId, timeout) { +async function listenForProtobufMessages( +subscriptionNameOrId, +timeout) +{ // References an existing subscription const subscription = pubSubClient.subscription(subscriptionNameOrId); @@ -58,7 +61,7 @@ async function listenForProtobufMessages(subscriptionNameOrId, timeout) { // Create an event handler to handle messages let messageCount = 0; - const messageHandler = async message => { + const messageHandler = async (message) => { // "Ack" (acknowledge receipt of) the message message.ack(); @@ -99,15 +102,15 @@ async function listenForProtobufMessages(subscriptionNameOrId, timeout) { // [END pubsub_subscribe_proto_messages] function main( - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', - timeout = 60 -) { +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', +timeout = 60) +{ timeout = Number(timeout); - listenForProtobufMessages(subscriptionNameOrId, timeout).catch(err => { + listenForProtobufMessages(subscriptionNameOrId, timeout).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/listenWithCustomAttributes.js b/samples/listenWithCustomAttributes.js index b231d431f..d786c0950 100644 --- a/samples/listenWithCustomAttributes.js +++ b/samples/listenWithCustomAttributes.js @@ -37,20 +37,23 @@ // const timeout = 60; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); -async function listenWithCustomAttributes(subscriptionNameOrId, timeout) { +async function listenWithCustomAttributes( +subscriptionNameOrId, +timeout) +{ // References an existing subscription, e.g. "my-subscription" const subscription = pubSubClient.subscription(subscriptionNameOrId); // Create an event handler to handle messages - const messageHandler = message => { + const messageHandler = (message) => { console.log( `Received message: id ${message.id}, data ${ - message.data + message.data }, attributes: ${JSON.stringify(message.attributes)}` ); @@ -67,14 +70,14 @@ async function listenWithCustomAttributes(subscriptionNameOrId, timeout) { // [END pubsub_subscriber_async_pull_custom_attributes] async function main( - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', - timeout = 60 -) { +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', +timeout = 60) +{ timeout = Number(timeout); - listenWithCustomAttributes(subscriptionNameOrId, timeout).catch(err => { + listenWithCustomAttributes(subscriptionNameOrId, timeout).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/modifyPushConfig.js b/samples/modifyPushConfig.js index df35aa7d9..cc7b308f5 100644 --- a/samples/modifyPushConfig.js +++ b/samples/modifyPushConfig.js @@ -37,34 +37,37 @@ // const subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); -async function modifyPushConfig(topicNameOrId, subscriptionNameOrId) { +async function modifyPushConfig( +topicNameOrId, +subscriptionNameOrId) +{ const options = { // Set to an HTTPS endpoint of your choice. If necessary, register // (authorize) the domain on which the server is hosted. - pushEndpoint: `https://${pubSubClient.projectId}.appspot.com/push`, + pushEndpoint: `https://${pubSubClient.projectId}.appspot.com/push` }; - await pubSubClient - .topic(topicNameOrId) - .subscription(subscriptionNameOrId) - .modifyPushConfig(options); + await pubSubClient. + topic(topicNameOrId). + subscription(subscriptionNameOrId). + modifyPushConfig(options); console.log(`Modified push config for subscription ${subscriptionNameOrId}.`); } // [END pubsub_update_push_configuration] function main( - topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID' -) { - modifyPushConfig(topicNameOrId, subscriptionNameOrId).catch(err => { +topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID') +{ + modifyPushConfig(topicNameOrId, subscriptionNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/publishAvroRecords.js b/samples/publishAvroRecords.js index f40f3e418..0f0d7f10b 100644 --- a/samples/publishAvroRecords.js +++ b/samples/publishAvroRecords.js @@ -36,15 +36,20 @@ // const topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub, Encodings} = require('@google-cloud/pubsub'); +const { PubSub, Encodings } = require("@google-cloud/pubsub"); // And the Apache Avro library -const avro = require('avro-js'); -const fs = require('fs'); +const avro = require("avro-js"); +const fs = require("fs"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); + + + + + async function publishAvroRecords(topicNameOrId) { // Get the topic metadata to learn about its schema encoding. const topic = pubSubClient.topic(topicNameOrId); @@ -58,15 +63,15 @@ async function publishAvroRecords(topicNameOrId) { const schemaEncoding = topicSchemaMetadata.encoding; // Make an encoder using the official avro-js library. - const definition = fs - .readFileSync('system-test/fixtures/provinces.avsc') - .toString(); + const definition = fs. + readFileSync('system-test/fixtures/provinces.avsc'). + toString(); const type = avro.parse(definition); // Encode the message. const province = { name: 'Ontario', - post_abbr: 'ON', + post_abbr: 'ON' }; let dataBuffer; switch (schemaEncoding) { @@ -91,10 +96,10 @@ async function publishAvroRecords(topicNameOrId) { // [END pubsub_publish_avro_records] function main(topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID') { - publishAvroRecords(topicNameOrId).catch(err => { + publishAvroRecords(topicNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/publishBatchedMessages.js b/samples/publishBatchedMessages.js index 0a45a0880..64fa2c119 100644 --- a/samples/publishBatchedMessages.js +++ b/samples/publishBatchedMessages.js @@ -39,25 +39,25 @@ // const maxWaitTime = 10; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); async function publishBatchedMessages( - topicNameOrId, - data, - maxMessages, - maxWaitTime -) { +topicNameOrId, +data, +maxMessages, +maxWaitTime) +{ // Publishes the message as a string, e.g. "Hello, world!" or JSON.stringify(someObject) const dataBuffer = Buffer.from(data); const publishOptions = { batching: { maxMessages: maxMessages, - maxMilliseconds: maxWaitTime * 1000, - }, + maxMilliseconds: maxWaitTime * 1000 + } }; const batchPublisher = pubSubClient.topic(topicNameOrId, publishOptions); @@ -66,7 +66,7 @@ async function publishBatchedMessages( promises.push( (async () => { const messageId = await batchPublisher.publishMessage({ - data: dataBuffer, + data: dataBuffer }); console.log(`Message ${messageId} published.`); })() @@ -77,19 +77,19 @@ async function publishBatchedMessages( // [END pubsub_publisher_batch_settings] function main( - topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', - data = JSON.stringify({foo: 'bar'}), - maxMessages = 10, - maxWaitTime = 10 -) { +topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', +data = JSON.stringify({ foo: 'bar' }), +maxMessages = 10, +maxWaitTime = 10) +{ maxMessages = Number(maxMessages); maxWaitTime = Number(maxWaitTime); publishBatchedMessages(topicNameOrId, data, maxMessages, maxWaitTime).catch( - err => { + (err) => { console.error(err.message); process.exitCode = 1; } ); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/publishMessage.js b/samples/publishMessage.js index 2436b07fb..963a482b0 100644 --- a/samples/publishMessage.js +++ b/samples/publishMessage.js @@ -38,7 +38,7 @@ // const data = JSON.stringify({foo: 'bar'}); // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -48,12 +48,14 @@ async function publishMessage(topicNameOrId, data) { const dataBuffer = Buffer.from(data); try { - const messageId = await pubSubClient - .topic(topicNameOrId) - .publishMessage({data: dataBuffer}); + const messageId = await pubSubClient. + topic(topicNameOrId). + publishMessage({ data: dataBuffer }); console.log(`Message ${messageId} published.`); } catch (error) { - console.error(`Received error while publishing: ${error.message}`); + console.error( + `Received error while publishing: ${error.message}` + ); process.exitCode = 1; } } @@ -61,13 +63,13 @@ async function publishMessage(topicNameOrId, data) { // [END pubsub_quickstart_publisher] function main( - topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', - data = JSON.stringify({foo: 'bar'}) -) { - publishMessage(topicNameOrId, data).catch(err => { +topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', +data = JSON.stringify({ foo: 'bar' })) +{ + publishMessage(topicNameOrId, data).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/publishMessageWithCustomAttributes.js b/samples/publishMessageWithCustomAttributes.js index 3c2e6b43a..cf8da6176 100644 --- a/samples/publishMessageWithCustomAttributes.js +++ b/samples/publishMessageWithCustomAttributes.js @@ -37,33 +37,40 @@ // const data = JSON.stringify({foo: 'bar'}); // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); -async function publishMessageWithCustomAttributes(topicNameOrId, data) { + + + + +async function publishMessageWithCustomAttributes( +topicNameOrId, +data) +{ // Publishes the message as a string, e.g. "Hello, world!" or JSON.stringify(someObject) const dataBuffer = Buffer.from(data); // Add two custom attributes, origin and username, to the message const customAttributes = { origin: 'nodejs-sample', - username: 'gcp', + username: 'gcp' }; - const messageId = await pubSubClient - .topic(topicNameOrId) - .publishMessage({data: dataBuffer, attributes: customAttributes}); + const messageId = await pubSubClient. + topic(topicNameOrId). + publishMessage({ data: dataBuffer, attributes: customAttributes }); console.log(`Message ${messageId} published.`); } // [END pubsub_publish_custom_attributes] function main( - topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', - data = JSON.stringify({foo: 'bar'}) -) { +topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', +data = JSON.stringify({ foo: 'bar' })) +{ publishMessageWithCustomAttributes(topicNameOrId, data).catch(console.error); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/publishOrderedMessage.js b/samples/publishOrderedMessage.js index bb4e0cc4d..3d573c377 100644 --- a/samples/publishOrderedMessage.js +++ b/samples/publishOrderedMessage.js @@ -41,16 +41,20 @@ // const orderingKey = 'key1'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub({ // Sending messages to the same region ensures they are received in order // even when multiple publishers are used. - apiEndpoint: 'us-east1-pubsub.googleapis.com:443', + apiEndpoint: 'us-east1-pubsub.googleapis.com:443' }); -async function publishOrderedMessage(topicNameOrId, data, orderingKey) { +async function publishOrderedMessage( +topicNameOrId, +data, +orderingKey) +{ // Publishes the message as a string, e.g. "Hello, world!" or JSON.stringify(someObject) const dataBuffer = Buffer.from(data); @@ -58,17 +62,17 @@ async function publishOrderedMessage(topicNameOrId, data, orderingKey) { // you want to receive in order, relative to each other. const message = { data: dataBuffer, - orderingKey: orderingKey, + orderingKey: orderingKey }; const publishOptions = { - messageOrdering: true, + messageOrdering: true }; // Publishes the message - const messageId = await pubSubClient - .topic(topicNameOrId, publishOptions) - .publishMessage(message); + const messageId = await pubSubClient. + topic(topicNameOrId, publishOptions). + publishMessage(message); console.log(`Message ${messageId} published.`); @@ -77,14 +81,14 @@ async function publishOrderedMessage(topicNameOrId, data, orderingKey) { // [END pubsub_publish_with_ordering_keys] async function main( - topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', - data = JSON.stringify({foo: 'bar'}), - orderingKey = 'key1' -) { - await publishOrderedMessage(topicNameOrId, data, orderingKey).catch(err => { +topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', +data = JSON.stringify({ foo: 'bar' }), +orderingKey = 'key1') +{ + await publishOrderedMessage(topicNameOrId, data, orderingKey).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/publishProtobufMessages.js b/samples/publishProtobufMessages.js index bab100563..6019a8bfc 100644 --- a/samples/publishProtobufMessages.js +++ b/samples/publishProtobufMessages.js @@ -36,14 +36,19 @@ // const topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub, Encodings} = require('@google-cloud/pubsub'); +const { PubSub, Encodings } = require("@google-cloud/pubsub"); // And the protobufjs library -const protobuf = require('protobufjs'); +const protobuf = require("protobufjs"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); + + + + + async function publishProtobufMessages(topicNameOrId) { // Get the topic metadata to learn about its schema. const topic = pubSubClient.topic(topicNameOrId); @@ -59,7 +64,7 @@ async function publishProtobufMessages(topicNameOrId) { // Encode the message. const province = { name: 'Ontario', - postAbbr: 'ON', + postAbbr: 'ON' }; // Make an encoder using the protobufjs library. @@ -93,10 +98,10 @@ async function publishProtobufMessages(topicNameOrId) { // [END pubsub_publish_proto_messages] function main(topicName = 'YOUR_TOPIC_NAME') { - publishProtobufMessages(topicName).catch(err => { + publishProtobufMessages(topicName).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/publishWithFlowControl.js b/samples/publishWithFlowControl.js index 7e1193f79..94cbdfd3b 100644 --- a/samples/publishWithFlowControl.js +++ b/samples/publishWithFlowControl.js @@ -36,7 +36,7 @@ // const topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -46,8 +46,8 @@ async function publishWithFlowControl(topicNameOrId) { const options = { flowControlOptions: { maxOutstandingMessages: 50, - maxOutstandingBytes: 10 * 1024 * 1024, // 10 MB - }, + maxOutstandingBytes: 10 * 1024 * 1024 // 10 MB + } }; // Get a publisher. @@ -58,7 +58,7 @@ async function publishWithFlowControl(topicNameOrId) { const flow = topic.flowControlled(); // Publish messages in a fast loop. - const testMessage = {data: Buffer.from('test!')}; + const testMessage = { data: Buffer.from('test!') }; for (let i = 0; i < 1000; i++) { // You can also just `await` on `publish()` unconditionally, but if // you want to avoid pausing to the event loop on each iteration, @@ -78,10 +78,10 @@ async function publishWithFlowControl(topicNameOrId) { // [END pubsub_publisher_flow_control] function main(topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID') { - publishWithFlowControl(topicNameOrId).catch(err => { + publishWithFlowControl(topicNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/publishWithRetrySettings.js b/samples/publishWithRetrySettings.js index 3c50b5a99..d72520de8 100644 --- a/samples/publishWithRetrySettings.js +++ b/samples/publishWithRetrySettings.js @@ -39,13 +39,18 @@ // Imports the Google Cloud client library. v1 is for the lower level // proto access. -const {v1} = require('@google-cloud/pubsub'); +const { v1 } = require("@google-cloud/pubsub"); // Creates a publisher client. const publisherClient = new v1.PublisherClient({ + // optional auth parameters }); -async function publishWithRetrySettings(projectId, topicNameOrId, data) { +async function publishWithRetrySettings( +projectId, +topicNameOrId, +data) +{ const formattedTopic = publisherClient.projectTopicPath( projectId, topicNameOrId @@ -54,14 +59,14 @@ async function publishWithRetrySettings(projectId, topicNameOrId, data) { // Publishes the message as a string, e.g. "Hello, world!" or JSON.stringify(someObject) const dataBuffer = Buffer.from(data); const messagesElement = { - data: dataBuffer, + data: dataBuffer }; const messages = [messagesElement]; // Build the request const request = { topic: formattedTopic, - messages: messages, + messages: messages }; // Retry settings control how the publisher handles retryable failures. Default values are shown. @@ -69,13 +74,13 @@ async function publishWithRetrySettings(projectId, topicNameOrId, data) { // The `backoffSettings` object lets you specify the behaviour of retries over time. const retrySettings = { retryCodes: [ - 10, // 'ABORTED' - 1, // 'CANCELLED', - 4, // 'DEADLINE_EXCEEDED' - 13, // 'INTERNAL' - 8, // 'RESOURCE_EXHAUSTED' - 14, // 'UNAVAILABLE' - 2, // 'UNKNOWN' + 10, // 'ABORTED' + 1, // 'CANCELLED', + 4, // 'DEADLINE_EXCEEDED' + 13, // 'INTERNAL' + 8, // 'RESOURCE_EXHAUSTED' + 14, // 'UNAVAILABLE' + 2 // 'UNKNOWN' ], backoffSettings: { // The initial delay time, in milliseconds, between the completion @@ -96,26 +101,26 @@ async function publishWithRetrySettings(projectId, topicNameOrId, data) { maxRpcTimeoutMillis: 600000, // The total time, in milliseconds, starting from when the initial request is sent, // after which an error will be returned, regardless of the retrying attempts made meanwhile. - totalTimeoutMillis: 600000, - }, + totalTimeoutMillis: 600000 + } }; const [response] = await publisherClient.publish(request, { - retry: retrySettings, + retry: retrySettings }); console.log(`Message ${response.messageIds} published.`); } // [END pubsub_publisher_retry_settings] function main( - projectId = 'YOUR_PROJECT_ID', - topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', - data = JSON.stringify({foo: 'bar'}) -) { - publishWithRetrySettings(projectId, topicNameOrId, data).catch(err => { +projectId = 'YOUR_PROJECT_ID', +topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', +data = JSON.stringify({ foo: 'bar' })) +{ + publishWithRetrySettings(projectId, topicNameOrId, data).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/quickstart.js b/samples/quickstart.js index a5beb94bb..2b2321f34 100644 --- a/samples/quickstart.js +++ b/samples/quickstart.js @@ -23,15 +23,15 @@ // [START pubsub_quickstart_create_topic] // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); async function quickstart( - projectId = 'your-project-id', // Your Google Cloud Platform project ID - topicNameOrId = 'my-topic', // Name for the new topic to create - subscriptionName = 'my-sub' // Name for the new subscription to create +projectId = 'your-project-id', // Your Google Cloud Platform project ID +topicNameOrId = 'my-topic', // Name for the new topic to create +subscriptionName = 'my-sub' // Name for the new subscription to create ) { // Instantiates a client - const pubsub = new PubSub({projectId}); + const pubsub = new PubSub({ projectId }); // Creates a new topic const [topic] = await pubsub.createTopic(topicNameOrId); @@ -41,24 +41,24 @@ async function quickstart( const [subscription] = await topic.createSubscription(subscriptionName); // Receive callbacks for new messages on the subscription - subscription.on('message', message => { + subscription.on('message', (message) => { console.log('Received message:', message.data.toString()); process.exit(0); }); // Receive callbacks for errors on the subscription - subscription.on('error', error => { + subscription.on('error', (error) => { console.error('Received error:', error); process.exit(1); }); // Send a message to the topic - topic.publishMessage({data: Buffer.from('Test message!')}); + topic.publishMessage({ data: Buffer.from('Test message!') }); } // [END pubsub_quickstart_create_topic] -process.on('unhandledRejection', err => { +process.on('unhandledRejection', (err) => { console.error(err.message); process.exitCode = 1; }); -quickstart(...process.argv.slice(2)); +quickstart(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/removeDeadLetterPolicy.js b/samples/removeDeadLetterPolicy.js index 3268678ab..6e42487d0 100644 --- a/samples/removeDeadLetterPolicy.js +++ b/samples/removeDeadLetterPolicy.js @@ -37,20 +37,23 @@ // const subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); -async function removeDeadLetterPolicy(topicNameOrId, subscriptionNameOrId) { +async function removeDeadLetterPolicy( +topicNameOrId, +subscriptionNameOrId) +{ const metadata = { - deadLetterPolicy: null, + deadLetterPolicy: null }; - await pubSubClient - .topic(topicNameOrId) - .subscription(subscriptionNameOrId) - .setMetadata(metadata); + await pubSubClient. + topic(topicNameOrId). + subscription(subscriptionNameOrId). + setMetadata(metadata); console.log( `Removed dead letter topic from ${subscriptionNameOrId} subscription.` @@ -59,13 +62,13 @@ async function removeDeadLetterPolicy(topicNameOrId, subscriptionNameOrId) { // [END pubsub_dead_letter_remove] function main( - topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID' -) { - removeDeadLetterPolicy(topicNameOrId, subscriptionNameOrId).catch(err => { +topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID') +{ + removeDeadLetterPolicy(topicNameOrId, subscriptionNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/resumePublish.js b/samples/resumePublish.js index 3dbe4b242..fbb642940 100644 --- a/samples/resumePublish.js +++ b/samples/resumePublish.js @@ -39,17 +39,21 @@ // const orderingKey = 'key1'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); -async function resumePublish(topicNameOrId, data, orderingKey) { +async function resumePublish( +topicNameOrId, +data, +orderingKey) +{ // Publishes the message as a string, e.g. "Hello, world!" or JSON.stringify(someObject) const dataBuffer = Buffer.from(data); const publishOptions = { - messageOrdering: true, + messageOrdering: true }; // Publishes the message @@ -57,7 +61,7 @@ async function resumePublish(topicNameOrId, data, orderingKey) { try { const message = { data: dataBuffer, - orderingKey: orderingKey, + orderingKey: orderingKey }; const messageId = await publisher.publishMessage(message); console.log(`Message ${messageId} published.`); @@ -72,11 +76,11 @@ async function resumePublish(topicNameOrId, data, orderingKey) { // [END pubsub_resume_publish_with_ordering_keys] async function main( - topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', - data = JSON.stringify({foo: 'bar'}), - orderingKey = 'key1' -) { - return await resumePublish(topicNameOrId, data, orderingKey).catch(err => { +topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', +data = JSON.stringify({ foo: 'bar' }), +orderingKey = 'key1') +{ + return await resumePublish(topicNameOrId, data, orderingKey).catch((err) => { console.error(err.message); process.exitCode = 1; }); @@ -87,4 +91,4 @@ module.exports.resumePublishFunc = resumePublish; if (require.main === module) { main(...process.argv.slice(2)).catch(console.error); -} +} \ No newline at end of file diff --git a/samples/setSubscriptionPolicy.js b/samples/setSubscriptionPolicy.js index 4cabd7b20..28af85e2d 100644 --- a/samples/setSubscriptionPolicy.js +++ b/samples/setSubscriptionPolicy.js @@ -36,7 +36,7 @@ // const subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -45,33 +45,33 @@ async function setSubscriptionPolicy(subscriptionNameOrId) { // The new IAM policy const newPolicy = { bindings: [ - { - // Add a group as editors - role: 'roles/pubsub.editor', - members: ['group:cloud-logs@google.com'], - }, - { - // Add all users as viewers - role: 'roles/pubsub.viewer', - members: ['allUsers'], - }, - ], + { + // Add a group as editors + role: 'roles/pubsub.editor', + members: ['group:cloud-logs@google.com'] + }, + { + // Add all users as viewers + role: 'roles/pubsub.viewer', + members: ['allUsers'] + }] + }; // Updates the IAM policy for the subscription - const [updatedPolicy] = await pubSubClient - .subscription(subscriptionNameOrId) - .iam.setPolicy(newPolicy); + const [updatedPolicy] = await pubSubClient. + subscription(subscriptionNameOrId). + iam.setPolicy(newPolicy); console.log('Updated policy for subscription: %j', updatedPolicy.bindings); } // [END pubsub_set_subscription_policy] function main(subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID') { - setSubscriptionPolicy(subscriptionNameOrId).catch(err => { + setSubscriptionPolicy(subscriptionNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/setTopicPolicy.js b/samples/setTopicPolicy.js index 133af5e83..bb53735f2 100644 --- a/samples/setTopicPolicy.js +++ b/samples/setTopicPolicy.js @@ -36,7 +36,7 @@ // const topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); @@ -45,32 +45,32 @@ async function setTopicPolicy(topicNameOrId) { // The new IAM policy const newPolicy = { bindings: [ - { - // Add a group as editors - role: 'roles/pubsub.editor', - members: ['group:cloud-logs@google.com'], - }, - { - // Add all users as viewers - role: 'roles/pubsub.viewer', - members: ['allUsers'], - }, - ], + { + // Add a group as editors + role: 'roles/pubsub.editor', + members: ['group:cloud-logs@google.com'] + }, + { + // Add all users as viewers + role: 'roles/pubsub.viewer', + members: ['allUsers'] + }] + }; // Updates the IAM policy for the topic - const [updatedPolicy] = await pubSubClient - .topic(topicNameOrId) - .iam.setPolicy(newPolicy); + const [updatedPolicy] = await pubSubClient. + topic(topicNameOrId). + iam.setPolicy(newPolicy); console.log('Updated policy for topic: %j', updatedPolicy.bindings); } // [END pubsub_set_topic_policy] function main(topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID') { - setTopicPolicy(topicNameOrId).catch(err => { + setTopicPolicy(topicNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/subscribeWithFlowControlSettings.js b/samples/subscribeWithFlowControlSettings.js index 367d701c2..15b723a38 100644 --- a/samples/subscribeWithFlowControlSettings.js +++ b/samples/subscribeWithFlowControlSettings.js @@ -40,20 +40,20 @@ // const timeout = 10; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); async function subscribeWithFlowControlSettings( - subscriptionNameOrId, - maxInProgress, - timeout -) { +subscriptionNameOrId, +maxInProgress, +timeout) +{ const subscriberOptions = { flowControl: { - maxMessages: maxInProgress, - }, + maxMessages: maxInProgress + } }; // References an existing subscription. @@ -67,7 +67,7 @@ async function subscribeWithFlowControlSettings( `Subscriber to subscription ${subscription.name} is ready to receive messages at a controlled volume of ${maxInProgress} messages.` ); - const messageHandler = message => { + const messageHandler = (message) => { console.log(`Received message: ${message.id}`); console.log(`\tData: ${message.data}`); console.log(`\tAttributes: ${message.attributes}`); @@ -86,10 +86,10 @@ async function subscribeWithFlowControlSettings( // [END pubsub_subscriber_flow_settings] function main( - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', - maxInProgress = 1, - timeout = 10 -) { +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID', +maxInProgress = 1, +timeout = 10) +{ maxInProgress = Number(maxInProgress); timeout = Number(timeout); @@ -97,10 +97,10 @@ function main( subscriptionNameOrId, maxInProgress, timeout - ).catch(err => { + ).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/synchronousPull.js b/samples/synchronousPull.js index 755143ebe..1fa5e45d7 100644 --- a/samples/synchronousPull.js +++ b/samples/synchronousPull.js @@ -38,23 +38,26 @@ // Imports the Google Cloud client library. v1 is for the lower level // proto access. -const {v1} = require('@google-cloud/pubsub'); +const { v1 } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use. const subClient = new v1.SubscriberClient(); -async function synchronousPull(projectId, subscriptionNameOrId) { +async function synchronousPull( +projectId, +subscriptionNameOrId) +{ // The low level API client requires a name only. const formattedSubscription = - subscriptionNameOrId.indexOf('/') >= 0 - ? subscriptionNameOrId - : subClient.subscriptionPath(projectId, subscriptionNameOrId); + subscriptionNameOrId.indexOf('/') >= 0 ? + subscriptionNameOrId : + subClient.subscriptionPath(projectId, subscriptionNameOrId); // The maximum number of messages returned for this request. // Pub/Sub may return fewer than the number specified. const request = { subscription: formattedSubscription, - maxMessages: 10, + maxMessages: 10 }; // The subscriber pulls a specified number of messages. @@ -74,7 +77,7 @@ async function synchronousPull(projectId, subscriptionNameOrId) { // these individually, but this is more efficient. const ackRequest = { subscription: formattedSubscription, - ackIds: ackIds, + ackIds: ackIds }; await subClient.acknowledge(ackRequest); @@ -85,13 +88,13 @@ async function synchronousPull(projectId, subscriptionNameOrId) { // [END pubsub_subscriber_sync_pull] function main( - projectId = 'YOUR_PROJECT_ID', - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID' -) { - synchronousPull(projectId, subscriptionNameOrId).catch(err => { +projectId = 'YOUR_PROJECT_ID', +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID') +{ + synchronousPull(projectId, subscriptionNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/synchronousPullWithDeliveryAttempts.js b/samples/synchronousPullWithDeliveryAttempts.js index 40c76bdc1..387657d15 100644 --- a/samples/synchronousPullWithDeliveryAttempts.js +++ b/samples/synchronousPullWithDeliveryAttempts.js @@ -38,26 +38,26 @@ // Imports the Google Cloud client library. v1 is for the lower level // proto access. -const {v1} = require('@google-cloud/pubsub'); +const { v1 } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use. const subClient = new v1.SubscriberClient(); async function synchronousPullWithDeliveryAttempts( - projectId, - subscriptionNameOrId -) { +projectId, +subscriptionNameOrId) +{ // The low level API client requires a name only. const formattedSubscription = - subscriptionNameOrId.indexOf('/') >= 0 - ? subscriptionNameOrId - : subClient.subscriptionPath(projectId, subscriptionNameOrId); + subscriptionNameOrId.indexOf('/') >= 0 ? + subscriptionNameOrId : + subClient.subscriptionPath(projectId, subscriptionNameOrId); // The maximum number of messages returned for this request. // Pub/Sub may return fewer than the number specified. const request = { subscription: formattedSubscription, - maxMessages: 10, + maxMessages: 10 }; // The subscriber pulls a specified number of messages. @@ -77,7 +77,7 @@ async function synchronousPullWithDeliveryAttempts( // these individually, but this is more efficient. const ackRequest = { subscription: formattedSubscription, - ackIds: ackIds, + ackIds: ackIds }; await subClient.acknowledge(ackRequest); @@ -86,15 +86,15 @@ async function synchronousPullWithDeliveryAttempts( // [END pubsub_dead_letter_delivery_attempt] function main( - projectId = 'YOUR_PROJECT_ID', - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID' -) { +projectId = 'YOUR_PROJECT_ID', +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID') +{ synchronousPullWithDeliveryAttempts(projectId, subscriptionNameOrId).catch( - err => { + (err) => { console.error(err.message); process.exitCode = 1; } ); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/testSubscriptionPermissions.js b/samples/testSubscriptionPermissions.js index caa74e88f..44c077dac 100644 --- a/samples/testSubscriptionPermissions.js +++ b/samples/testSubscriptionPermissions.js @@ -36,31 +36,31 @@ // const subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); async function testSubscriptionPermissions(subscriptionNameOrId) { const permissionsToTest = [ - 'pubsub.subscriptions.consume', - 'pubsub.subscriptions.update', - ]; + 'pubsub.subscriptions.consume', + 'pubsub.subscriptions.update']; + // Tests the IAM policy for the specified subscription - const [permissions] = await pubSubClient - .subscription(subscriptionNameOrId) - .iam.testPermissions(permissionsToTest); + const [permissions] = await pubSubClient. + subscription(subscriptionNameOrId). + iam.testPermissions(permissionsToTest); console.log('Tested permissions for subscription: %j', permissions); } // [END pubsub_test_subscription_permissions] function main(subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID') { - testSubscriptionPermissions(subscriptionNameOrId).catch(err => { + testSubscriptionPermissions(subscriptionNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/testTopicPermissions.js b/samples/testTopicPermissions.js index d68cac864..81203a546 100644 --- a/samples/testTopicPermissions.js +++ b/samples/testTopicPermissions.js @@ -36,32 +36,32 @@ // const topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); async function testTopicPermissions(topicNameOrId) { const permissionsToTest = [ - 'pubsub.topics.attachSubscription', - 'pubsub.topics.publish', - 'pubsub.topics.update', - ]; + 'pubsub.topics.attachSubscription', + 'pubsub.topics.publish', + 'pubsub.topics.update']; + // Tests the IAM policy for the specified topic - const [permissions] = await pubSubClient - .topic(topicNameOrId) - .iam.testPermissions(permissionsToTest); + const [permissions] = await pubSubClient. + topic(topicNameOrId). + iam.testPermissions(permissionsToTest); console.log('Tested permissions for topic: %j', permissions); } // [END pubsub_test_topic_permissions] function main(topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID') { - testTopicPermissions(topicNameOrId).catch(err => { + testTopicPermissions(topicNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file diff --git a/samples/updateDeadLetterPolicy.js b/samples/updateDeadLetterPolicy.js index b3d782d00..0b2f55d83 100644 --- a/samples/updateDeadLetterPolicy.js +++ b/samples/updateDeadLetterPolicy.js @@ -37,36 +37,39 @@ // const subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID'; // Imports the Google Cloud client library -const {PubSub} = require('@google-cloud/pubsub'); +const { PubSub } = require("@google-cloud/pubsub"); // Creates a client; cache this for further use const pubSubClient = new PubSub(); -async function updateDeadLetterPolicy(topicNameOrId, subscriptionNameOrId) { +async function updateDeadLetterPolicy( +topicNameOrId, +subscriptionNameOrId) +{ const metadata = { deadLetterPolicy: { deadLetterTopic: pubSubClient.topic(topicNameOrId).name, - maxDeliveryAttempts: 15, - }, + maxDeliveryAttempts: 15 + } }; - await pubSubClient - .topic(topicNameOrId) - .subscription(subscriptionNameOrId) - .setMetadata(metadata); + await pubSubClient. + topic(topicNameOrId). + subscription(subscriptionNameOrId). + setMetadata(metadata); console.log('Max delivery attempts updated successfully.'); } // [END pubsub_dead_letter_update_subscription] function main( - topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', - subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID' -) { - updateDeadLetterPolicy(topicNameOrId, subscriptionNameOrId).catch(err => { +topicNameOrId = 'YOUR_TOPIC_NAME_OR_ID', +subscriptionNameOrId = 'YOUR_SUBSCRIPTION_NAME_OR_ID') +{ + updateDeadLetterPolicy(topicNameOrId, subscriptionNameOrId).catch((err) => { console.error(err.message); process.exitCode = 1; }); } -main(...process.argv.slice(2)); +main(...process.argv.slice(2)); \ No newline at end of file