@google-cloud/pubsub

  • Version 2.18.4
  • Published
  • 2.97 MB
  • 15 dependencies
  • Apache-2.0 license

Install

npm i @google-cloud/pubsub
yarn add @google-cloud/pubsub
pnpm add @google-cloud/pubsub

Overview

Cloud Pub/Sub Client Library for Node.js

Index

Variables

Classes

Interfaces

Type Aliases

Namespaces

Variables

variable Encodings

const Encodings: { Json: 'JSON'; Binary: 'BINARY' };

    variable SchemaTypes

    const SchemaTypes: { ProtocolBuffer: 'PROTOCOL_BUFFER'; Avro: 'AVRO' };

      variable SchemaViews

      const SchemaViews: { Basic: 'BASIC'; Full: 'FULL' };

        Classes

        class IAM

        class IAM {}
        • [IAM (Identity and Access Management)](https://cloud.google.com/pubsub/access_control) allows you to set permissions on individual resources and offers a wider range of roles: editor, owner, publisher, subscriber, and viewer. This gives you greater flexibility and allows you to set more fine-grained access control.

          For example: * Grant access on a per-topic or per-subscription basis, rather than for the whole Cloud project. * Grant access with limited capabilities, such as to only publish messages to a topic, or to only to consume messages from a subscription, but not to delete the topic or subscription.

          *The IAM access control features described in this document are Beta, including the API methods to get and set IAM policies, and to test IAM permissions. Cloud Pub/Sub's use of IAM features is not covered by any SLA or deprecation policy, and may be subject to backward-incompatible changes.*

          Parameter pubsub

          PubSub Object.

          Parameter id

          The name of the topic or subscription.

          Example 1

          const {PubSub} = require('@google-cloud/pubsub');
          const pubsub = new PubSub();
          const topic = pubsub.topic('my-topic');
          // topic.iam
          const subscription = pubsub.subscription('my-subscription');
          // subscription.iam

          See Also

        constructor

        constructor(pubsub: PubSub, id: string);

          property id

          id: string;

            property pubsub

            pubsub: PubSub;

              property request

              request: <T, R = void>(
              config: RequestConfig,
              callback: RequestCallback<T, R>
              ) => void;

                method getPolicy

                getPolicy: {
                (gaxOpts?: CallOptions): Promise<GetPolicyResponse>;
                (callback: NormalCallback<Policy>): void;
                (gaxOpts: CallOptions, callback: NormalCallback<Policy>): void;
                };
                • Get the IAM policy

                  Parameter gaxOptions

                  Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                  Parameter callback

                  Callback function.

                  Returns

                  {Promise}

                  Example 1

                  const {PubSub} = require('@google-cloud/pubsub');
                  const pubsub = new PubSub();
                  const topic = pubsub.topic('my-topic');
                  const subscription = topic.subscription('my-subscription');
                  topic.iam.getPolicy(function(err, policy, apiResponse) {});
                  subscription.iam.getPolicy(function(err, policy, apiResponse) {});
                  //-
                  // If the callback is omitted, we'll return a Promise.
                  //-
                  topic.iam.getPolicy().then(function(data) {
                  const policy = data[0];
                  const apiResponse = data[1];
                  });

                  See Also

                method setPolicy

                setPolicy: {
                (policy: Policy, gaxOpts?: CallOptions): Promise<SetPolicyResponse>;
                (
                policy: Policy,
                gaxOpts: CallOptions,
                callback: NormalCallback<Policy>
                ): void;
                (policy: Policy, callback: NormalCallback<Policy>): void;
                };
                • Set the IAM policy

                  Parameter policy

                  The [policy](https://cloud.google.com/pubsub/docs/reference/rest/v1/Policy).

                  Parameter

                  {array} [policy.bindings] Bindings associate members with roles.

                  Parameter

                  {Array} [policy.rules] Rules to be applied to the policy.

                  Parameter

                  {string} [policy.etag] Etags are used to perform a read-modify-write.

                  Parameter gaxOptions

                  Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                  Parameter callback

                  Callback function.

                  Returns

                  {Promise}

                  Throws

                  {Error} If no policy is provided.

                  Example 1

                  const {PubSub} = require('@google-cloud/pubsub');
                  const pubsub = new PubSub();
                  const topic = pubsub.topic('my-topic');
                  const subscription = topic.subscription('my-subscription');
                  const myPolicy = {
                  bindings: [
                  {
                  role: 'roles/pubsub.subscriber',
                  members:
                  ['serviceAccount:myotherproject@appspot.gserviceaccount.com']
                  }
                  ]
                  };
                  topic.iam.setPolicy(myPolicy, function(err, policy, apiResponse) {});
                  subscription.iam.setPolicy(myPolicy, function(err, policy, apiResponse)
                  {});
                  //-
                  // If the callback is omitted, we'll return a Promise.
                  //-
                  topic.iam.setPolicy(myPolicy).then(function(data) {
                  const policy = data[0];
                  const apiResponse = data[1];
                  });

                  See Also

                method testPermissions

                testPermissions: {
                (
                permissions: string | string[],
                gaxOpts?: CallOptions
                ): Promise<TestIamPermissionsResponse>;
                (
                permissions: string | string[],
                gaxOpts: CallOptions,
                callback: TestIamPermissionsCallback
                ): void;
                (permissions: string | string[], callback: TestIamPermissionsCallback): void;
                };
                • Test a set of permissions for a resource.

                  Permissions with wildcards such as * or storage.* are not allowed.

                  Parameter permissions

                  The permission(s) to test for.

                  Parameter gaxOptions

                  Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                  Parameter callback

                  Callback function.

                  Returns

                  {Promise}

                  Throws

                  {Error} If permissions are not provided.

                  Example 1

                  const {PubSub} = require('@google-cloud/pubsub');
                  const pubsub = new PubSub();
                  const topic = pubsub.topic('my-topic');
                  const subscription = topic.subscription('my-subscription');
                  //-
                  // Test a single permission.
                  //-
                  const test = 'pubsub.topics.update';
                  topic.iam.testPermissions(test, function(err, permissions, apiResponse) {
                  console.log(permissions);
                  // {
                  // "pubsub.topics.update": true
                  // }
                  });
                  //-
                  // Test several permissions at once.
                  //-
                  const tests = [
                  'pubsub.subscriptions.consume',
                  'pubsub.subscriptions.update'
                  ];
                  subscription.iam.testPermissions(tests, function(err, permissions) {
                  console.log(permissions);
                  // {
                  // "pubsub.subscriptions.consume": true,
                  // "pubsub.subscriptions.update": false
                  // }
                  });
                  //-
                  // If the callback is omitted, we'll return a Promise.
                  //-
                  topic.iam.testPermissions(test).then(function(data) {
                  const permissions = data[0];
                  const apiResponse = data[1];
                  });

                  See Also

                class Message

                class Message {}
                • Message objects provide a simple interface for users to get message data and acknowledge the message.

                  Example 1

                  subscription.on('message', message => {
                  // {
                  // ackId: 'RUFeQBJMJAxESVMrQwsqWBFOBCEhPjA',
                  // attributes: {key: 'value'},
                  // data: Buffer.from('Hello, world!'),
                  // id: '1551297743043',
                  // orderingKey: 'ordering-key',
                  // publishTime: new PreciseDate('2019-02-27T20:02:19.029534186Z'),
                  // received: 1551297743043,
                  // length: 13
                  // }
                  });

                constructor

                constructor(
                sub: Subscriber,
                { ackId, message, deliveryAttempt }: google.pubsub.v1.IReceivedMessage
                );
                • Parameter sub

                  The parent subscriber.

                  Parameter message

                  The raw message response.

                property ackId

                ackId: string;

                  property attributes

                  attributes: { [key: string]: string };

                    property data

                    data: Buffer;

                      property deliveryAttempt

                      deliveryAttempt: number;

                        property id

                        id: string;

                          property length

                          readonly length: number;
                          • The length of the message data.

                            {number}

                          property orderingKey

                          orderingKey?: string;

                            property publishTime

                            publishTime: PreciseDate;

                              property received

                              received: number;

                                method ack

                                ack: () => void;
                                • Acknowledges the message.

                                  Example 1

                                  subscription.on('message', message => {
                                  message.ack();
                                  });

                                method modAck

                                modAck: (deadline: number) => void;
                                • Modifies the ack deadline.

                                  Parameter deadline

                                  The number of seconds to extend the deadline.

                                method nack

                                nack: () => void;
                                • Removes the message from our inventory and schedules it to be redelivered.

                                  Example 1

                                  subscription.on('message', message => {
                                  message.nack();
                                  });

                                class PublishError

                                class PublishError extends Error implements grpc.ServiceError {}
                                • Exception to be thrown during failed ordered publish.

                                  Error

                                constructor

                                constructor(key: string, err: grpc.ServiceError);

                                  property code

                                  code: grpc.status;

                                    property details

                                    details: string;

                                      property error

                                      error: grpc.ServiceError;

                                        property metadata

                                        metadata: grpc.Metadata;

                                          property orderingKey

                                          orderingKey: string;

                                            class PubSub

                                            class PubSub {}
                                            • [Cloud Pub/Sub](https://developers.google.com/pubsub/overview) is a reliable, many-to-many, asynchronous messaging service from Cloud Platform.

                                              Parameter options

                                              Configuration options.

                                              Example 1

                                              Import the client library

                                              const {PubSub} = require('@google-cloud/pubsub');

                                              Example 2

                                              Create a client that uses Application Default Credentials (ADC):

                                              const pubsub = new PubSub();

                                              Example 3

                                              Create a client with explicit credentials:

                                              const pubsub = new PubSub({
                                              projectId: 'your-project-id',
                                              keyFilename: '/path/to/keyfile.json'
                                              });

                                              Example 4

                                              include:samples/quickstart.js region_tag:pubsub_quickstart_create_topic Full quickstart example:

                                              See Also

                                            constructor

                                            constructor(options?: ClientConfig);

                                              property api

                                              api: { [key: string]: gax.ClientStub };

                                                property auth

                                                auth: GoogleAuth;

                                                  property getSnapshotsStream

                                                  getSnapshotsStream: () => ObjectStream<Snapshot>;

                                                    property getSubscriptionsStream

                                                    getSubscriptionsStream: () => ObjectStream<Subscription>;

                                                      property getTopicsStream

                                                      getTopicsStream: () => ObjectStream<Topic>;

                                                        property isEmulator

                                                        isEmulator: boolean;

                                                          property isIdResolved

                                                          readonly isIdResolved: boolean;
                                                          • Returns true if we have actually resolved the full project name.

                                                            Returns

                                                            {boolean} true if the name is resolved.

                                                          property isOpen

                                                          isOpen: boolean;

                                                            property name

                                                            name?: string;

                                                              property options

                                                              options: ClientConfig;

                                                                property projectId

                                                                projectId: string;

                                                                  property Promise

                                                                  Promise?: PromiseConstructor;

                                                                    method close

                                                                    close: {
                                                                    (): Promise<void>;
                                                                    (callback: NormalCallback<google.protobuf.IEmpty>): void;
                                                                    };
                                                                    • Closes out this object, releasing any server connections. Note that once you close a PubSub object, it may not be used again. Any pending operations (e.g. queued publish messages) will fail. If you have topic or subscription objects that may have pending operations, you should call close() on those first if you want any pending messages to be delivered correctly. The PubSub class doesn't track those.

                                                                      EmptyCallback

                                                                      Returns

                                                                      {Promise}

                                                                    method closeAllClients_

                                                                    closeAllClients_: () => Promise<void>;
                                                                    • Close all open client objects.

                                                                      Returns

                                                                      {Promise}

                                                                    method createSchema

                                                                    createSchema: (
                                                                    schemaId: string,
                                                                    type: SchemaType,
                                                                    definition: string,
                                                                    gaxOpts?: CallOptions
                                                                    ) => Promise<Schema>;
                                                                    • Create a schema in the project.

                                                                      Parameter schemaId

                                                                      The name or ID of the subscription.

                                                                      Parameter type

                                                                      The type of the schema (Protobuf, Avro, etc).

                                                                      Parameter definition

                                                                      The text describing the schema in terms of the type.

                                                                      Parameter options

                                                                      Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                      Returns

                                                                      {Promise}

                                                                      Throws

                                                                      {Error} If a schema ID or name is not provided.

                                                                      Throws

                                                                      {Error} If an invalid SchemaType is provided.

                                                                      Throws

                                                                      {Error} If an invalid schema definition is provided.

                                                                      Example 1

                                                                      Create a schema.

                                                                      const {PubSub} = require('@google-cloud/pubsub');
                                                                      const pubsub = new PubSub();
                                                                      await pubsub.createSchema(
                                                                      'messageType',
                                                                      SchemaTypes.Avro,
                                                                      '{...avro definition...}'
                                                                      );

                                                                      See Also

                                                                    method createSubscription

                                                                    createSubscription: {
                                                                    (
                                                                    topic: Topic | string,
                                                                    name: string,
                                                                    options?: CreateSubscriptionOptions
                                                                    ): Promise<CreateSubscriptionResponse>;
                                                                    (topic: string | Topic, name: string, callback: SubscriptionCallback): void;
                                                                    (
                                                                    topic: string | Topic,
                                                                    name: string,
                                                                    options: CreateSubscriptionOptions,
                                                                    callback: SubscriptionCallback
                                                                    ): void;
                                                                    };
                                                                    • Create a subscription to a topic.

                                                                      Parameter topic

                                                                      The Topic to create a subscription to.

                                                                      Parameter name

                                                                      The name of the subscription.

                                                                      Parameter options

                                                                      See a [Subscription resource](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions).

                                                                      Parameter callback

                                                                      Callback function.

                                                                      Returns

                                                                      {Promise}

                                                                      Throws

                                                                      {Error} If a Topic instance or topic name is not provided.

                                                                      Throws

                                                                      {Error} If a subscription name is not provided.

                                                                      Example 1

                                                                      Subscribe to a topic.

                                                                      const {PubSub} = require('@google-cloud/pubsub');
                                                                      const pubsub = new PubSub();
                                                                      const topic = 'messageCenter';
                                                                      const name = 'newMessages';
                                                                      const callback = function(err, subscription, apiResponse) {};
                                                                      pubsub.createSubscription(topic, name, callback);

                                                                      Example 2

                                                                      If the callback is omitted, we'll return a Promise.

                                                                      pubsub.createSubscription(topic, name)
                                                                      .then(function(data) {
                                                                      const subscription = data[0];
                                                                      const apiResponse = data[1];
                                                                      });

                                                                      See Also

                                                                    method createTopic

                                                                    createTopic: {
                                                                    (
                                                                    name: string | TopicMetadata,
                                                                    gaxOpts?: CallOptions
                                                                    ): Promise<CreateTopicResponse>;
                                                                    (name: string | google.pubsub.v1.ITopic, callback: TopicCallback): void;
                                                                    (
                                                                    name: string | google.pubsub.v1.ITopic,
                                                                    gaxOpts: CallOptions,
                                                                    callback: TopicCallback
                                                                    ): void;
                                                                    };
                                                                    • Create a topic with the given name.

                                                                      Parameter name

                                                                      Name of the topic.

                                                                      Parameter gaxOpts

                                                                      Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                      Parameter callback

                                                                      Callback function.

                                                                      Returns

                                                                      {Promise}

                                                                      Example 1

                                                                      const {PubSub} = require('@google-cloud/pubsub');
                                                                      const pubsub = new PubSub();
                                                                      pubsub.createTopic('my-new-topic', function(err, topic, apiResponse) {
                                                                      if (!err) {
                                                                      // The topic was created successfully.
                                                                      }
                                                                      });
                                                                      //-
                                                                      // If the callback is omitted, we'll return a Promise.
                                                                      //-
                                                                      pubsub.createTopic('my-new-topic').then(function(data) {
                                                                      const topic = data[0];
                                                                      const apiResponse = data[1];
                                                                      });

                                                                      See Also

                                                                    method detachSubscription

                                                                    detachSubscription: {
                                                                    (name: string, gaxOpts?: CallOptions): Promise<DetachSubscriptionResponse>;
                                                                    (name: string, callback: NormalCallback<google.protobuf.IEmpty>): void;
                                                                    (
                                                                    name: string,
                                                                    gaxOpts: CallOptions,
                                                                    callback: NormalCallback<google.protobuf.IEmpty>
                                                                    ): void;
                                                                    };
                                                                    • Detach a subscription with the given name.

                                                                      Parameter name

                                                                      Name of the subscription.

                                                                      Parameter gaxOpts

                                                                      Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                      Parameter callback

                                                                      Callback function.

                                                                      Returns

                                                                      {Promise}

                                                                      Example 1

                                                                      const {PubSub} = require('@google-cloud/pubsub');
                                                                      const pubsub = new PubSub();
                                                                      pubsub.detachSubscription('my-sub', (err, topic, apiResponse) => {
                                                                      if (!err) {
                                                                      // The topic was created successfully.
                                                                      }
                                                                      });
                                                                      //-
                                                                      // If the callback is omitted, we'll return a Promise.
                                                                      //-
                                                                      pubsub.detachSubscription('my-sub').then(data => {
                                                                      const apiResponse = data[0];
                                                                      });

                                                                      See Also

                                                                    method determineBaseUrl_

                                                                    determineBaseUrl_: () => void;
                                                                    • Determine the appropriate endpoint to use for API requests, first trying the apiEndpoint parameter. If that isn't set, we try the Pub/Sub emulator environment variable (PUBSUB_EMULATOR_HOST). If that is also null, we try the standard gcloud alpha pubsub environment variable (CLOUDSDK_API_ENDPOINT_OVERRIDES_PUBSUB). Otherwise the default production API is used.

                                                                      Note that if the URL doesn't end in '.googleapis.com', we will assume that it's an emulator and disable strict SSL checks.

                                                                    method formatName_

                                                                    static formatName_: (name: string) => string;

                                                                      method getClient_

                                                                      getClient_: (config: GetClientConfig, callback: GetClientCallback) => void;
                                                                      • Get the PubSub client object.

                                                                        Parameter config

                                                                        Configuration object.

                                                                        Parameter

                                                                        {object} config.gaxOpts GAX options.

                                                                        Parameter

                                                                        {function} config.method The gax method to call.

                                                                        Parameter

                                                                        {object} config.reqOpts Request options.

                                                                        Parameter callback

                                                                        The callback function.

                                                                      method getClientAsync_

                                                                      getClientAsync_: (config: GetClientConfig) => Promise<gax.ClientStub>;
                                                                      • Get the PubSub client object.

                                                                        Parameter config

                                                                        Configuration object.

                                                                        Parameter

                                                                        {object} config.gaxOpts GAX options.

                                                                        Parameter

                                                                        {function} config.method The gax method to call.

                                                                        Parameter

                                                                        {object} config.reqOpts Request options.

                                                                        Returns

                                                                        {Promise}

                                                                      method getClientConfig

                                                                      getClientConfig: () => Promise<ClientConfig>;
                                                                      • Retrieve a client configuration, suitable for passing into a GAPIC 'v1' class constructor. This will fill out projectId, emulator URLs, and so forth.

                                                                        Returns

                                                                        {Promise} the filled client configuration.

                                                                      method getSchemaClient_

                                                                      getSchemaClient_: () => Promise<SchemaServiceClient>;
                                                                      • Gets a schema client, creating one if needed.

                                                                      method getSnapshots

                                                                      getSnapshots: {
                                                                      (options?: PageOptions): Promise<GetSnapshotsResponse>;
                                                                      (
                                                                      callback: PagedCallback<
                                                                      Snapshot,
                                                                      google.pubsub.v1.IListSnapshotsResponse
                                                                      >
                                                                      ): void;
                                                                      (
                                                                      options: PageOptions,
                                                                      callback: PagedCallback<
                                                                      Snapshot,
                                                                      google.pubsub.v1.IListSnapshotsResponse
                                                                      >
                                                                      ): void;
                                                                      };
                                                                      • Get a list of snapshots.

                                                                        Parameter query

                                                                        Query object for listing snapshots.

                                                                        Parameter callback

                                                                        Callback function.

                                                                        Returns

                                                                        {Promise}

                                                                        Example 1

                                                                        const {PubSub} = require('@google-cloud/pubsub');
                                                                        const pubsub = new PubSub();
                                                                        pubsub.getSnapshots(function(err, snapshots) {
                                                                        if (!err) {
                                                                        // snapshots is an array of Snapshot objects.
                                                                        }
                                                                        });
                                                                        //-
                                                                        // If the callback is omitted, we'll return a Promise.
                                                                        //-
                                                                        pubsub.getSnapshots().then(function(data) {
                                                                        const snapshots = data[0];
                                                                        });

                                                                      method getSubscriptions

                                                                      getSubscriptions: {
                                                                      (options?: GetSubscriptionsOptions): Promise<GetSubscriptionsResponse>;
                                                                      (callback: GetSubscriptionsCallback): void;
                                                                      (options: GetSubscriptionsOptions, callback: GetSubscriptionsCallback): void;
                                                                      };
                                                                      • Get a list of the subscriptions registered to all of your project's topics. You may optionally provide a query object as the first argument to customize the response.

                                                                        Your provided callback will be invoked with an error object if an API error occurred or an array of Subscription objects.

                                                                        To get subscriptions for a topic, see Topic.

                                                                        Parameter query

                                                                        Query object for listing subscriptions.

                                                                        Parameter callback

                                                                        Callback function.

                                                                        Returns

                                                                        {Promise}

                                                                        Example 1

                                                                        const {PubSub} = require('@google-cloud/pubsub');
                                                                        const pubsub = new PubSub();
                                                                        pubsub.getSubscriptions(function(err, subscriptions) {
                                                                        if (!err) {
                                                                        // subscriptions is an array of Subscription objects.
                                                                        }
                                                                        });
                                                                        //-
                                                                        // If the callback is omitted, we'll return a Promise.
                                                                        //-
                                                                        pubsub.getSubscriptions().then(function(data) {
                                                                        const subscriptions = data[0];
                                                                        });

                                                                        See Also

                                                                      method getTopics

                                                                      getTopics: {
                                                                      (options?: PageOptions): Promise<GetTopicsResponse>;
                                                                      (callback: PagedCallback<Topic, google.pubsub.v1.IListTopicsResponse>): void;
                                                                      (
                                                                      options: PageOptions,
                                                                      callback: PagedCallback<Topic, google.pubsub.v1.IListTopicsResponse>
                                                                      ): void;
                                                                      };
                                                                      • Get a list of the topics registered to your project. You may optionally provide a query object as the first argument to customize the response.

                                                                        Parameter query

                                                                        Query object for listing topics.

                                                                        Parameter callback

                                                                        Callback function.

                                                                        Returns

                                                                        {Promise}

                                                                        Example 1

                                                                        const {PubSub} = require('@google-cloud/pubsub');
                                                                        const pubsub = new PubSub();
                                                                        pubsub.getTopics(function(err, topics) {
                                                                        if (!err) {
                                                                        // topics is an array of Topic objects.
                                                                        }
                                                                        });
                                                                        //-
                                                                        // Customize the query.
                                                                        //-
                                                                        pubsub.getTopics({
                                                                        pageSize: 3
                                                                        }, function(err, topics) {});
                                                                        //-
                                                                        // If the callback is omitted, we'll return a Promise.
                                                                        //-
                                                                        pubsub.getTopics().then(function(data) {
                                                                        const topics = data[0];
                                                                        });

                                                                        See Also

                                                                      method listSchemas

                                                                      listSchemas: (
                                                                      view?: SchemaView,
                                                                      options?: CallOptions
                                                                      ) => AsyncIterable<google.pubsub.v1.ISchema>;

                                                                      method request

                                                                      request: <T, R = void>(
                                                                      config: RequestConfig,
                                                                      callback: RequestCallback<T, R>
                                                                      ) => void;
                                                                      • Funnel all API requests through this method, to be sure we have a project ID.

                                                                        Parameter config

                                                                        Configuration object.

                                                                        Parameter

                                                                        {object} config.gaxOpts GAX options.

                                                                        Parameter

                                                                        {function} config.method The gax method to call.

                                                                        Parameter

                                                                        {object} config.reqOpts Request options.

                                                                        Parameter callback

                                                                        The callback function.

                                                                      method schema

                                                                      schema: (idOrName: string) => Schema;
                                                                      • Create a Schema object, representing a schema within the project. See PubSub#createSchema or Schema#create to create a schema.

                                                                        Parameter name

                                                                        The ID or name of the schema.

                                                                        Returns

                                                                        {Schema} A Schema instance.

                                                                        Throws

                                                                        {Error} If a name is not provided.

                                                                        Example 1

                                                                        const {PubSub} = require('@google-cloud/pubsub');
                                                                        const pubsub = new PubSub();
                                                                        const schema = pubsub.schema('my-schema');

                                                                      method snapshot

                                                                      snapshot: (name: string) => Snapshot;
                                                                      • Create a Snapshot object. See Subscription#createSnapshot to create a snapshot.

                                                                        Parameter name

                                                                        The name of the snapshot.

                                                                        Returns

                                                                        {Snapshot} A Snapshot instance.

                                                                        Throws

                                                                        {Error} If a name is not provided.

                                                                        Example 1

                                                                        const {PubSub} = require('@google-cloud/pubsub');
                                                                        const pubsub = new PubSub();
                                                                        const snapshot = pubsub.snapshot('my-snapshot');

                                                                      method subscription

                                                                      subscription: (name: string, options?: SubscriptionOptions) => Subscription;
                                                                      • Create a Subscription object. This command by itself will not run any API requests. You will receive a Subscription object, which will allow you to interact with a subscription.

                                                                        Parameter name

                                                                        Name of the subscription.

                                                                        Parameter options

                                                                        Configuration object.

                                                                        Returns

                                                                        {Subscription} A Subscription instance.

                                                                        Throws

                                                                        {Error} If subscription name is omitted.

                                                                        Example 1

                                                                        const {PubSub} = require('@google-cloud/pubsub');
                                                                        const pubsub = new PubSub();
                                                                        const subscription = pubsub.subscription('my-subscription');
                                                                        // Register a listener for `message` events.
                                                                        subscription.on('message', function(message) {
                                                                        // Called every time a message is received.
                                                                        // message.id = ID of the message.
                                                                        // message.ackId = ID used to acknowledge the message receival.
                                                                        // message.data = Contents of the message.
                                                                        // message.attributes = Attributes of the message.
                                                                        // message.publishTime = Date when Pub/Sub received the message.
                                                                        });

                                                                      method topic

                                                                      topic: (name: string, options?: PublishOptions) => Topic;
                                                                      • Create a Topic object. See PubSub#createTopic to create a topic.

                                                                        Parameter name

                                                                        The name of the topic.

                                                                        Parameter options

                                                                        Publisher configuration object.

                                                                        Returns

                                                                        {Topic} A Topic instance.

                                                                        Throws

                                                                        {Error} If a name is not provided.

                                                                        Example 1

                                                                        const {PubSub} = require('@google-cloud/pubsub');
                                                                        const pubsub = new PubSub();
                                                                        const topic = pubsub.topic('my-topic');

                                                                      method validateSchema

                                                                      validateSchema: (schema: ISchema, gaxOpts?: CallOptions) => Promise<void>;
                                                                      • Validate a schema definition.

                                                                        Parameter schema

                                                                        The schema definition you wish to validate.

                                                                        Parameter options

                                                                        Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                        Returns

                                                                        {Promise}

                                                                        Throws

                                                                        {Error} if the validation fails.

                                                                        See Also

                                                                      class Schema

                                                                      class Schema {}
                                                                      • A Schema object allows you to interact with a Cloud Pub/Sub schema.

                                                                        This should only be instantiated by the PubSub class. To obtain an instance for end user usage, call pubsub.schema().

                                                                        Parameter pubsub

                                                                        The PubSub object creating this object.

                                                                        Parameter id

                                                                        name or ID of the schema.

                                                                        Example 1

                                                                        Creating an instance of this class.

                                                                        const {PubSub} = require('@google-cloud/pubsub');
                                                                        const pubsub = new PubSub();
                                                                        const schema = pubsub.schema('my-schema');

                                                                        Example 2

                                                                        Getting the details of a schema. Note that Schema methods do not provide a callback interface. Use .then() or await.

                                                                        const {PubSub} = require('@google-cloud/pubsub');
                                                                        const pubsub = new PubSub();
                                                                        const schema = pubsub.schema('my-schema');
                                                                        schema.get(SchemaViews.Basic).then(console.log);

                                                                      constructor

                                                                      constructor(pubsub: PubSub, idOrName: string);

                                                                        property id

                                                                        id: string;

                                                                          property name_

                                                                          name_?: string;

                                                                            property pubsub

                                                                            pubsub: PubSub;

                                                                              method create

                                                                              create: (
                                                                              type: SchemaType,
                                                                              definition: string,
                                                                              gaxOpts?: CallOptions
                                                                              ) => Promise<void>;
                                                                              • Create a schema.

                                                                                Parameter type

                                                                                The type of the schema (Protobuf, Avro, etc).

                                                                                Parameter definition

                                                                                The text describing the schema in terms of the type.

                                                                                Parameter options

                                                                                Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                                Returns

                                                                                {Promise}

                                                                                Throws

                                                                                {Error} if the schema type is incorrect.

                                                                                Throws

                                                                                {Error} if the definition is invalid.

                                                                                Example 1

                                                                                Create a schema.

                                                                                const {PubSub} = require('@google-cloud/pubsub');
                                                                                const pubsub = new PubSub();
                                                                                const schema = pubsub.schema('messageType');
                                                                                await schema.create(
                                                                                SchemaTypes.Avro,
                                                                                '{...avro definition...}'
                                                                                );

                                                                                See Also

                                                                              method delete

                                                                              delete: (gaxOpts?: CallOptions) => Promise<void>;

                                                                              method formatName_

                                                                              static formatName_: (projectId: string, nameOrId: string) => string;

                                                                                method get

                                                                                get: (view?: SchemaView, gaxOpts?: CallOptions) => Promise<ISchema>;
                                                                                • Get full information about the schema from the service.

                                                                                  Parameter view

                                                                                  The type of schema object requested, which should be an enum value from SchemaViews. Defaults to Full.

                                                                                  Parameter options

                                                                                  Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                                  Returns

                                                                                  {Promise}

                                                                                  See Also

                                                                                method getName

                                                                                getName: () => Promise<string>;
                                                                                • Return the fully qualified name of this schema.

                                                                                  Note that we have to verify that we have a projectId before returning this, so we have to check that first.

                                                                                  {Promise} a Promise that resolves to the full schema name

                                                                                method metadataFromMessage

                                                                                static metadataFromMessage: (attributes: Attributes) => SchemaMessageMetadata;
                                                                                • Translates the schema attributes in messages delivered from Pub/Sub. All resulting fields may end up being blank.

                                                                                method validateMessage

                                                                                validateMessage: (
                                                                                message: string,
                                                                                encoding: google.pubsub.v1.Encoding | keyof typeof google.pubsub.v1.Encoding,
                                                                                gaxOpts?: CallOptions
                                                                                ) => Promise<void>;
                                                                                • Validate a message against this schema's definition.

                                                                                  If you would like to validate a message against an arbitrary schema, please use the SchemaServiceClient GAPIC class directly, using your PubSub instance's configuration, via PubSub#getClientConfig.

                                                                                  Parameter message

                                                                                  The message to validate.

                                                                                  Parameter encoding

                                                                                  The encoding of the message to validate.

                                                                                  Parameter options

                                                                                  Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                                  Returns

                                                                                  {Promise}

                                                                                  Throws

                                                                                  {Error} if the validation fails.

                                                                                  Throws

                                                                                  {Error} if other parameters are invalid.

                                                                                  See Also

                                                                                class Snapshot

                                                                                class Snapshot {}
                                                                                • A Snapshot object will give you access to your Cloud Pub/Sub snapshot.

                                                                                  Snapshots are sometimes retrieved when using various methods:

                                                                                  - PubSub#getSnapshots - PubSub#getSnapshotsStream - PubSub#snapshot

                                                                                  Snapshots may be created with:

                                                                                  - Subscription#createSnapshot

                                                                                  You can use snapshots to seek a subscription to a specific point in time.

                                                                                  - Subscription#seek

                                                                                  Example 1

                                                                                  //-
                                                                                  // From {@link PubSub#getSnapshots}:
                                                                                  //-
                                                                                  pubsub.getSnapshots((err, snapshots) => {
                                                                                  // `snapshots` is an array of Snapshot objects.
                                                                                  });
                                                                                  //-
                                                                                  // From {@link PubSub#getSnapshotsStream}:
                                                                                  //-
                                                                                  pubsub.getSnapshotsStream()
                                                                                  .on('error', console.error)
                                                                                  .on('data', (snapshot) => {
                                                                                  // `snapshot` is a Snapshot object.
                                                                                  });
                                                                                  //-
                                                                                  // From {@link PubSub#snapshot}:
                                                                                  //-
                                                                                  const snapshot = pubsub.snapshot('my-snapshot');
                                                                                  // snapshot is a Snapshot object.
                                                                                  //-
                                                                                  // Create a snapshot with {module:pubsub/subscription#createSnapshot}:
                                                                                  //-
                                                                                  const subscription = pubsub.subscription('my-subscription');
                                                                                  subscription.createSnapshot('my-snapshot', (err, snapshot) => {
                                                                                  if (!err) {
                                                                                  // `snapshot` is a Snapshot object.
                                                                                  }
                                                                                  });
                                                                                  //-
                                                                                  // Seek to your snapshot:
                                                                                  //-
                                                                                  const subscription = pubsub.subscription('my-subscription');
                                                                                  subscription.seek('my-snapshot', (err) => {
                                                                                  if (err) {
                                                                                  // Error handling omitted.
                                                                                  }
                                                                                  });

                                                                                constructor

                                                                                constructor(parent: PubSub | Subscription, name: string);

                                                                                  property metadata

                                                                                  metadata?: google.pubsub.v1.ISnapshot;

                                                                                    property name

                                                                                    name: string;

                                                                                      property parent

                                                                                      parent: PubSub | Subscription;

                                                                                        method create

                                                                                        create: {
                                                                                        (gaxOpts?: CallOptions): Promise<CreateSnapshotResponse>;
                                                                                        (callback: CreateSnapshotCallback): void;
                                                                                        (gaxOpts: CallOptions, callback: CreateSnapshotCallback): void;
                                                                                        };
                                                                                        • Create a snapshot with the given name.

                                                                                          **This is only available if you accessed this object through Subscription#snapshot.**

                                                                                          Snapshot#create

                                                                                          Parameter name

                                                                                          Name of the snapshot.

                                                                                          Parameter callback

                                                                                          The callback function.

                                                                                          Parameter

                                                                                          {?error} callback.err An error from the API call, may be null.

                                                                                          Parameter

                                                                                          {Snapshot} callback.snapshot The newly created snapshot.

                                                                                          Parameter

                                                                                          {object} callback.apiResponse The full API response from the service.

                                                                                          Example 1

                                                                                          const subscription = pubsub.subscription('my-subscription');
                                                                                          const snapshot = subscription.snapshot('my-snapshot');
                                                                                          const callback = (err, snapshot, apiResponse) => {
                                                                                          if (!err) {
                                                                                          // The snapshot was created successfully.
                                                                                          }
                                                                                          };
                                                                                          snapshot.create('my-snapshot', callback);
                                                                                          //-
                                                                                          // If the callback is omitted, we'll return a Promise.
                                                                                          //-
                                                                                          snapshot.create('my-snapshot').then((data) => {
                                                                                          const snapshot = data[0];
                                                                                          const apiResponse = data[1];
                                                                                          });

                                                                                        method delete

                                                                                        delete: {
                                                                                        (): Promise<EmptyResponse>;
                                                                                        (callback: NormalCallback<google.protobuf.IEmpty>): void;
                                                                                        };
                                                                                        • Delete the snapshot.

                                                                                          Parameter callback

                                                                                          The callback function.

                                                                                          Parameter

                                                                                          {?error} callback.err An error returned while making this request.

                                                                                          Parameter

                                                                                          {object} callback.apiResponse The full API response from the service.

                                                                                          Example 1

                                                                                          snapshot.delete((err, apiResponse) => {});
                                                                                          //-
                                                                                          // If the callback is omitted, we'll return a Promise.
                                                                                          //-
                                                                                          snapshot.delete().then((data) => {
                                                                                          const apiResponse = data[0];
                                                                                          });

                                                                                        method formatName_

                                                                                        static formatName_: (projectId: string, name: string) => string;

                                                                                          method seek

                                                                                          seek: {
                                                                                          (gaxOpts?: CallOptions): Promise<SeekResponse>;
                                                                                          (callback: NormalCallback<google.pubsub.v1.ISeekResponse>): void;
                                                                                          (
                                                                                          gaxOpts: CallOptions,
                                                                                          callback: NormalCallback<google.pubsub.v1.ISeekResponse>
                                                                                          ): void;
                                                                                          };
                                                                                          • Seeks an existing subscription to the snapshot.

                                                                                            **This is only available if you accessed this object through Subscription#snapshot.**

                                                                                            Snapshot#seek

                                                                                            Parameter callback

                                                                                            The callback function.

                                                                                            Parameter

                                                                                            {?error} callback.err An error from the API call, may be null.

                                                                                            Parameter

                                                                                            {object} callback.apiResponse The full API response from the service.

                                                                                            Example 1

                                                                                            const subscription = pubsub.subscription('my-subscription');
                                                                                            const snapshot = subscription.snapshot('my-snapshot');
                                                                                            snapshot.seek((err, apiResponse) => {});
                                                                                            //-
                                                                                            // If the callback is omitted, we'll return a Promise.
                                                                                            //-
                                                                                            snapshot.seek().then((data) => {
                                                                                            const apiResponse = data[0];
                                                                                            });

                                                                                          class Subscription

                                                                                          class Subscription extends EventEmitter {}
                                                                                          • A Subscription object will give you access to your Cloud Pub/Sub subscription.

                                                                                            Subscriptions are sometimes retrieved when using various methods:

                                                                                            - PubSub#getSubscriptions - Topic#getSubscriptions

                                                                                            Subscription objects may be created directly with:

                                                                                            - PubSub#createSubscription - Topic#createSubscription

                                                                                            All Subscription objects are instances of an [EventEmitter](http://nodejs.org/api/events.html). The subscription will pull for messages automatically as long as there is at least one listener assigned for the message event. Available events:

                                                                                            Upon receipt of a message: on(event: 'message', listener: (message: Message) => void): this;

                                                                                            Upon receipt of an error: on(event: 'error', listener: (error: Error) => void): this;

                                                                                            Upon the closing of the subscriber: on(event: 'close', listener: Function): this;

                                                                                            By default Subscription objects allow you to process 100 messages at the same time. You can fine tune this value by adjusting the options.flowControl.maxMessages option.

                                                                                            If your subscription is seeing more re-deliveries than preferable, you might try increasing your options.ackDeadline value or decreasing the options.streamingOptions.maxStreams value.

                                                                                            Subscription objects handle ack management, by automatically extending the ack deadline while the message is being processed, to then issue the ack or nack of such message when the processing is done. **Note:** message redelivery is still possible.

                                                                                            By default each PubSub instance can handle 100 open streams, with default options this translates to less than 20 Subscriptions per PubSub instance. If you wish to create more Subscriptions than that, you can either create multiple PubSub instances or lower the options.streamingOptions.maxStreams value on each Subscription object.

                                                                                            Parameter pubsub

                                                                                            PubSub object.

                                                                                            Parameter name

                                                                                            The name of the subscription.

                                                                                            Parameter options

                                                                                            Options for handling messages.

                                                                                            Example 1

                                                                                            From PubSub#getSubscriptions

                                                                                            const {PubSub} = require('@google-cloud/pubsub');
                                                                                            const pubsub = new PubSub();
                                                                                            pubsub.getSubscriptions((err, subscriptions) => {
                                                                                            // `subscriptions` is an array of Subscription objects.
                                                                                            });

                                                                                            Example 2

                                                                                            From Topic#getSubscriptions

                                                                                            const topic = pubsub.topic('my-topic');
                                                                                            topic.getSubscriptions((err, subscriptions) => {
                                                                                            // `subscriptions` is an array of Subscription objects.
                                                                                            });

                                                                                            Example 3

                                                                                            Topic#createSubscription

                                                                                            const topic = pubsub.topic('my-topic');
                                                                                            topic.createSubscription('new-subscription', (err, subscription) => {
                                                                                            // `subscription` is a Subscription object.
                                                                                            });

                                                                                            Example 4

                                                                                            Topic#subscription

                                                                                            const topic = pubsub.topic('my-topic');
                                                                                            const subscription = topic.subscription('my-subscription');
                                                                                            // `subscription` is a Subscription object.

                                                                                            Example 5

                                                                                            Once you have obtained a subscription object, you may begin to register listeners. This will automatically trigger pulling for messages.

                                                                                            // Register an error handler.
                                                                                            subscription.on('error', (err) => {});
                                                                                            // Register a close handler in case the subscriber closes unexpectedly
                                                                                            subscription.on('close', () => {});
                                                                                            // Register a listener for `message` events.
                                                                                            function onMessage(message) {
                                                                                            // Called every time a message is received.
                                                                                            // message.id = ID of the message.
                                                                                            // message.ackId = ID used to acknowledge the message receival.
                                                                                            // message.data = Contents of the message.
                                                                                            // message.attributes = Attributes of the message.
                                                                                            // message.publishTime = Date when Pub/Sub received the message.
                                                                                            // Ack the message:
                                                                                            // message.ack();
                                                                                            // This doesn't ack the message, but allows more messages to be retrieved
                                                                                            // if your limit was hit or if you don't want to ack the message.
                                                                                            // message.nack();
                                                                                            }
                                                                                            subscription.on('message', onMessage);
                                                                                            // Remove the listener from receiving `message` events.
                                                                                            subscription.removeListener('message', onMessage);

                                                                                            Example 6

                                                                                            To apply a fine level of flow control, consider the following configuration

                                                                                            const subscription = topic.subscription('my-sub', {
                                                                                            flowControl: {
                                                                                            maxMessages: 1,
                                                                                            // this tells the client to manage and lock any excess messages
                                                                                            allowExcessMessages: false
                                                                                            }
                                                                                            });

                                                                                          constructor

                                                                                          constructor(pubsub: PubSub, name: string, options?: SubscriptionOptions);

                                                                                            property iam

                                                                                            iam: IAM;

                                                                                              property isOpen

                                                                                              readonly isOpen: boolean;
                                                                                              • Indicates if the Subscription is open and receiving messages.

                                                                                                {boolean}

                                                                                              property metadata

                                                                                              metadata?: google.pubsub.v1.ISubscription;

                                                                                                property name

                                                                                                name: string;

                                                                                                  property projectId

                                                                                                  readonly projectId: string;
                                                                                                  • {string}

                                                                                                  property pubsub

                                                                                                  pubsub: PubSub;

                                                                                                    property request

                                                                                                    request: <T, R = void>(
                                                                                                    config: RequestConfig,
                                                                                                    callback: RequestCallback<T, R>
                                                                                                    ) => void;

                                                                                                      property topic

                                                                                                      topic?: string | Topic;

                                                                                                        method close

                                                                                                        close: { (): Promise<void>; (callback: SubscriptionCloseCallback): void };
                                                                                                        • Closes the Subscription, once this is called you will no longer receive message events unless you call {Subscription#open} or add new message listeners.

                                                                                                          Parameter callback

                                                                                                          The callback function.

                                                                                                          Parameter

                                                                                                          {?error} callback.err An error returned while closing the Subscription.

                                                                                                          Example 1

                                                                                                          subscription.close(err => {
                                                                                                          if (err) {
                                                                                                          // Error handling omitted.
                                                                                                          }
                                                                                                          });
                                                                                                          // If the callback is omitted a Promise will be returned.
                                                                                                          subscription.close().then(() => {});

                                                                                                        method create

                                                                                                        create: {
                                                                                                        (options?: CreateSubscriptionOptions): Promise<CreateSubscriptionResponse>;
                                                                                                        (callback: SubscriptionCallback): void;
                                                                                                        (options: CreateSubscriptionOptions, callback: SubscriptionCallback): void;
                                                                                                        };
                                                                                                        • Create a subscription.

                                                                                                          Parameter name

                                                                                                          The name of the subscription.

                                                                                                          Parameter options

                                                                                                          See a [Subscription resource](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions).

                                                                                                          Parameter callback

                                                                                                          Callback function.

                                                                                                          Returns

                                                                                                          {Promise}

                                                                                                          Throws

                                                                                                          {Error} If subscription name is omitted.

                                                                                                          Example 1

                                                                                                          const {PubSub} = require('@google-cloud/pubsub');
                                                                                                          const pubsub = new PubSub();
                                                                                                          const topic = pubsub.topic('my-topic');
                                                                                                          const subscription = topic.subscription('newMessages');
                                                                                                          const callback = function(err, subscription, apiResponse) {};
                                                                                                          subscription.create(callback);

                                                                                                          Example 2

                                                                                                          With options

                                                                                                          subscription.create({
                                                                                                          ackDeadlineSeconds: 90
                                                                                                          }, callback);

                                                                                                          Example 3

                                                                                                          If the callback is omitted, we'll return a Promise.

                                                                                                          const [sub, apiResponse] = await subscription.create();

                                                                                                          See Also

                                                                                                        method createSnapshot

                                                                                                        createSnapshot: {
                                                                                                        (name: string, gaxOpts?: CallOptions): Promise<CreateSnapshotResponse>;
                                                                                                        (name: string, callback: CreateSnapshotCallback): void;
                                                                                                        (name: string, gaxOpts: CallOptions, callback: CreateSnapshotCallback): void;
                                                                                                        };
                                                                                                        • Create a snapshot with the given name.

                                                                                                          Parameter name

                                                                                                          Name of the snapshot.

                                                                                                          Parameter gaxOpts

                                                                                                          Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                                                          Parameter callback

                                                                                                          Callback function.

                                                                                                          Returns

                                                                                                          {Promise}

                                                                                                          Example 1

                                                                                                          const {PubSub} = require('@google-cloud/pubsub');
                                                                                                          const pubsub = new PubSub();
                                                                                                          const topic = pubsub.topic('my-topic');
                                                                                                          const subscription = topic.subscription('my-subscription');
                                                                                                          const callback = (err, snapshot, apiResponse) => {
                                                                                                          if (!err) {
                                                                                                          // The snapshot was created successfully.
                                                                                                          }
                                                                                                          };
                                                                                                          subscription.createSnapshot('my-snapshot', callback);
                                                                                                          //-
                                                                                                          // If the callback is omitted, we'll return a Promise.
                                                                                                          //-
                                                                                                          subscription.createSnapshot('my-snapshot').then((data) => {
                                                                                                          const snapshot = data[0];
                                                                                                          const apiResponse = data[1];
                                                                                                          });

                                                                                                        method delete

                                                                                                        delete: {
                                                                                                        (gaxOpts?: CallOptions): Promise<EmptyResponse>;
                                                                                                        (callback: NormalCallback<google.protobuf.IEmpty>): void;
                                                                                                        (
                                                                                                        gaxOpts: CallOptions,
                                                                                                        callback: NormalCallback<google.protobuf.IEmpty>
                                                                                                        ): void;
                                                                                                        };
                                                                                                        • Delete the subscription. Pull requests from the current subscription will be errored once unsubscription is complete.

                                                                                                          Parameter gaxOpts

                                                                                                          Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                                                          Parameter callback

                                                                                                          The callback function.

                                                                                                          Parameter

                                                                                                          {?error} callback.err An error returned while making this request.

                                                                                                          Parameter

                                                                                                          {object} callback.apiResponse Raw API response.

                                                                                                          Example 1

                                                                                                          const {PubSub} = require('@google-cloud/pubsub');
                                                                                                          const pubsub = new PubSub();
                                                                                                          const topic = pubsub.topic('my-topic');
                                                                                                          const subscription = topic.subscription('my-subscription');
                                                                                                          subscription.delete((err, apiResponse) => {});
                                                                                                          //-
                                                                                                          // If the callback is omitted, we'll return a Promise.
                                                                                                          //-
                                                                                                          subscription.delete().then((data) => {
                                                                                                          const apiResponse = data[0];
                                                                                                          });

                                                                                                          See Also

                                                                                                        method detached

                                                                                                        detached: {
                                                                                                        (): Promise<DetachedResponse>;
                                                                                                        (callback: NormalCallback<boolean>): void;
                                                                                                        };
                                                                                                        • Check if a subscription is detached.

                                                                                                          Parameter callback

                                                                                                          Callback function.

                                                                                                          Returns

                                                                                                          {Promise}

                                                                                                          Example 1

                                                                                                          const {PubSub} = require('@google-cloud/pubsub');
                                                                                                          const pubsub = new PubSub();
                                                                                                          const topic = pubsub.topic('my-topic');
                                                                                                          const subscription = topic.subscription('my-subscription');
                                                                                                          subscription.detached((err, exists) => {});
                                                                                                          //-
                                                                                                          // If the callback is omitted, we'll return a Promise.
                                                                                                          //-
                                                                                                          subscription.detached().then((data) => {
                                                                                                          const detached = data[0];
                                                                                                          });

                                                                                                        method exists

                                                                                                        exists: {
                                                                                                        (): Promise<ExistsResponse>;
                                                                                                        (callback: NormalCallback<boolean>): void;
                                                                                                        };
                                                                                                        • Check if a subscription exists.

                                                                                                          Parameter callback

                                                                                                          Callback function.

                                                                                                          Returns

                                                                                                          {Promise}

                                                                                                          Example 1

                                                                                                          const {PubSub} = require('@google-cloud/pubsub');
                                                                                                          const pubsub = new PubSub();
                                                                                                          const topic = pubsub.topic('my-topic');
                                                                                                          const subscription = topic.subscription('my-subscription');
                                                                                                          subscription.exists((err, exists) => {});
                                                                                                          //-
                                                                                                          // If the callback is omitted, we'll return a Promise.
                                                                                                          //-
                                                                                                          subscription.exists().then((data) => {
                                                                                                          const exists = data[0];
                                                                                                          });

                                                                                                        method formatMetadata_

                                                                                                        static formatMetadata_: (
                                                                                                        metadata: SubscriptionMetadata
                                                                                                        ) => google.pubsub.v1.ISubscription;

                                                                                                          method formatName_

                                                                                                          static formatName_: (projectId: string, name: string) => string;

                                                                                                            method get

                                                                                                            get: {
                                                                                                            (gaxOpts?: GetSubscriptionOptions): Promise<GetSubscriptionResponse>;
                                                                                                            (callback: SubscriptionCallback): void;
                                                                                                            (gaxOpts: any, callback: SubscriptionCallback): void;
                                                                                                            };
                                                                                                            • Get a subscription if it exists.

                                                                                                              Parameter gaxOpts

                                                                                                              Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                                                              Parameter

                                                                                                              {boolean} [gaxOpts.autoCreate=false] Automatically create the subscription if it does not already exist.

                                                                                                              Parameter callback

                                                                                                              Callback function.

                                                                                                              Returns

                                                                                                              {Promise}

                                                                                                              Example 1

                                                                                                              const {PubSub} = require('@google-cloud/pubsub');
                                                                                                              const pubsub = new PubSub();
                                                                                                              const topic = pubsub.topic('my-topic');
                                                                                                              const subscription = topic.subscription('my-subscription');
                                                                                                              subscription.get((err, subscription, apiResponse) => {
                                                                                                              // The `subscription` data has been populated.
                                                                                                              });
                                                                                                              //-
                                                                                                              // If the callback is omitted, we'll return a Promise.
                                                                                                              //-
                                                                                                              subscription.get().then((data) => {
                                                                                                              const subscription = data[0];
                                                                                                              const apiResponse = data[1];
                                                                                                              });

                                                                                                            method getMetadata

                                                                                                            getMetadata: {
                                                                                                            (gaxOpts?: CallOptions): Promise<GetSubscriptionMetadataResponse>;
                                                                                                            (callback: NormalCallback<google.pubsub.v1.ISubscription>): void;
                                                                                                            (
                                                                                                            gaxOpts: CallOptions,
                                                                                                            callback: NormalCallback<google.pubsub.v1.ISubscription>
                                                                                                            ): void;
                                                                                                            };
                                                                                                            • Fetches the subscriptions metadata.

                                                                                                              Parameter gaxOpts

                                                                                                              Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                                                              Parameter callback

                                                                                                              Callback function.

                                                                                                              Returns

                                                                                                              {Promise}

                                                                                                              Example 1

                                                                                                              const {PubSub} = require('@google-cloud/pubsub');
                                                                                                              const pubsub = new PubSub();
                                                                                                              const topic = pubsub.topic('my-topic');
                                                                                                              const subscription = topic.subscription('my-subscription');
                                                                                                              subscription.getMetadata((err, apiResponse) => {
                                                                                                              if (err) {
                                                                                                              // Error handling omitted.
                                                                                                              }
                                                                                                              });
                                                                                                              //-
                                                                                                              // If the callback is omitted, we'll return a Promise.
                                                                                                              //-
                                                                                                              subscription.getMetadata().then((data) => {
                                                                                                              const apiResponse = data[0];
                                                                                                              });

                                                                                                            method modifyPushConfig

                                                                                                            modifyPushConfig: {
                                                                                                            (config: PushConfig, gaxOpts?: CallOptions): Promise<EmptyResponse>;
                                                                                                            (
                                                                                                            config: google.pubsub.v1.IPushConfig,
                                                                                                            callback: NormalCallback<google.protobuf.IEmpty>
                                                                                                            ): void;
                                                                                                            (
                                                                                                            config: google.pubsub.v1.IPushConfig,
                                                                                                            gaxOpts: CallOptions,
                                                                                                            callback: NormalCallback<google.protobuf.IEmpty>
                                                                                                            ): void;
                                                                                                            };
                                                                                                            • Modify the push config for the subscription.

                                                                                                              Parameter config

                                                                                                              The push config.

                                                                                                              Parameter

                                                                                                              {string} config.pushEndpoint A URL locating the endpoint to which messages should be published.

                                                                                                              Parameter

                                                                                                              {object} config.attributes [PushConfig attributes](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#google.pubsub.v1.PushConfig).

                                                                                                              Parameter

                                                                                                              {object} config.oidcToken If specified, Pub/Sub will generate and attach an OIDC JWT token as an Authorization header in the HTTP request for every pushed message. This object should have the same structure as [OidcToken]google.pubsub.v1.OidcToken

                                                                                                              Parameter gaxOpts

                                                                                                              Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                                                              Parameter callback

                                                                                                              Callback function.

                                                                                                              Returns

                                                                                                              {Promise}

                                                                                                              Example 1

                                                                                                              const {PubSub} = require('@google-cloud/pubsub');
                                                                                                              const pubsub = new PubSub();
                                                                                                              const topic = pubsub.topic('my-topic');
                                                                                                              const subscription = topic.subscription('my-subscription');
                                                                                                              const pushConfig = {
                                                                                                              pushEndpoint: 'https://mydomain.com/push',
                                                                                                              attributes: {
                                                                                                              key: 'value'
                                                                                                              },
                                                                                                              oidcToken: {
                                                                                                              serviceAccountEmail: 'myproject@appspot.gserviceaccount.com',
                                                                                                              audience: 'myaudience'
                                                                                                              }
                                                                                                              };
                                                                                                              subscription.modifyPushConfig(pushConfig, (err, apiResponse) => {
                                                                                                              if (err) {
                                                                                                              // Error handling omitted.
                                                                                                              }
                                                                                                              });
                                                                                                              //-
                                                                                                              // If the callback is omitted, we'll return a Promise.
                                                                                                              //-
                                                                                                              subscription.modifyPushConfig(pushConfig).then((data) => {
                                                                                                              const apiResponse = data[0];
                                                                                                              });

                                                                                                            method open

                                                                                                            open: () => void;
                                                                                                            • Opens the Subscription to receive messages. In general this method shouldn't need to be called, unless you wish to receive messages after calling Subscription#close. Alternatively one could just assign a new message event listener which will also re-open the Subscription.

                                                                                                              Example 1

                                                                                                              subscription.on('message', message => message.ack());
                                                                                                              // Close the subscription.
                                                                                                              subscription.close(err => {
                                                                                                              if (err) {
                                                                                                              // Error handling omitted.
                                                                                                              }
                                                                                                              The subscription has been closed and messages will no longer be received.
                                                                                                              });
                                                                                                              // Resume receiving messages.
                                                                                                              subscription.open();

                                                                                                            method seek

                                                                                                            seek: {
                                                                                                            (snapshot: string | Date, gaxOpts?: CallOptions): Promise<SeekResponse>;
                                                                                                            (
                                                                                                            snapshot: string | Date,
                                                                                                            callback: NormalCallback<google.pubsub.v1.ISeekResponse>
                                                                                                            ): void;
                                                                                                            (
                                                                                                            snapshot: string | Date,
                                                                                                            gaxOpts: CallOptions,
                                                                                                            callback: NormalCallback<google.pubsub.v1.ISeekResponse>
                                                                                                            ): void;
                                                                                                            };
                                                                                                            • Seeks an existing subscription to a point in time or a given snapshot.

                                                                                                              Parameter snapshot

                                                                                                              The point to seek to. This will accept the name of the snapshot or a Date object.

                                                                                                              Parameter gaxOpts

                                                                                                              Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                                                              Parameter callback

                                                                                                              Callback function.

                                                                                                              Returns

                                                                                                              {Promise}

                                                                                                              Example 1

                                                                                                              const callback = (err, resp) => {
                                                                                                              if (!err) {
                                                                                                              // Seek was successful.
                                                                                                              }
                                                                                                              };
                                                                                                              subscription.seek('my-snapshot', callback);
                                                                                                              //-
                                                                                                              // Alternatively, to specify a certain point in time, you can provide a
                                                                                                              Date
                                                                                                              // object.
                                                                                                              //-
                                                                                                              const date = new Date('October 21 2015');
                                                                                                              subscription.seek(date, callback);

                                                                                                            method setMetadata

                                                                                                            setMetadata: {
                                                                                                            (
                                                                                                            metadata: SubscriptionMetadata,
                                                                                                            gaxOpts?: CallOptions
                                                                                                            ): Promise<SetSubscriptionMetadataResponse>;
                                                                                                            (
                                                                                                            metadata: SubscriptionMetadata,
                                                                                                            callback: NormalCallback<google.pubsub.v1.ISubscription>
                                                                                                            ): void;
                                                                                                            (
                                                                                                            metadata: SubscriptionMetadata,
                                                                                                            gaxOpts: CallOptions,
                                                                                                            callback: NormalCallback<google.pubsub.v1.ISubscription>
                                                                                                            ): void;
                                                                                                            };
                                                                                                            • Update the subscription object.

                                                                                                              Parameter metadata

                                                                                                              The subscription metadata.

                                                                                                              Parameter gaxOpts

                                                                                                              Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                                                              Parameter callback

                                                                                                              Callback function.

                                                                                                              Returns

                                                                                                              {Promise}

                                                                                                              Example 1

                                                                                                              const metadata = {
                                                                                                              key: 'value'
                                                                                                              };
                                                                                                              subscription.setMetadata(metadata, (err, apiResponse) => {
                                                                                                              if (err) {
                                                                                                              // Error handling omitted.
                                                                                                              }
                                                                                                              });
                                                                                                              //-
                                                                                                              // If the callback is omitted, we'll return a Promise.
                                                                                                              //-
                                                                                                              subscription.setMetadata(metadata).then((data) => {
                                                                                                              const apiResponse = data[0];
                                                                                                              });

                                                                                                            method setOptions

                                                                                                            setOptions: (options: SubscriberOptions) => void;
                                                                                                            • Sets the Subscription options.

                                                                                                              Parameter options

                                                                                                              The options.

                                                                                                            method snapshot

                                                                                                            snapshot: (name: string) => Snapshot;
                                                                                                            • Create a Snapshot object. See Subscription#createSnapshot to create a snapshot.

                                                                                                              Parameter name

                                                                                                              The name of the snapshot.

                                                                                                              Returns

                                                                                                              {Snapshot}

                                                                                                              Throws

                                                                                                              {Error} If a name is not provided.

                                                                                                              Example 1

                                                                                                              const snapshot = subscription.snapshot('my-snapshot');

                                                                                                            class Topic

                                                                                                            class Topic {}
                                                                                                            • A Topic object allows you to interact with a Cloud Pub/Sub topic.

                                                                                                              Parameter pubsub

                                                                                                              PubSub object.

                                                                                                              Parameter name

                                                                                                              Name of the topic.

                                                                                                              Parameter options

                                                                                                              Publisher configuration object.

                                                                                                              Example 1

                                                                                                              const {PubSub} = require('@google-cloud/pubsub');
                                                                                                              const pubsub = new PubSub();
                                                                                                              const topic = pubsub.topic('my-topic');

                                                                                                              Example 2

                                                                                                              To enable message ordering, set enableMessageOrdering to true. Please note that this does not persist to an actual topic.

                                                                                                              const topic = pubsub.topic('ordered-topic', {enableMessageOrdering: true});

                                                                                                            constructor

                                                                                                            constructor(pubsub: PubSub, name: string, options?: PublishOptions);

                                                                                                              property getSubscriptionsStream

                                                                                                              getSubscriptionsStream: () => ObjectStream<Subscription>;

                                                                                                                property iam

                                                                                                                iam: IAM;

                                                                                                                  property metadata

                                                                                                                  metadata?: google.pubsub.v1.ITopic;

                                                                                                                    property name

                                                                                                                    name: string;

                                                                                                                      property parent

                                                                                                                      parent: PubSub;

                                                                                                                        property publisher

                                                                                                                        publisher: Publisher;

                                                                                                                          property pubsub

                                                                                                                          pubsub: PubSub;

                                                                                                                            property request

                                                                                                                            request: <T, R = void>(
                                                                                                                            config: RequestConfig,
                                                                                                                            callback: RequestCallback<T, R>
                                                                                                                            ) => void;

                                                                                                                              method create

                                                                                                                              create: {
                                                                                                                              (gaxOpts?: CallOptions): Promise<CreateTopicResponse>;
                                                                                                                              (callback: TopicCallback): void;
                                                                                                                              (gaxOpts: CallOptions, callback: TopicCallback): void;
                                                                                                                              };
                                                                                                                              • Create a topic.

                                                                                                                                Parameter gaxOpts

                                                                                                                                Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                                                                                Parameter callback

                                                                                                                                Callback function.

                                                                                                                                Returns

                                                                                                                                {Promise}

                                                                                                                                Example 1

                                                                                                                                const {PubSub} = require('@google-cloud/pubsub');
                                                                                                                                const pubsub = new PubSub();
                                                                                                                                const topic = pubsub.topic('my-topic');
                                                                                                                                topic.create((err, topic, apiResponse) => {
                                                                                                                                if (!err) {
                                                                                                                                // The topic was created successfully.
                                                                                                                                }
                                                                                                                                });
                                                                                                                                //-
                                                                                                                                // If the callback is omitted, we'll return a Promise.
                                                                                                                                //-
                                                                                                                                topic.create().then((data) => {
                                                                                                                                const topic = data[0];
                                                                                                                                const apiResponse = data[1];
                                                                                                                                });

                                                                                                                              method createSubscription

                                                                                                                              createSubscription: {
                                                                                                                              (name: string, callback: SubscriptionCallback): void;
                                                                                                                              (
                                                                                                                              name: string,
                                                                                                                              options?: CreateSubscriptionOptions
                                                                                                                              ): Promise<SubscriptionResponse>;
                                                                                                                              (
                                                                                                                              name: string,
                                                                                                                              options: CreateSubscriptionOptions,
                                                                                                                              callback: SubscriptionCallback
                                                                                                                              ): void;
                                                                                                                              };
                                                                                                                              • Create a subscription to this topic.

                                                                                                                                Parameter name

                                                                                                                                The name of the subscription.

                                                                                                                                Parameter options

                                                                                                                                See a [Subscription resource](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions).

                                                                                                                                Parameter callback

                                                                                                                                Callback function.

                                                                                                                                Returns

                                                                                                                                {Promise}

                                                                                                                                Throws

                                                                                                                                {Error} If subscription name is omitted.

                                                                                                                                Example 1

                                                                                                                                const {PubSub} = require('@google-cloud/pubsub');
                                                                                                                                const pubsub = new PubSub();
                                                                                                                                const topic = pubsub.topic('my-topic');
                                                                                                                                const callback = function(err, subscription, apiResponse) {};
                                                                                                                                // Without specifying any options.
                                                                                                                                topic.createSubscription('newMessages', callback);
                                                                                                                                // With options.
                                                                                                                                topic.createSubscription('newMessages', {
                                                                                                                                ackDeadlineSeconds: 90
                                                                                                                                }, callback);
                                                                                                                                //-
                                                                                                                                // If the callback is omitted, we'll return a Promise.
                                                                                                                                //-
                                                                                                                                topic.createSubscription('newMessages').then((data) => {
                                                                                                                                const subscription = data[0];
                                                                                                                                const apiResponse = data[1];
                                                                                                                                });

                                                                                                                                See Also

                                                                                                                              method delete

                                                                                                                              delete: {
                                                                                                                              (callback: NormalCallback<google.protobuf.IEmpty>): void;
                                                                                                                              (gaxOpts?: CallOptions): Promise<EmptyResponse>;
                                                                                                                              (
                                                                                                                              gaxOpts: CallOptions,
                                                                                                                              callback: NormalCallback<google.protobuf.IEmpty>
                                                                                                                              ): void;
                                                                                                                              };
                                                                                                                              • Delete the topic. This will not delete subscriptions to this topic.

                                                                                                                                Parameter gaxOpts

                                                                                                                                Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                                                                                Parameter callback

                                                                                                                                The callback function.

                                                                                                                                Parameter

                                                                                                                                {?error} callback.err An error returned while making this request.

                                                                                                                                Parameter

                                                                                                                                {object} callback.apiResponse Raw API response.

                                                                                                                                Example 1

                                                                                                                                const {PubSub} = require('@google-cloud/pubsub');
                                                                                                                                const pubsub = new PubSub();
                                                                                                                                const topic = pubsub.topic('my-topic');
                                                                                                                                topic.delete((err, apiResponse) => {});
                                                                                                                                //-
                                                                                                                                // If the callback is omitted, we'll return a Promise.
                                                                                                                                //-
                                                                                                                                topic.delete().then((data) => {
                                                                                                                                const apiResponse = data[0];
                                                                                                                                });

                                                                                                                                See Also

                                                                                                                              method exists

                                                                                                                              exists: {
                                                                                                                              (): Promise<ExistsResponse>;
                                                                                                                              (callback: NormalCallback<boolean>): void;
                                                                                                                              };
                                                                                                                              • Check if a topic exists.

                                                                                                                                Parameter callback

                                                                                                                                Callback function.

                                                                                                                                Returns

                                                                                                                                {Promise}

                                                                                                                                Example 1

                                                                                                                                const {PubSub} = require('@google-cloud/pubsub');
                                                                                                                                const pubsub = new PubSub();
                                                                                                                                const topic = pubsub.topic('my-topic');
                                                                                                                                topic.exists((err, exists) => {});
                                                                                                                                //-
                                                                                                                                // If the callback is omitted, we'll return a Promise.
                                                                                                                                //-
                                                                                                                                topic.exists().then((data) => {
                                                                                                                                const exists = data[0];
                                                                                                                                });

                                                                                                                              method flowControlled

                                                                                                                              flowControlled: () => FlowControlledPublisher;
                                                                                                                              • Creates a FlowControlledPublisher for this Topic.

                                                                                                                                FlowControlledPublisher is a helper that lets you control how many messages are simultaneously queued to send, to avoid ballooning memory usage on a low bandwidth connection to Pub/Sub.

                                                                                                                                Note that it's perfectly fine to create more than one on the same Topic. The actual flow control settings on the Topic will apply across all FlowControlledPublisher objects on that Topic.

                                                                                                                                Returns

                                                                                                                                {FlowControlledPublisher} The flow control helper.

                                                                                                                              method flush

                                                                                                                              flush: {
                                                                                                                              (): Promise<void>;
                                                                                                                              (callback: NormalCallback<google.protobuf.IEmpty>): void;
                                                                                                                              };
                                                                                                                              • Immediately sends all remaining queued data. This is mostly useful if you are planning to call close() on the PubSub object that holds the server connections.

                                                                                                                                Parameter callback

                                                                                                                                Callback function.

                                                                                                                                Returns

                                                                                                                                {Promise}

                                                                                                                              method formatName_

                                                                                                                              static formatName_: (projectId: string, name: string) => string;
                                                                                                                              • Format the name of a topic. A Topic's full name is in the format of 'projects/{projectId}/topics/{topicName}'.

                                                                                                                                {string}

                                                                                                                              method get

                                                                                                                              get: {
                                                                                                                              (callback: TopicCallback): void;
                                                                                                                              (gaxOpts?: any): Promise<TopicResponse>;
                                                                                                                              (gaxOpts: any, callback: TopicCallback): void;
                                                                                                                              };
                                                                                                                              • Get a topic if it exists.

                                                                                                                                Parameter gaxOpts

                                                                                                                                Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                                                                                Parameter

                                                                                                                                {boolean} [gaxOpts.autoCreate=false] Automatically create the topic does not already exist.

                                                                                                                                Parameter callback

                                                                                                                                Callback function.

                                                                                                                                Returns

                                                                                                                                {Promise}

                                                                                                                                Example 1

                                                                                                                                const {PubSub} = require('@google-cloud/pubsub');
                                                                                                                                const pubsub = new PubSub();
                                                                                                                                const topic = pubsub.topic('my-topic');
                                                                                                                                topic.get((err, topic, apiResponse) => {
                                                                                                                                // The `topic` data has been populated.
                                                                                                                                });
                                                                                                                                //-
                                                                                                                                // If the callback is omitted, we'll return a Promise.
                                                                                                                                //-
                                                                                                                                topic.get().then((data) => {
                                                                                                                                const topic = data[0];
                                                                                                                                const apiResponse = data[1];
                                                                                                                                });

                                                                                                                              method getMetadata

                                                                                                                              getMetadata: {
                                                                                                                              (callback: NormalCallback<google.pubsub.v1.ITopic>): void;
                                                                                                                              (
                                                                                                                              gaxOpts: CallOptions,
                                                                                                                              callback: NormalCallback<google.pubsub.v1.ITopic>
                                                                                                                              ): void;
                                                                                                                              (gaxOpts?: CallOptions): Promise<MetadataResponse>;
                                                                                                                              };
                                                                                                                              • Get the official representation of this topic from the API.

                                                                                                                                Parameter gaxOpts

                                                                                                                                Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                                                                                Parameter callback

                                                                                                                                Callback function.

                                                                                                                                Returns

                                                                                                                                {Promise}

                                                                                                                                Example 1

                                                                                                                                const {PubSub} = require('@google-cloud/pubsub');
                                                                                                                                const pubsub = new PubSub();
                                                                                                                                const topic = pubsub.topic('my-topic');
                                                                                                                                topic.getMetadata((err, apiResponse) => {});
                                                                                                                                //-
                                                                                                                                // If the callback is omitted, we'll return a Promise.
                                                                                                                                //-
                                                                                                                                topic.getMetadata().then((data) => {
                                                                                                                                const apiResponse = data[0];
                                                                                                                                });

                                                                                                                                See Also

                                                                                                                              method getPublishOptionDefaults

                                                                                                                              getPublishOptionDefaults: () => PublishOptions;
                                                                                                                              • Get the default publisher options. These may be modified and passed back into Topic#setPublishOptions.

                                                                                                                                Example 1

                                                                                                                                const {PubSub} = require('@google-cloud/pubsub');
                                                                                                                                const pubsub = new PubSub();
                                                                                                                                const topic = pubsub.topic('my-topic');
                                                                                                                                const defaults = topic.getPublishOptionDefaults();
                                                                                                                                defaults.batching.maxMilliseconds = 10;
                                                                                                                                topic.setPublishOptions(defaults);

                                                                                                                              method getSubscriptions

                                                                                                                              getSubscriptions: {
                                                                                                                              (
                                                                                                                              callback: PagedCallback<
                                                                                                                              Subscription,
                                                                                                                              google.pubsub.v1.IListTopicSubscriptionsResponse
                                                                                                                              >
                                                                                                                              ): void;
                                                                                                                              (
                                                                                                                              options: PageOptions,
                                                                                                                              callback: PagedCallback<
                                                                                                                              Subscription,
                                                                                                                              google.pubsub.v1.IListTopicSubscriptionsResponse
                                                                                                                              >
                                                                                                                              ): void;
                                                                                                                              (options?: PageOptions): Promise<GetTopicSubscriptionsResponse>;
                                                                                                                              };
                                                                                                                              • Get a list of the subscriptions registered to this topic. You may optionally provide a query object as the first argument to customize the response.

                                                                                                                                Your provided callback will be invoked with an error object if an API error occurred or an array of {module:pubsub/subscription} objects.

                                                                                                                                Parameter query

                                                                                                                                Query object for listing subscriptions.

                                                                                                                                Parameter callback

                                                                                                                                Callback function.

                                                                                                                                Returns

                                                                                                                                {Promise}

                                                                                                                                Example 1

                                                                                                                                const {PubSub} = require('@google-cloud/pubsub');
                                                                                                                                const pubsub = new PubSub();
                                                                                                                                const topic = pubsub.topic('my-topic');
                                                                                                                                topic.getSubscriptions((err, subscriptions) => {
                                                                                                                                // subscriptions is an array of `Subscription` objects.
                                                                                                                                });
                                                                                                                                // Customize the query.
                                                                                                                                topic.getSubscriptions({
                                                                                                                                pageSize: 3
                                                                                                                                }, callback);
                                                                                                                                //-
                                                                                                                                // If the callback is omitted, we'll return a Promise.
                                                                                                                                //-
                                                                                                                                topic.getSubscriptions().then((data) => {
                                                                                                                                const subscriptions = data[0];
                                                                                                                                });

                                                                                                                                See Also

                                                                                                                              method publish

                                                                                                                              publish: {
                                                                                                                              (data: Buffer, attributes?: Attributes): Promise<string>;
                                                                                                                              (data: Buffer, callback: NormalCallback<string>): void;
                                                                                                                              (
                                                                                                                              data: Buffer,
                                                                                                                              attributes: Attributes,
                                                                                                                              callback: NormalCallback<string>
                                                                                                                              ): void;
                                                                                                                              };
                                                                                                                              • Publish the provided message.

                                                                                                                                Parameter data

                                                                                                                                The message data. This must come in the form of a Buffer object.

                                                                                                                                Parameter attributes

                                                                                                                                Attributes for this message.

                                                                                                                                Parameter callback

                                                                                                                                Callback function.

                                                                                                                                Returns

                                                                                                                                {Promise}

                                                                                                                                Throws

                                                                                                                                {TypeError} If data is not a Buffer object.

                                                                                                                                Throws

                                                                                                                                {TypeError} If any value in attributes object is not a string.

                                                                                                                                Example 1

                                                                                                                                const {PubSub} = require('@google-cloud/pubsub');
                                                                                                                                const pubsub = new PubSub();
                                                                                                                                const topic = pubsub.topic('my-topic');
                                                                                                                                const data = Buffer.from('Hello, world!');
                                                                                                                                const callback = (err, messageId) => {
                                                                                                                                if (err) {
                                                                                                                                // Error handling omitted.
                                                                                                                                }
                                                                                                                                };
                                                                                                                                topic.publish(data, callback);

                                                                                                                                Example 2

                                                                                                                                Optionally you can provide an object containing attributes for the message. Note that all values in the object must be strings.

                                                                                                                                const attributes = {
                                                                                                                                key: 'value'
                                                                                                                                };
                                                                                                                                topic.publish(data, attributes, callback);

                                                                                                                                Example 3

                                                                                                                                If the callback is omitted, we'll return a Promise.

                                                                                                                                topic.publish(data).then((messageId) => {});

                                                                                                                                Deprecated

                                                                                                                                Please use Topic#publishMessage.

                                                                                                                              method publishJSON

                                                                                                                              publishJSON: {
                                                                                                                              (json: object, attributes?: Attributes): Promise<string>;
                                                                                                                              (json: object, callback: NormalCallback<string>): void;
                                                                                                                              (
                                                                                                                              json: object,
                                                                                                                              attributes: Attributes,
                                                                                                                              callback: NormalCallback<string>
                                                                                                                              ): void;
                                                                                                                              };
                                                                                                                              • Publish the provided JSON. It should be noted that all messages published are done so in the form of a Buffer. This is simply a convenience method that will transform JSON into a Buffer before publishing. Subscription objects will always return message data in the form of a Buffer, so any JSON published will require manual deserialization.

                                                                                                                                Parameter json

                                                                                                                                The JSON data to publish.

                                                                                                                                Parameter attributes

                                                                                                                                Attributes for this message.

                                                                                                                                Parameter callback

                                                                                                                                Callback function.

                                                                                                                                Returns

                                                                                                                                {Promise}

                                                                                                                                Throws

                                                                                                                                {Error} If non-object data is provided.

                                                                                                                                Example 1

                                                                                                                                const {PubSub} = require('@google-cloud/pubsub');
                                                                                                                                const pubsub = new PubSub();
                                                                                                                                const topic = pubsub.topic('my-topic');
                                                                                                                                const data = {
                                                                                                                                foo: 'bar'
                                                                                                                                };
                                                                                                                                const callback = (err, messageId) => {
                                                                                                                                if (err) {
                                                                                                                                // Error handling omitted.
                                                                                                                                }
                                                                                                                                };
                                                                                                                                topic.publishJSON(data, callback);

                                                                                                                                Example 2

                                                                                                                                Optionally you can provide an object containing attributes for the message. Note that all values in the object must be strings.

                                                                                                                                const attributes = {
                                                                                                                                key: 'value'
                                                                                                                                };
                                                                                                                                topic.publishJSON(data, attributes, callback);

                                                                                                                                Example 3

                                                                                                                                If the callback is omitted, we'll return a Promise.

                                                                                                                                topic.publishJSON(data).then((messageId) => {});

                                                                                                                                Deprecated

                                                                                                                                Please use the json option via Topic#publishMessage.

                                                                                                                              method publishMessage

                                                                                                                              publishMessage: {
                                                                                                                              (message: MessageOptions): Promise<[string]>;
                                                                                                                              (message: MessageOptions, callback: NormalCallback<string>): void;
                                                                                                                              };
                                                                                                                              • Publish the provided message.

                                                                                                                                Parameter message

                                                                                                                                Message object.

                                                                                                                                Parameter callback

                                                                                                                                Callback function.

                                                                                                                                Returns

                                                                                                                                {Promise}

                                                                                                                                Throws

                                                                                                                                {TypeError} If data is not a Buffer object.

                                                                                                                                Throws

                                                                                                                                {TypeError} If any value in attributes object is not a string.

                                                                                                                                Example 1

                                                                                                                                const {PubSub} = require('@google-cloud/pubsub');
                                                                                                                                const pubsub = new PubSub();
                                                                                                                                const topic = pubsub.topic('my-topic');
                                                                                                                                const data = Buffer.from('Hello, world!');
                                                                                                                                const callback = (err, messageId) => {
                                                                                                                                if (err) {
                                                                                                                                // Error handling omitted.
                                                                                                                                }
                                                                                                                                };
                                                                                                                                topic.publishMessage({data}, callback);

                                                                                                                                Example 2

                                                                                                                                Publish JSON message data.

                                                                                                                                const json = {foo: 'bar'};
                                                                                                                                topic.publishMessage({json}, callback);

                                                                                                                                Example 3

                                                                                                                                To publish messages in order (this is still experimental), make sure message ordering is enabled and provide an ordering key

                                                                                                                                const topic = pubsub.topic('ordered-topic', {messageOrdering: true});
                                                                                                                                const orderingKey = 'my-key';
                                                                                                                                topic.publishMessage({data, orderingKey}, callback);

                                                                                                                                Example 4

                                                                                                                                If the callback is omitted, we'll return a Promise.

                                                                                                                                const [messageId] = await topic.publishMessage({data});

                                                                                                                              method resumePublishing

                                                                                                                              resumePublishing: (orderingKey: string) => void;
                                                                                                                              • In the event that the client fails to publish an ordered message, all subsequent publish calls using the same ordering key will fail. Calling this method will disregard the publish failure, allowing the supplied ordering key to be used again in the future.

                                                                                                                                Parameter orderingKey

                                                                                                                                The ordering key in question.

                                                                                                                                Example 1

                                                                                                                                const {PubSub} = require('@google-cloud/pubsub');
                                                                                                                                const pubsub = new PubSub();
                                                                                                                                const topic = pubsub.topic('my-topic', {messageOrdering: true});
                                                                                                                                const orderingKey = 'foo';
                                                                                                                                const data = Buffer.from('Hello, order!');
                                                                                                                                topic.publishMessage({data, orderingKey}, err => {
                                                                                                                                if (err) {
                                                                                                                                topic.resumePublishing(orderingKey);
                                                                                                                                }
                                                                                                                                });

                                                                                                                              method setMetadata

                                                                                                                              setMetadata: {
                                                                                                                              (
                                                                                                                              options: TopicMetadata,
                                                                                                                              gaxOpts?: CallOptions
                                                                                                                              ): Promise<SetTopicMetadataResponse>;
                                                                                                                              (
                                                                                                                              options: google.pubsub.v1.ITopic,
                                                                                                                              callback: NormalCallback<google.pubsub.v1.ITopic>
                                                                                                                              ): void;
                                                                                                                              (
                                                                                                                              options: google.pubsub.v1.ITopic,
                                                                                                                              gaxOpts: CallOptions,
                                                                                                                              callback: NormalCallback<google.pubsub.v1.ITopic>
                                                                                                                              ): void;
                                                                                                                              };
                                                                                                                              • Updates the topic.

                                                                                                                                Parameter metadata

                                                                                                                                The fields to update. This should be structured like a Topic object.

                                                                                                                                Parameter gaxOpts

                                                                                                                                Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.

                                                                                                                                Parameter callback

                                                                                                                                Callback function.

                                                                                                                                Returns

                                                                                                                                {Promise}

                                                                                                                                Example 1

                                                                                                                                const {PubSub} = require('@google-cloud/pubsub');
                                                                                                                                const pubsub = new PubSub();
                                                                                                                                const topic = pubsub.topic('my-topic');
                                                                                                                                const metadata = {
                                                                                                                                labels: {foo: 'bar'}
                                                                                                                                };
                                                                                                                                topic.setMetadata(metadata, err => {
                                                                                                                                if (err) {
                                                                                                                                // Error handling omitted.
                                                                                                                                }
                                                                                                                                });

                                                                                                                                Example 2

                                                                                                                                If the callback is omitted, we'll return a Promise.

                                                                                                                                topic.setMetadata(metadata).then((data) => {
                                                                                                                                const apiResponse = data[0];
                                                                                                                                });

                                                                                                                                See Also

                                                                                                                              method setPublishOptions

                                                                                                                              setPublishOptions: (options: PublishOptions) => void;
                                                                                                                              • Set the publisher options.

                                                                                                                                Parameter options

                                                                                                                                The publisher options.

                                                                                                                                Example 1

                                                                                                                                const {PubSub} = require('@google-cloud/pubsub');
                                                                                                                                const pubsub = new PubSub();
                                                                                                                                const topic = pubsub.topic('my-topic');
                                                                                                                                topic.setPublishOptions({
                                                                                                                                batching: {
                                                                                                                                maxMilliseconds: 10
                                                                                                                                }
                                                                                                                                });

                                                                                                                              method subscription

                                                                                                                              subscription: (name: string, options?: SubscriptionOptions) => Subscription;
                                                                                                                              • Create a Subscription object. This command by itself will not run any API requests. You will receive a {module:pubsub/subscription} object, which will allow you to interact with a subscription.

                                                                                                                                Parameter name

                                                                                                                                Name of the subscription.

                                                                                                                                Parameter options

                                                                                                                                Configuration object. {Subscription}

                                                                                                                                Throws

                                                                                                                                {Error} If subscription name is omitted.

                                                                                                                                Example 1

                                                                                                                                const {PubSub} = require('@google-cloud/pubsub');
                                                                                                                                const pubsub = new PubSub();
                                                                                                                                const topic = pubsub.topic('my-topic');
                                                                                                                                const subscription = topic.subscription('my-subscription');
                                                                                                                                // Register a listener for `message` events.
                                                                                                                                subscription.on('message', (message) => {
                                                                                                                                // Called every time a message is received.
                                                                                                                                // message.id = ID of the message.
                                                                                                                                // message.ackId = ID used to acknowledge the message receival.
                                                                                                                                // message.data = Contents of the message.
                                                                                                                                // message.attributes = Attributes of the message.
                                                                                                                                // message.publishTime = Timestamp when Pub/Sub received the message.
                                                                                                                                });

                                                                                                                              Interfaces

                                                                                                                              interface BatchPublishOptions

                                                                                                                              interface BatchPublishOptions {}

                                                                                                                                property maxBytes

                                                                                                                                maxBytes?: number;

                                                                                                                                  property maxMessages

                                                                                                                                  maxMessages?: number;

                                                                                                                                    property maxMilliseconds

                                                                                                                                    maxMilliseconds?: number;

                                                                                                                                      interface ClientConfig

                                                                                                                                      interface ClientConfig extends gax.GrpcClientOptions {}

                                                                                                                                        property apiEndpoint

                                                                                                                                        apiEndpoint?: string;

                                                                                                                                          property port

                                                                                                                                          port?: string | number;

                                                                                                                                            property servicePath

                                                                                                                                            servicePath?: string;

                                                                                                                                              property sslCreds

                                                                                                                                              sslCreds?: gax.grpc.ChannelCredentials;

                                                                                                                                                interface FlowControlOptions

                                                                                                                                                interface FlowControlOptions {}
                                                                                                                                                • FlowControlOptions {number} [maxOutstandingMessages] The maximum number of messages to buffer before publisher flow control kicks in. {number} [maxOutstandingBytes] The maximum number of bytes to buffer before publisher flow control kicks in.

                                                                                                                                                property maxOutstandingBytes

                                                                                                                                                maxOutstandingBytes?: number;

                                                                                                                                                  property maxOutstandingMessages

                                                                                                                                                  maxOutstandingMessages?: number;

                                                                                                                                                    interface IamPermissionsMap

                                                                                                                                                    interface IamPermissionsMap {}
                                                                                                                                                    • Shows which IAM permissions is allowed. The key to this object are the IAM permissions (string) and the values are booleans, true if permissions are granted to the corresponding key.

                                                                                                                                                    index signature

                                                                                                                                                    [key: string]: boolean;

                                                                                                                                                      interface PageOptions

                                                                                                                                                      interface PageOptions {}

                                                                                                                                                        property autoPaginate

                                                                                                                                                        autoPaginate?: boolean;

                                                                                                                                                          property gaxOpts

                                                                                                                                                          gaxOpts?: CallOptions;

                                                                                                                                                            property pageSize

                                                                                                                                                            pageSize?: number;

                                                                                                                                                              property pageToken

                                                                                                                                                              pageToken?: string;

                                                                                                                                                                interface PublishOptions

                                                                                                                                                                interface PublishOptions {}

                                                                                                                                                                  property batching

                                                                                                                                                                  batching?: BatchPublishOptions;

                                                                                                                                                                    property enableOpenTelemetryTracing

                                                                                                                                                                    enableOpenTelemetryTracing?: boolean;

                                                                                                                                                                      property flowControlOptions

                                                                                                                                                                      flowControlOptions?: FlowControlOptions;

                                                                                                                                                                        property gaxOpts

                                                                                                                                                                        gaxOpts?: CallOptions;

                                                                                                                                                                          property messageOrdering

                                                                                                                                                                          messageOrdering?: boolean;

                                                                                                                                                                            interface SchemaMessageMetadata

                                                                                                                                                                            interface SchemaMessageMetadata {}

                                                                                                                                                                            property encoding

                                                                                                                                                                            encoding: SchemaEncoding | undefined;
                                                                                                                                                                            • Encoding; this will be Encodings.Json or Encodings.Binary.

                                                                                                                                                                            property name

                                                                                                                                                                            name?: string;

                                                                                                                                                                            interface SubscriberOptions

                                                                                                                                                                            interface SubscriberOptions {}

                                                                                                                                                                              property ackDeadline

                                                                                                                                                                              ackDeadline?: number;

                                                                                                                                                                                property batching

                                                                                                                                                                                batching?: BatchOptions;

                                                                                                                                                                                  property enableOpenTelemetryTracing

                                                                                                                                                                                  enableOpenTelemetryTracing?: boolean;

                                                                                                                                                                                    property flowControl

                                                                                                                                                                                    flowControl?: FlowControlOptions;

                                                                                                                                                                                      property streamingOptions

                                                                                                                                                                                      streamingOptions?: MessageStreamOptions;

                                                                                                                                                                                        property useLegacyFlowControl

                                                                                                                                                                                        useLegacyFlowControl?: boolean;

                                                                                                                                                                                          Type Aliases

                                                                                                                                                                                          type Attributes

                                                                                                                                                                                          type Attributes = Record<string, string>;
                                                                                                                                                                                          • Strings are the only allowed values for keys and values in message attributes.

                                                                                                                                                                                          type CreateSchemaResponse

                                                                                                                                                                                          type CreateSchemaResponse = google.pubsub.v1.Schema;

                                                                                                                                                                                            type CreateSnapshotCallback

                                                                                                                                                                                            type CreateSnapshotCallback = ResourceCallback<Snapshot, google.pubsub.v1.ISnapshot>;

                                                                                                                                                                                              type CreateSnapshotResponse

                                                                                                                                                                                              type CreateSnapshotResponse = [Snapshot, google.pubsub.v1.ISnapshot];

                                                                                                                                                                                                type CreateSubscriptionCallback

                                                                                                                                                                                                type CreateSubscriptionCallback = SubscriptionCallback;

                                                                                                                                                                                                  type CreateSubscriptionOptions

                                                                                                                                                                                                  type CreateSubscriptionOptions = SubscriptionMetadata & {
                                                                                                                                                                                                  gaxOpts?: CallOptions;
                                                                                                                                                                                                  flowControl?: FlowControlOptions;
                                                                                                                                                                                                  };

                                                                                                                                                                                                    type CreateSubscriptionResponse

                                                                                                                                                                                                    type CreateSubscriptionResponse = SubscriptionResponse;

                                                                                                                                                                                                      type CreateTopicCallback

                                                                                                                                                                                                      type CreateTopicCallback = TopicCallback;

                                                                                                                                                                                                        type CreateTopicResponse

                                                                                                                                                                                                        type CreateTopicResponse = TopicResponse;

                                                                                                                                                                                                          type EmptyCallback

                                                                                                                                                                                                          type EmptyCallback = RequestCallback<google.protobuf.IEmpty>;

                                                                                                                                                                                                            type EmptyResponse

                                                                                                                                                                                                            type EmptyResponse = [google.protobuf.IEmpty];

                                                                                                                                                                                                              type ExistsCallback

                                                                                                                                                                                                              type ExistsCallback = RequestCallback<boolean>;

                                                                                                                                                                                                                type ExistsResponse

                                                                                                                                                                                                                type ExistsResponse = [boolean];

                                                                                                                                                                                                                  type GetPolicyCallback

                                                                                                                                                                                                                  type GetPolicyCallback = RequestCallback<Policy>;

                                                                                                                                                                                                                    type GetPolicyResponse

                                                                                                                                                                                                                    type GetPolicyResponse = [Policy];

                                                                                                                                                                                                                      type GetSnapshotsCallback

                                                                                                                                                                                                                      type GetSnapshotsCallback = RequestCallback<
                                                                                                                                                                                                                      Snapshot,
                                                                                                                                                                                                                      google.pubsub.v1.IListSnapshotsResponse
                                                                                                                                                                                                                      >;

                                                                                                                                                                                                                        type GetSnapshotsResponse

                                                                                                                                                                                                                        type GetSnapshotsResponse = PagedResponse<
                                                                                                                                                                                                                        Snapshot,
                                                                                                                                                                                                                        google.pubsub.v1.IListSnapshotsResponse
                                                                                                                                                                                                                        >;

                                                                                                                                                                                                                          type GetSubscriptionCallback

                                                                                                                                                                                                                          type GetSubscriptionCallback = SubscriptionCallback;

                                                                                                                                                                                                                            type GetSubscriptionMetadataCallback

                                                                                                                                                                                                                            type GetSubscriptionMetadataCallback = MetadataCallback;

                                                                                                                                                                                                                              type GetSubscriptionMetadataResponse

                                                                                                                                                                                                                              type GetSubscriptionMetadataResponse = MetadataResponse;

                                                                                                                                                                                                                                type GetSubscriptionOptions

                                                                                                                                                                                                                                type GetSubscriptionOptions = CallOptions & {
                                                                                                                                                                                                                                autoCreate?: boolean;
                                                                                                                                                                                                                                };

                                                                                                                                                                                                                                  type GetSubscriptionResponse

                                                                                                                                                                                                                                  type GetSubscriptionResponse = SubscriptionResponse;

                                                                                                                                                                                                                                    type GetSubscriptionsCallback

                                                                                                                                                                                                                                    type GetSubscriptionsCallback =
                                                                                                                                                                                                                                    | GetAllSubscriptionsCallback
                                                                                                                                                                                                                                    | GetTopicSubscriptionsCallback;

                                                                                                                                                                                                                                      type GetSubscriptionsResponse

                                                                                                                                                                                                                                      type GetSubscriptionsResponse =
                                                                                                                                                                                                                                      | GetAllSubscriptionsResponse
                                                                                                                                                                                                                                      | GetTopicSubscriptionsResponse;

                                                                                                                                                                                                                                        type GetTopicCallback

                                                                                                                                                                                                                                        type GetTopicCallback = TopicCallback;

                                                                                                                                                                                                                                          type GetTopicMetadataCallback

                                                                                                                                                                                                                                          type GetTopicMetadataCallback = MetadataCallback;

                                                                                                                                                                                                                                            type GetTopicMetadataResponse

                                                                                                                                                                                                                                            type GetTopicMetadataResponse = MetadataResponse;

                                                                                                                                                                                                                                              type GetTopicOptions

                                                                                                                                                                                                                                              type GetTopicOptions = CallOptions & {
                                                                                                                                                                                                                                              autoCreate?: boolean;
                                                                                                                                                                                                                                              };

                                                                                                                                                                                                                                                type GetTopicResponse

                                                                                                                                                                                                                                                type GetTopicResponse = TopicResponse;

                                                                                                                                                                                                                                                  type GetTopicsCallback

                                                                                                                                                                                                                                                  type GetTopicsCallback = RequestCallback<
                                                                                                                                                                                                                                                  Topic,
                                                                                                                                                                                                                                                  google.pubsub.v1.IListTopicsResponse
                                                                                                                                                                                                                                                  >;

                                                                                                                                                                                                                                                    type GetTopicsResponse

                                                                                                                                                                                                                                                    type GetTopicsResponse = PagedResponse<Topic, google.pubsub.v1.IListTopicsResponse>;

                                                                                                                                                                                                                                                      type GetTopicSubscriptionsCallback

                                                                                                                                                                                                                                                      type GetTopicSubscriptionsCallback = RequestCallback<
                                                                                                                                                                                                                                                      Subscription,
                                                                                                                                                                                                                                                      google.pubsub.v1.IListTopicSubscriptionsResponse
                                                                                                                                                                                                                                                      >;

                                                                                                                                                                                                                                                        type GetTopicSubscriptionsResponse

                                                                                                                                                                                                                                                        type GetTopicSubscriptionsResponse = PagedResponse<
                                                                                                                                                                                                                                                        Subscription,
                                                                                                                                                                                                                                                        google.pubsub.v1.IListTopicSubscriptionsResponse
                                                                                                                                                                                                                                                        >;

                                                                                                                                                                                                                                                          type ICreateSchemaRequest

                                                                                                                                                                                                                                                          type ICreateSchemaRequest = google.pubsub.v1.ICreateSchemaRequest;

                                                                                                                                                                                                                                                            type ISchema

                                                                                                                                                                                                                                                            type ISchema = google.pubsub.v1.ISchema;

                                                                                                                                                                                                                                                              type Policy

                                                                                                                                                                                                                                                              type Policy = {
                                                                                                                                                                                                                                                              etag?: string | Buffer;
                                                                                                                                                                                                                                                              } & Omit<IamProtos.google.iam.v1.IPolicy, 'etag'>;

                                                                                                                                                                                                                                                                type PublishCallback

                                                                                                                                                                                                                                                                type PublishCallback = RequestCallback<string>;

                                                                                                                                                                                                                                                                  type PushConfig

                                                                                                                                                                                                                                                                  type PushConfig = google.pubsub.v1.IPushConfig;

                                                                                                                                                                                                                                                                    type SchemaEncoding

                                                                                                                                                                                                                                                                    type SchemaEncoding = keyof typeof google.pubsub.v1.Encoding;

                                                                                                                                                                                                                                                                      type SchemaType

                                                                                                                                                                                                                                                                      type SchemaType = keyof typeof google.pubsub.v1.Schema.Type;

                                                                                                                                                                                                                                                                        type SchemaView

                                                                                                                                                                                                                                                                        type SchemaView = keyof typeof google.pubsub.v1.SchemaView;

                                                                                                                                                                                                                                                                          type SeekCallback

                                                                                                                                                                                                                                                                          type SeekCallback = RequestCallback<google.pubsub.v1.ISeekResponse>;

                                                                                                                                                                                                                                                                            type SeekResponse

                                                                                                                                                                                                                                                                            type SeekResponse = [google.pubsub.v1.ISeekResponse];

                                                                                                                                                                                                                                                                              type SetPolicyCallback

                                                                                                                                                                                                                                                                              type SetPolicyCallback = RequestCallback<Policy>;

                                                                                                                                                                                                                                                                                type SetPolicyResponse

                                                                                                                                                                                                                                                                                type SetPolicyResponse = [Policy];

                                                                                                                                                                                                                                                                                  type SetSubscriptionMetadataCallback

                                                                                                                                                                                                                                                                                  type SetSubscriptionMetadataCallback = MetadataCallback;

                                                                                                                                                                                                                                                                                    type SetSubscriptionMetadataResponse

                                                                                                                                                                                                                                                                                    type SetSubscriptionMetadataResponse = MetadataResponse;

                                                                                                                                                                                                                                                                                      type SetTopicMetadataCallback

                                                                                                                                                                                                                                                                                      type SetTopicMetadataCallback = MetadataCallback;

                                                                                                                                                                                                                                                                                        type SetTopicMetadataResponse

                                                                                                                                                                                                                                                                                        type SetTopicMetadataResponse = MetadataResponse;

                                                                                                                                                                                                                                                                                          type SubscriptionCloseCallback

                                                                                                                                                                                                                                                                                          type SubscriptionCloseCallback = (err?: Error) => void;

                                                                                                                                                                                                                                                                                            type SubscriptionMetadata

                                                                                                                                                                                                                                                                                            type SubscriptionMetadata = {
                                                                                                                                                                                                                                                                                            messageRetentionDuration?: google.protobuf.IDuration | number;
                                                                                                                                                                                                                                                                                            pushEndpoint?: string;
                                                                                                                                                                                                                                                                                            oidcToken?: OidcToken;
                                                                                                                                                                                                                                                                                            } & Omit<google.pubsub.v1.ISubscription, 'messageRetentionDuration'>;

                                                                                                                                                                                                                                                                                              type SubscriptionOptions

                                                                                                                                                                                                                                                                                              type SubscriptionOptions = SubscriberOptions & {
                                                                                                                                                                                                                                                                                              topic?: Topic;
                                                                                                                                                                                                                                                                                              };

                                                                                                                                                                                                                                                                                                type TestIamPermissionsCallback

                                                                                                                                                                                                                                                                                                type TestIamPermissionsCallback = ResourceCallback<
                                                                                                                                                                                                                                                                                                IamPermissionsMap,
                                                                                                                                                                                                                                                                                                IamProtos.google.iam.v1.ITestIamPermissionsResponse
                                                                                                                                                                                                                                                                                                >;

                                                                                                                                                                                                                                                                                                  type TestIamPermissionsResponse

                                                                                                                                                                                                                                                                                                  type TestIamPermissionsResponse = [
                                                                                                                                                                                                                                                                                                  IamPermissionsMap,
                                                                                                                                                                                                                                                                                                  IamProtos.google.iam.v1.ITestIamPermissionsResponse
                                                                                                                                                                                                                                                                                                  ];

                                                                                                                                                                                                                                                                                                    type TopicMetadata

                                                                                                                                                                                                                                                                                                    type TopicMetadata = google.pubsub.v1.ITopic;

                                                                                                                                                                                                                                                                                                      Namespaces

                                                                                                                                                                                                                                                                                                      namespace protos

                                                                                                                                                                                                                                                                                                      module 'build/protos/protos.d.ts' {}
                                                                                                                                                                                                                                                                                                      • Namespace google.

                                                                                                                                                                                                                                                                                                      namespace protos.google

                                                                                                                                                                                                                                                                                                      namespace protos.google {}
                                                                                                                                                                                                                                                                                                      • Namespace google.

                                                                                                                                                                                                                                                                                                      namespace protos.google.api

                                                                                                                                                                                                                                                                                                      namespace protos.google.api {}
                                                                                                                                                                                                                                                                                                      • Namespace api.

                                                                                                                                                                                                                                                                                                      class CustomHttpPattern

                                                                                                                                                                                                                                                                                                      class CustomHttpPattern implements ICustomHttpPattern {}
                                                                                                                                                                                                                                                                                                      • Represents a CustomHttpPattern.

                                                                                                                                                                                                                                                                                                      constructor

                                                                                                                                                                                                                                                                                                      constructor(properties?: ICustomHttpPattern);
                                                                                                                                                                                                                                                                                                      • Constructs a new CustomHttpPattern.

                                                                                                                                                                                                                                                                                                        Parameter properties

                                                                                                                                                                                                                                                                                                        Properties to set

                                                                                                                                                                                                                                                                                                      property kind

                                                                                                                                                                                                                                                                                                      kind: string;
                                                                                                                                                                                                                                                                                                      • CustomHttpPattern kind.

                                                                                                                                                                                                                                                                                                      property path

                                                                                                                                                                                                                                                                                                      path: string;
                                                                                                                                                                                                                                                                                                      • CustomHttpPattern path.

                                                                                                                                                                                                                                                                                                      method create

                                                                                                                                                                                                                                                                                                      static create: (
                                                                                                                                                                                                                                                                                                      properties?: google.api.ICustomHttpPattern
                                                                                                                                                                                                                                                                                                      ) => google.api.CustomHttpPattern;
                                                                                                                                                                                                                                                                                                      • Creates a new CustomHttpPattern instance using the specified properties.

                                                                                                                                                                                                                                                                                                        Parameter properties

                                                                                                                                                                                                                                                                                                        Properties to set

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        CustomHttpPattern instance

                                                                                                                                                                                                                                                                                                      method decode

                                                                                                                                                                                                                                                                                                      static decode: (
                                                                                                                                                                                                                                                                                                      reader: $protobuf.Reader | Uint8Array,
                                                                                                                                                                                                                                                                                                      length?: number
                                                                                                                                                                                                                                                                                                      ) => google.api.CustomHttpPattern;
                                                                                                                                                                                                                                                                                                      • Decodes a CustomHttpPattern message from the specified reader or buffer.

                                                                                                                                                                                                                                                                                                        Parameter reader

                                                                                                                                                                                                                                                                                                        Reader or buffer to decode from

                                                                                                                                                                                                                                                                                                        Parameter length

                                                                                                                                                                                                                                                                                                        Message length if known beforehand

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        CustomHttpPattern

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {Error} If the payload is not a reader or valid buffer

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {$protobuf.util.ProtocolError} If required fields are missing

                                                                                                                                                                                                                                                                                                      method decodeDelimited

                                                                                                                                                                                                                                                                                                      static decodeDelimited: (
                                                                                                                                                                                                                                                                                                      reader: $protobuf.Reader | Uint8Array
                                                                                                                                                                                                                                                                                                      ) => google.api.CustomHttpPattern;
                                                                                                                                                                                                                                                                                                      • Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited.

                                                                                                                                                                                                                                                                                                        Parameter reader

                                                                                                                                                                                                                                                                                                        Reader or buffer to decode from

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        CustomHttpPattern

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {Error} If the payload is not a reader or valid buffer

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {$protobuf.util.ProtocolError} If required fields are missing

                                                                                                                                                                                                                                                                                                      method encode

                                                                                                                                                                                                                                                                                                      static encode: (
                                                                                                                                                                                                                                                                                                      message: google.api.ICustomHttpPattern,
                                                                                                                                                                                                                                                                                                      writer?: $protobuf.Writer
                                                                                                                                                                                                                                                                                                      ) => $protobuf.Writer;
                                                                                                                                                                                                                                                                                                      • Encodes the specified CustomHttpPattern message. Does not implicitly verify messages.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        CustomHttpPattern message or plain object to encode

                                                                                                                                                                                                                                                                                                        Parameter writer

                                                                                                                                                                                                                                                                                                        Writer to encode to

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Writer

                                                                                                                                                                                                                                                                                                      method encodeDelimited

                                                                                                                                                                                                                                                                                                      static encodeDelimited: (
                                                                                                                                                                                                                                                                                                      message: google.api.ICustomHttpPattern,
                                                                                                                                                                                                                                                                                                      writer?: $protobuf.Writer
                                                                                                                                                                                                                                                                                                      ) => $protobuf.Writer;
                                                                                                                                                                                                                                                                                                      • Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly verify messages.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        CustomHttpPattern message or plain object to encode

                                                                                                                                                                                                                                                                                                        Parameter writer

                                                                                                                                                                                                                                                                                                        Writer to encode to

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Writer

                                                                                                                                                                                                                                                                                                      method fromObject

                                                                                                                                                                                                                                                                                                      static fromObject: (object: {
                                                                                                                                                                                                                                                                                                      [k: string]: any;
                                                                                                                                                                                                                                                                                                      }) => google.api.CustomHttpPattern;
                                                                                                                                                                                                                                                                                                      • Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types.

                                                                                                                                                                                                                                                                                                        Parameter object

                                                                                                                                                                                                                                                                                                        Plain object

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        CustomHttpPattern

                                                                                                                                                                                                                                                                                                      method toJSON

                                                                                                                                                                                                                                                                                                      toJSON: () => { [k: string]: any };
                                                                                                                                                                                                                                                                                                      • Converts this CustomHttpPattern to JSON.

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        JSON object

                                                                                                                                                                                                                                                                                                      method toObject

                                                                                                                                                                                                                                                                                                      static toObject: (
                                                                                                                                                                                                                                                                                                      message: google.api.CustomHttpPattern,
                                                                                                                                                                                                                                                                                                      options?: $protobuf.IConversionOptions
                                                                                                                                                                                                                                                                                                      ) => { [k: string]: any };
                                                                                                                                                                                                                                                                                                      • Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        CustomHttpPattern

                                                                                                                                                                                                                                                                                                        Parameter options

                                                                                                                                                                                                                                                                                                        Conversion options

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Plain object

                                                                                                                                                                                                                                                                                                      method verify

                                                                                                                                                                                                                                                                                                      static verify: (message: { [k: string]: any }) => string | null;
                                                                                                                                                                                                                                                                                                      • Verifies a CustomHttpPattern message.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        Plain object to verify

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        null if valid, otherwise the reason why it is not

                                                                                                                                                                                                                                                                                                      class Http

                                                                                                                                                                                                                                                                                                      class Http implements IHttp {}
                                                                                                                                                                                                                                                                                                      • Represents a Http.

                                                                                                                                                                                                                                                                                                      constructor

                                                                                                                                                                                                                                                                                                      constructor(properties?: IHttp);
                                                                                                                                                                                                                                                                                                      • Constructs a new Http.

                                                                                                                                                                                                                                                                                                        Parameter properties

                                                                                                                                                                                                                                                                                                        Properties to set

                                                                                                                                                                                                                                                                                                      property fullyDecodeReservedExpansion

                                                                                                                                                                                                                                                                                                      fullyDecodeReservedExpansion: boolean;
                                                                                                                                                                                                                                                                                                      • Http fullyDecodeReservedExpansion.

                                                                                                                                                                                                                                                                                                      property rules

                                                                                                                                                                                                                                                                                                      rules: IHttpRule[];
                                                                                                                                                                                                                                                                                                      • Http rules.

                                                                                                                                                                                                                                                                                                      method create

                                                                                                                                                                                                                                                                                                      static create: (properties?: google.api.IHttp) => google.api.Http;
                                                                                                                                                                                                                                                                                                      • Creates a new Http instance using the specified properties.

                                                                                                                                                                                                                                                                                                        Parameter properties

                                                                                                                                                                                                                                                                                                        Properties to set

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Http instance

                                                                                                                                                                                                                                                                                                      method decode

                                                                                                                                                                                                                                                                                                      static decode: (
                                                                                                                                                                                                                                                                                                      reader: $protobuf.Reader | Uint8Array,
                                                                                                                                                                                                                                                                                                      length?: number
                                                                                                                                                                                                                                                                                                      ) => google.api.Http;
                                                                                                                                                                                                                                                                                                      • Decodes a Http message from the specified reader or buffer.

                                                                                                                                                                                                                                                                                                        Parameter reader

                                                                                                                                                                                                                                                                                                        Reader or buffer to decode from

                                                                                                                                                                                                                                                                                                        Parameter length

                                                                                                                                                                                                                                                                                                        Message length if known beforehand

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Http

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {Error} If the payload is not a reader or valid buffer

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {$protobuf.util.ProtocolError} If required fields are missing

                                                                                                                                                                                                                                                                                                      method decodeDelimited

                                                                                                                                                                                                                                                                                                      static decodeDelimited: (
                                                                                                                                                                                                                                                                                                      reader: $protobuf.Reader | Uint8Array
                                                                                                                                                                                                                                                                                                      ) => google.api.Http;
                                                                                                                                                                                                                                                                                                      • Decodes a Http message from the specified reader or buffer, length delimited.

                                                                                                                                                                                                                                                                                                        Parameter reader

                                                                                                                                                                                                                                                                                                        Reader or buffer to decode from

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Http

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {Error} If the payload is not a reader or valid buffer

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {$protobuf.util.ProtocolError} If required fields are missing

                                                                                                                                                                                                                                                                                                      method encode

                                                                                                                                                                                                                                                                                                      static encode: (
                                                                                                                                                                                                                                                                                                      message: google.api.IHttp,
                                                                                                                                                                                                                                                                                                      writer?: $protobuf.Writer
                                                                                                                                                                                                                                                                                                      ) => $protobuf.Writer;
                                                                                                                                                                                                                                                                                                      • Encodes the specified Http message. Does not implicitly verify messages.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        Http message or plain object to encode

                                                                                                                                                                                                                                                                                                        Parameter writer

                                                                                                                                                                                                                                                                                                        Writer to encode to

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Writer

                                                                                                                                                                                                                                                                                                      method encodeDelimited

                                                                                                                                                                                                                                                                                                      static encodeDelimited: (
                                                                                                                                                                                                                                                                                                      message: google.api.IHttp,
                                                                                                                                                                                                                                                                                                      writer?: $protobuf.Writer
                                                                                                                                                                                                                                                                                                      ) => $protobuf.Writer;
                                                                                                                                                                                                                                                                                                      • Encodes the specified Http message, length delimited. Does not implicitly verify messages.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        Http message or plain object to encode

                                                                                                                                                                                                                                                                                                        Parameter writer

                                                                                                                                                                                                                                                                                                        Writer to encode to

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Writer

                                                                                                                                                                                                                                                                                                      method fromObject

                                                                                                                                                                                                                                                                                                      static fromObject: (object: { [k: string]: any }) => google.api.Http;
                                                                                                                                                                                                                                                                                                      • Creates a Http message from a plain object. Also converts values to their respective internal types.

                                                                                                                                                                                                                                                                                                        Parameter object

                                                                                                                                                                                                                                                                                                        Plain object

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Http

                                                                                                                                                                                                                                                                                                      method toJSON

                                                                                                                                                                                                                                                                                                      toJSON: () => { [k: string]: any };
                                                                                                                                                                                                                                                                                                      • Converts this Http to JSON.

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        JSON object

                                                                                                                                                                                                                                                                                                      method toObject

                                                                                                                                                                                                                                                                                                      static toObject: (
                                                                                                                                                                                                                                                                                                      message: google.api.Http,
                                                                                                                                                                                                                                                                                                      options?: $protobuf.IConversionOptions
                                                                                                                                                                                                                                                                                                      ) => { [k: string]: any };
                                                                                                                                                                                                                                                                                                      • Creates a plain object from a Http message. Also converts values to other types if specified.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        Http

                                                                                                                                                                                                                                                                                                        Parameter options

                                                                                                                                                                                                                                                                                                        Conversion options

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Plain object

                                                                                                                                                                                                                                                                                                      method verify

                                                                                                                                                                                                                                                                                                      static verify: (message: { [k: string]: any }) => string | null;
                                                                                                                                                                                                                                                                                                      • Verifies a Http message.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        Plain object to verify

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        null if valid, otherwise the reason why it is not

                                                                                                                                                                                                                                                                                                      class HttpRule

                                                                                                                                                                                                                                                                                                      class HttpRule implements IHttpRule {}
                                                                                                                                                                                                                                                                                                      • Represents a HttpRule.

                                                                                                                                                                                                                                                                                                      constructor

                                                                                                                                                                                                                                                                                                      constructor(properties?: IHttpRule);
                                                                                                                                                                                                                                                                                                      • Constructs a new HttpRule.

                                                                                                                                                                                                                                                                                                        Parameter properties

                                                                                                                                                                                                                                                                                                        Properties to set

                                                                                                                                                                                                                                                                                                      property additionalBindings

                                                                                                                                                                                                                                                                                                      additionalBindings: IHttpRule[];
                                                                                                                                                                                                                                                                                                      • HttpRule additionalBindings.

                                                                                                                                                                                                                                                                                                      property body

                                                                                                                                                                                                                                                                                                      body: string;
                                                                                                                                                                                                                                                                                                      • HttpRule body.

                                                                                                                                                                                                                                                                                                      property custom

                                                                                                                                                                                                                                                                                                      custom?: ICustomHttpPattern;
                                                                                                                                                                                                                                                                                                      • HttpRule custom.

                                                                                                                                                                                                                                                                                                      property delete

                                                                                                                                                                                                                                                                                                      delete?: string;
                                                                                                                                                                                                                                                                                                      • HttpRule delete.

                                                                                                                                                                                                                                                                                                      property get

                                                                                                                                                                                                                                                                                                      get?: string;
                                                                                                                                                                                                                                                                                                      • HttpRule get.

                                                                                                                                                                                                                                                                                                      property patch

                                                                                                                                                                                                                                                                                                      patch?: string;
                                                                                                                                                                                                                                                                                                      • HttpRule patch.

                                                                                                                                                                                                                                                                                                      property pattern

                                                                                                                                                                                                                                                                                                      pattern?: 'get' | 'put' | 'post' | 'delete' | 'patch' | 'custom';
                                                                                                                                                                                                                                                                                                      • HttpRule pattern.

                                                                                                                                                                                                                                                                                                      property post

                                                                                                                                                                                                                                                                                                      post?: string;
                                                                                                                                                                                                                                                                                                      • HttpRule post.

                                                                                                                                                                                                                                                                                                      property put

                                                                                                                                                                                                                                                                                                      put?: string;
                                                                                                                                                                                                                                                                                                      • HttpRule put.

                                                                                                                                                                                                                                                                                                      property responseBody

                                                                                                                                                                                                                                                                                                      responseBody: string;
                                                                                                                                                                                                                                                                                                      • HttpRule responseBody.

                                                                                                                                                                                                                                                                                                      property selector

                                                                                                                                                                                                                                                                                                      selector: string;
                                                                                                                                                                                                                                                                                                      • HttpRule selector.

                                                                                                                                                                                                                                                                                                      method create

                                                                                                                                                                                                                                                                                                      static create: (properties?: google.api.IHttpRule) => google.api.HttpRule;
                                                                                                                                                                                                                                                                                                      • Creates a new HttpRule instance using the specified properties.

                                                                                                                                                                                                                                                                                                        Parameter properties

                                                                                                                                                                                                                                                                                                        Properties to set

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        HttpRule instance

                                                                                                                                                                                                                                                                                                      method decode

                                                                                                                                                                                                                                                                                                      static decode: (
                                                                                                                                                                                                                                                                                                      reader: $protobuf.Reader | Uint8Array,
                                                                                                                                                                                                                                                                                                      length?: number
                                                                                                                                                                                                                                                                                                      ) => google.api.HttpRule;
                                                                                                                                                                                                                                                                                                      • Decodes a HttpRule message from the specified reader or buffer.

                                                                                                                                                                                                                                                                                                        Parameter reader

                                                                                                                                                                                                                                                                                                        Reader or buffer to decode from

                                                                                                                                                                                                                                                                                                        Parameter length

                                                                                                                                                                                                                                                                                                        Message length if known beforehand

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        HttpRule

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {Error} If the payload is not a reader or valid buffer

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {$protobuf.util.ProtocolError} If required fields are missing

                                                                                                                                                                                                                                                                                                      method decodeDelimited

                                                                                                                                                                                                                                                                                                      static decodeDelimited: (
                                                                                                                                                                                                                                                                                                      reader: $protobuf.Reader | Uint8Array
                                                                                                                                                                                                                                                                                                      ) => google.api.HttpRule;
                                                                                                                                                                                                                                                                                                      • Decodes a HttpRule message from the specified reader or buffer, length delimited.

                                                                                                                                                                                                                                                                                                        Parameter reader

                                                                                                                                                                                                                                                                                                        Reader or buffer to decode from

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        HttpRule

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {Error} If the payload is not a reader or valid buffer

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {$protobuf.util.ProtocolError} If required fields are missing

                                                                                                                                                                                                                                                                                                      method encode

                                                                                                                                                                                                                                                                                                      static encode: (
                                                                                                                                                                                                                                                                                                      message: google.api.IHttpRule,
                                                                                                                                                                                                                                                                                                      writer?: $protobuf.Writer
                                                                                                                                                                                                                                                                                                      ) => $protobuf.Writer;
                                                                                                                                                                                                                                                                                                      • Encodes the specified HttpRule message. Does not implicitly verify messages.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        HttpRule message or plain object to encode

                                                                                                                                                                                                                                                                                                        Parameter writer

                                                                                                                                                                                                                                                                                                        Writer to encode to

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Writer

                                                                                                                                                                                                                                                                                                      method encodeDelimited

                                                                                                                                                                                                                                                                                                      static encodeDelimited: (
                                                                                                                                                                                                                                                                                                      message: google.api.IHttpRule,
                                                                                                                                                                                                                                                                                                      writer?: $protobuf.Writer
                                                                                                                                                                                                                                                                                                      ) => $protobuf.Writer;
                                                                                                                                                                                                                                                                                                      • Encodes the specified HttpRule message, length delimited. Does not implicitly verify messages.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        HttpRule message or plain object to encode

                                                                                                                                                                                                                                                                                                        Parameter writer

                                                                                                                                                                                                                                                                                                        Writer to encode to

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Writer

                                                                                                                                                                                                                                                                                                      method fromObject

                                                                                                                                                                                                                                                                                                      static fromObject: (object: { [k: string]: any }) => google.api.HttpRule;
                                                                                                                                                                                                                                                                                                      • Creates a HttpRule message from a plain object. Also converts values to their respective internal types.

                                                                                                                                                                                                                                                                                                        Parameter object

                                                                                                                                                                                                                                                                                                        Plain object

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        HttpRule

                                                                                                                                                                                                                                                                                                      method toJSON

                                                                                                                                                                                                                                                                                                      toJSON: () => { [k: string]: any };
                                                                                                                                                                                                                                                                                                      • Converts this HttpRule to JSON.

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        JSON object

                                                                                                                                                                                                                                                                                                      method toObject

                                                                                                                                                                                                                                                                                                      static toObject: (
                                                                                                                                                                                                                                                                                                      message: google.api.HttpRule,
                                                                                                                                                                                                                                                                                                      options?: $protobuf.IConversionOptions
                                                                                                                                                                                                                                                                                                      ) => { [k: string]: any };
                                                                                                                                                                                                                                                                                                      • Creates a plain object from a HttpRule message. Also converts values to other types if specified.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        HttpRule

                                                                                                                                                                                                                                                                                                        Parameter options

                                                                                                                                                                                                                                                                                                        Conversion options

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Plain object

                                                                                                                                                                                                                                                                                                      method verify

                                                                                                                                                                                                                                                                                                      static verify: (message: { [k: string]: any }) => string | null;
                                                                                                                                                                                                                                                                                                      • Verifies a HttpRule message.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        Plain object to verify

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        null if valid, otherwise the reason why it is not

                                                                                                                                                                                                                                                                                                      class ResourceDescriptor

                                                                                                                                                                                                                                                                                                      class ResourceDescriptor implements IResourceDescriptor {}
                                                                                                                                                                                                                                                                                                      • Represents a ResourceDescriptor.

                                                                                                                                                                                                                                                                                                      constructor

                                                                                                                                                                                                                                                                                                      constructor(properties?: IResourceDescriptor);
                                                                                                                                                                                                                                                                                                      • Constructs a new ResourceDescriptor.

                                                                                                                                                                                                                                                                                                        Parameter properties

                                                                                                                                                                                                                                                                                                        Properties to set

                                                                                                                                                                                                                                                                                                      property history

                                                                                                                                                                                                                                                                                                      history:
                                                                                                                                                                                                                                                                                                      | ResourceDescriptor.History
                                                                                                                                                                                                                                                                                                      | 'HISTORY_UNSPECIFIED'
                                                                                                                                                                                                                                                                                                      | 'ORIGINALLY_SINGLE_PATTERN'
                                                                                                                                                                                                                                                                                                      | 'FUTURE_MULTI_PATTERN';
                                                                                                                                                                                                                                                                                                      • ResourceDescriptor history.

                                                                                                                                                                                                                                                                                                      property nameField

                                                                                                                                                                                                                                                                                                      nameField: string;
                                                                                                                                                                                                                                                                                                      • ResourceDescriptor nameField.

                                                                                                                                                                                                                                                                                                      property pattern

                                                                                                                                                                                                                                                                                                      pattern: string[];
                                                                                                                                                                                                                                                                                                      • ResourceDescriptor pattern.

                                                                                                                                                                                                                                                                                                      property plural

                                                                                                                                                                                                                                                                                                      plural: string;
                                                                                                                                                                                                                                                                                                      • ResourceDescriptor plural.

                                                                                                                                                                                                                                                                                                      property singular

                                                                                                                                                                                                                                                                                                      singular: string;
                                                                                                                                                                                                                                                                                                      • ResourceDescriptor singular.

                                                                                                                                                                                                                                                                                                      property style

                                                                                                                                                                                                                                                                                                      style: ResourceDescriptor.Style[];
                                                                                                                                                                                                                                                                                                      • ResourceDescriptor style.

                                                                                                                                                                                                                                                                                                      property type

                                                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                                                      • ResourceDescriptor type.

                                                                                                                                                                                                                                                                                                      method create

                                                                                                                                                                                                                                                                                                      static create: (
                                                                                                                                                                                                                                                                                                      properties?: google.api.IResourceDescriptor
                                                                                                                                                                                                                                                                                                      ) => google.api.ResourceDescriptor;
                                                                                                                                                                                                                                                                                                      • Creates a new ResourceDescriptor instance using the specified properties.

                                                                                                                                                                                                                                                                                                        Parameter properties

                                                                                                                                                                                                                                                                                                        Properties to set

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        ResourceDescriptor instance

                                                                                                                                                                                                                                                                                                      method decode

                                                                                                                                                                                                                                                                                                      static decode: (
                                                                                                                                                                                                                                                                                                      reader: $protobuf.Reader | Uint8Array,
                                                                                                                                                                                                                                                                                                      length?: number
                                                                                                                                                                                                                                                                                                      ) => google.api.ResourceDescriptor;
                                                                                                                                                                                                                                                                                                      • Decodes a ResourceDescriptor message from the specified reader or buffer.

                                                                                                                                                                                                                                                                                                        Parameter reader

                                                                                                                                                                                                                                                                                                        Reader or buffer to decode from

                                                                                                                                                                                                                                                                                                        Parameter length

                                                                                                                                                                                                                                                                                                        Message length if known beforehand

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        ResourceDescriptor

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {Error} If the payload is not a reader or valid buffer

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {$protobuf.util.ProtocolError} If required fields are missing

                                                                                                                                                                                                                                                                                                      method decodeDelimited

                                                                                                                                                                                                                                                                                                      static decodeDelimited: (
                                                                                                                                                                                                                                                                                                      reader: $protobuf.Reader | Uint8Array
                                                                                                                                                                                                                                                                                                      ) => google.api.ResourceDescriptor;
                                                                                                                                                                                                                                                                                                      • Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited.

                                                                                                                                                                                                                                                                                                        Parameter reader

                                                                                                                                                                                                                                                                                                        Reader or buffer to decode from

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        ResourceDescriptor

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {Error} If the payload is not a reader or valid buffer

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {$protobuf.util.ProtocolError} If required fields are missing

                                                                                                                                                                                                                                                                                                      method encode

                                                                                                                                                                                                                                                                                                      static encode: (
                                                                                                                                                                                                                                                                                                      message: google.api.IResourceDescriptor,
                                                                                                                                                                                                                                                                                                      writer?: $protobuf.Writer
                                                                                                                                                                                                                                                                                                      ) => $protobuf.Writer;
                                                                                                                                                                                                                                                                                                      • Encodes the specified ResourceDescriptor message. Does not implicitly verify messages.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        ResourceDescriptor message or plain object to encode

                                                                                                                                                                                                                                                                                                        Parameter writer

                                                                                                                                                                                                                                                                                                        Writer to encode to

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Writer

                                                                                                                                                                                                                                                                                                      method encodeDelimited

                                                                                                                                                                                                                                                                                                      static encodeDelimited: (
                                                                                                                                                                                                                                                                                                      message: google.api.IResourceDescriptor,
                                                                                                                                                                                                                                                                                                      writer?: $protobuf.Writer
                                                                                                                                                                                                                                                                                                      ) => $protobuf.Writer;
                                                                                                                                                                                                                                                                                                      • Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly verify messages.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        ResourceDescriptor message or plain object to encode

                                                                                                                                                                                                                                                                                                        Parameter writer

                                                                                                                                                                                                                                                                                                        Writer to encode to

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Writer

                                                                                                                                                                                                                                                                                                      method fromObject

                                                                                                                                                                                                                                                                                                      static fromObject: (object: {
                                                                                                                                                                                                                                                                                                      [k: string]: any;
                                                                                                                                                                                                                                                                                                      }) => google.api.ResourceDescriptor;
                                                                                                                                                                                                                                                                                                      • Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types.

                                                                                                                                                                                                                                                                                                        Parameter object

                                                                                                                                                                                                                                                                                                        Plain object

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        ResourceDescriptor

                                                                                                                                                                                                                                                                                                      method toJSON

                                                                                                                                                                                                                                                                                                      toJSON: () => { [k: string]: any };
                                                                                                                                                                                                                                                                                                      • Converts this ResourceDescriptor to JSON.

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        JSON object

                                                                                                                                                                                                                                                                                                      method toObject

                                                                                                                                                                                                                                                                                                      static toObject: (
                                                                                                                                                                                                                                                                                                      message: google.api.ResourceDescriptor,
                                                                                                                                                                                                                                                                                                      options?: $protobuf.IConversionOptions
                                                                                                                                                                                                                                                                                                      ) => { [k: string]: any };
                                                                                                                                                                                                                                                                                                      • Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        ResourceDescriptor

                                                                                                                                                                                                                                                                                                        Parameter options

                                                                                                                                                                                                                                                                                                        Conversion options

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Plain object

                                                                                                                                                                                                                                                                                                      method verify

                                                                                                                                                                                                                                                                                                      static verify: (message: { [k: string]: any }) => string | null;
                                                                                                                                                                                                                                                                                                      • Verifies a ResourceDescriptor message.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        Plain object to verify

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        null if valid, otherwise the reason why it is not

                                                                                                                                                                                                                                                                                                      class ResourceReference

                                                                                                                                                                                                                                                                                                      class ResourceReference implements IResourceReference {}
                                                                                                                                                                                                                                                                                                      • Represents a ResourceReference.

                                                                                                                                                                                                                                                                                                      constructor

                                                                                                                                                                                                                                                                                                      constructor(properties?: IResourceReference);
                                                                                                                                                                                                                                                                                                      • Constructs a new ResourceReference.

                                                                                                                                                                                                                                                                                                        Parameter properties

                                                                                                                                                                                                                                                                                                        Properties to set

                                                                                                                                                                                                                                                                                                      property childType

                                                                                                                                                                                                                                                                                                      childType: string;
                                                                                                                                                                                                                                                                                                      • ResourceReference childType.

                                                                                                                                                                                                                                                                                                      property type

                                                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                                                      • ResourceReference type.

                                                                                                                                                                                                                                                                                                      method create

                                                                                                                                                                                                                                                                                                      static create: (
                                                                                                                                                                                                                                                                                                      properties?: google.api.IResourceReference
                                                                                                                                                                                                                                                                                                      ) => google.api.ResourceReference;
                                                                                                                                                                                                                                                                                                      • Creates a new ResourceReference instance using the specified properties.

                                                                                                                                                                                                                                                                                                        Parameter properties

                                                                                                                                                                                                                                                                                                        Properties to set

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        ResourceReference instance

                                                                                                                                                                                                                                                                                                      method decode

                                                                                                                                                                                                                                                                                                      static decode: (
                                                                                                                                                                                                                                                                                                      reader: $protobuf.Reader | Uint8Array,
                                                                                                                                                                                                                                                                                                      length?: number
                                                                                                                                                                                                                                                                                                      ) => google.api.ResourceReference;
                                                                                                                                                                                                                                                                                                      • Decodes a ResourceReference message from the specified reader or buffer.

                                                                                                                                                                                                                                                                                                        Parameter reader

                                                                                                                                                                                                                                                                                                        Reader or buffer to decode from

                                                                                                                                                                                                                                                                                                        Parameter length

                                                                                                                                                                                                                                                                                                        Message length if known beforehand

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        ResourceReference

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {Error} If the payload is not a reader or valid buffer

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {$protobuf.util.ProtocolError} If required fields are missing

                                                                                                                                                                                                                                                                                                      method decodeDelimited

                                                                                                                                                                                                                                                                                                      static decodeDelimited: (
                                                                                                                                                                                                                                                                                                      reader: $protobuf.Reader | Uint8Array
                                                                                                                                                                                                                                                                                                      ) => google.api.ResourceReference;
                                                                                                                                                                                                                                                                                                      • Decodes a ResourceReference message from the specified reader or buffer, length delimited.

                                                                                                                                                                                                                                                                                                        Parameter reader

                                                                                                                                                                                                                                                                                                        Reader or buffer to decode from

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        ResourceReference

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {Error} If the payload is not a reader or valid buffer

                                                                                                                                                                                                                                                                                                        Throws

                                                                                                                                                                                                                                                                                                        {$protobuf.util.ProtocolError} If required fields are missing

                                                                                                                                                                                                                                                                                                      method encode

                                                                                                                                                                                                                                                                                                      static encode: (
                                                                                                                                                                                                                                                                                                      message: google.api.IResourceReference,
                                                                                                                                                                                                                                                                                                      writer?: $protobuf.Writer
                                                                                                                                                                                                                                                                                                      ) => $protobuf.Writer;
                                                                                                                                                                                                                                                                                                      • Encodes the specified ResourceReference message. Does not implicitly verify messages.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        ResourceReference message or plain object to encode

                                                                                                                                                                                                                                                                                                        Parameter writer

                                                                                                                                                                                                                                                                                                        Writer to encode to

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Writer

                                                                                                                                                                                                                                                                                                      method encodeDelimited

                                                                                                                                                                                                                                                                                                      static encodeDelimited: (
                                                                                                                                                                                                                                                                                                      message: google.api.IResourceReference,
                                                                                                                                                                                                                                                                                                      writer?: $protobuf.Writer
                                                                                                                                                                                                                                                                                                      ) => $protobuf.Writer;
                                                                                                                                                                                                                                                                                                      • Encodes the specified ResourceReference message, length delimited. Does not implicitly verify messages.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        ResourceReference message or plain object to encode

                                                                                                                                                                                                                                                                                                        Parameter writer

                                                                                                                                                                                                                                                                                                        Writer to encode to

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Writer

                                                                                                                                                                                                                                                                                                      method fromObject

                                                                                                                                                                                                                                                                                                      static fromObject: (object: {
                                                                                                                                                                                                                                                                                                      [k: string]: any;
                                                                                                                                                                                                                                                                                                      }) => google.api.ResourceReference;
                                                                                                                                                                                                                                                                                                      • Creates a ResourceReference message from a plain object. Also converts values to their respective internal types.

                                                                                                                                                                                                                                                                                                        Parameter object

                                                                                                                                                                                                                                                                                                        Plain object

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        ResourceReference

                                                                                                                                                                                                                                                                                                      method toJSON

                                                                                                                                                                                                                                                                                                      toJSON: () => { [k: string]: any };
                                                                                                                                                                                                                                                                                                      • Converts this ResourceReference to JSON.

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        JSON object

                                                                                                                                                                                                                                                                                                      method toObject

                                                                                                                                                                                                                                                                                                      static toObject: (
                                                                                                                                                                                                                                                                                                      message: google.api.ResourceReference,
                                                                                                                                                                                                                                                                                                      options?: $protobuf.IConversionOptions
                                                                                                                                                                                                                                                                                                      ) => { [k: string]: any };
                                                                                                                                                                                                                                                                                                      • Creates a plain object from a ResourceReference message. Also converts values to other types if specified.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        ResourceReference

                                                                                                                                                                                                                                                                                                        Parameter options

                                                                                                                                                                                                                                                                                                        Conversion options

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        Plain object

                                                                                                                                                                                                                                                                                                      method verify

                                                                                                                                                                                                                                                                                                      static verify: (message: { [k: string]: any }) => string | null;
                                                                                                                                                                                                                                                                                                      • Verifies a ResourceReference message.

                                                                                                                                                                                                                                                                                                        Parameter message

                                                                                                                                                                                                                                                                                                        Plain object to verify

                                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                                        null if valid, otherwise the reason why it is not

                                                                                                                                                                                                                                                                                                      interface ICustomHttpPattern

                                                                                                                                                                                                                                                                                                      interface ICustomHttpPattern {}
                                                                                                                                                                                                                                                                                                      • Properties of a CustomHttpPattern.

                                                                                                                                                                                                                                                                                                      property kind

                                                                                                                                                                                                                                                                                                      kind?: string | null;
                                                                                                                                                                                                                                                                                                      • CustomHttpPattern kind

                                                                                                                                                                                                                                                                                                      property path

                                                                                                                                                                                                                                                                                                      path?: string | null;
                                                                                                                                                                                                                                                                                                      • CustomHttpPattern path

                                                                                                                                                                                                                                                                                                      interface IHttp

                                                                                                                                                                                                                                                                                                      interface IHttp {}
                                                                                                                                                                                                                                                                                                      • Properties of a Http.

                                                                                                                                                                                                                                                                                                      property fullyDecodeReservedExpansion

                                                                                                                                                                                                                                                                                                      fullyDecodeReservedExpansion?: boolean | null;
                                                                                                                                                                                                                                                                                                      • Http fullyDecodeReservedExpansion

                                                                                                                                                                                                                                                                                                      property rules

                                                                                                                                                                                                                                                                                                      rules?: google.api.IHttpRule[] | null;
                                                                                                                                                                                                                                                                                                      • Http rules

                                                                                                                                                                                                                                                                                                      interface IHttpRule

                                                                                                                                                                                                                                                                                                      interface IHttpRule {}
                                                                                                                                                                                                                                                                                                      • Properties of a HttpRule.

                                                                                                                                                                                                                                                                                                      property "delete"

                                                                                                                                                                                                                                                                                                      delete?: string | null;
                                                                                                                                                                                                                                                                                                      • HttpRule delete

                                                                                                                                                                                                                                                                                                      property additionalBindings

                                                                                                                                                                                                                                                                                                      additionalBindings?: google.api.IHttpRule[] | null;
                                                                                                                                                                                                                                                                                                      • HttpRule additionalBindings

                                                                                                                                                                                                                                                                                                      property body

                                                                                                                                                                                                                                                                                                      body?: string | null;
                                                                                                                                                                                                                                                                                                      • HttpRule body

                                                                                                                                                                                                                                                                                                      property custom

                                                                                                                                                                                                                                                                                                      custom?: google.api.ICustomHttpPattern | null;
                                                                                                                                                                                                                                                                                                      • HttpRule custom

                                                                                                                                                                                                                                                                                                      property get

                                                                                                                                                                                                                                                                                                      get?: string | null;
                                                                                                                                                                                                                                                                                                      • HttpRule get

                                                                                                                                                                                                                                                                                                      property patch

                                                                                                                                                                                                                                                                                                      patch?: string | null;
                                                                                                                                                                                                                                                                                                      • HttpRule patch

                                                                                                                                                                                                                                                                                                      property post

                                                                                                                                                                                                                                                                                                      post?: string | null;
                                                                                                                                                                                                                                                                                                      • HttpRule post

                                                                                                                                                                                                                                                                                                      property put

                                                                                                                                                                                                                                                                                                      put?: string | null;
                                                                                                                                                                                                                                                                                                      • HttpRule put

                                                                                                                                                                                                                                                                                                      property responseBody

                                                                                                                                                                                                                                                                                                      responseBody?: string | null;
                                                                                                                                                                                                                                                                                                      • HttpRule responseBody

                                                                                                                                                                                                                                                                                                      property selector

                                                                                                                                                                                                                                                                                                      selector?: string | null;
                                                                                                                                                                                                                                                                                                      • HttpRule selector

                                                                                                                                                                                                                                                                                                      interface IResourceDescriptor

                                                                                                                                                                                                                                                                                                      interface IResourceDescriptor {}
                                                                                                                                                                                                                                                                                                      • Properties of a ResourceDescriptor.

                                                                                                                                                                                                                                                                                                      property history

                                                                                                                                                                                                                                                                                                      history?:
                                                                                                                                                                                                                                                                                                      | google.api.ResourceDescriptor.History
                                                                                                                                                                                                                                                                                                      | keyof typeof google.api.ResourceDescriptor.History
                                                                                                                                                                                                                                                                                                      | null;
                                                                                                                                                                                                                                                                                                      • ResourceDescriptor history

                                                                                                                                                                                                                                                                                                      property nameField

                                                                                                                                                                                                                                                                                                      nameField?: string | null;
                                                                                                                                                                                                                                                                                                      • ResourceDescriptor nameField

                                                                                                                                                                                                                                                                                                      property pattern

                                                                                                                                                                                                                                                                                                      pattern?: string[] | null;
                                                                                                                                                                                                                                                                                                      • ResourceDescriptor pattern

                                                                                                                                                                                                                                                                                                      property plural

                                                                                                                                                                                                                                                                                                      plural?: string | null;
                                                                                                                                                                                                                                                                                                      • ResourceDescriptor plural

                                                                                                                                                                                                                                                                                                      property singular

                                                                                                                                                                                                                                                                                                      singular?: string | null;
                                                                                                                                                                                                                                                                                                      • ResourceDescriptor singular

                                                                                                                                                                                                                                                                                                      property style

                                                                                                                                                                                                                                                                                                      style?: google.api.ResourceDescriptor.Style[] | null;
                                                                                                                                                                                                                                                                                                      • ResourceDescriptor style

                                                                                                                                                                                                                                                                                                      property type

                                                                                                                                                                                                                                                                                                      type?: string | null;
                                                                                                                                                                                                                                                                                                      • ResourceDescriptor type

                                                                                                                                                                                                                                                                                                      interface IResourceReference

                                                                                                                                                                                                                                                                                                      interface IResourceReference {}
                                                                                                                                                                                                                                                                                                      • Properties of a ResourceReference.

                                                                                                                                                                                                                                                                                                      property childType

                                                                                                                                                                                                                                                                                                      childType?: string | null;
                                                                                                                                                                                                                                                                                                      • ResourceReference childType

                                                                                                                                                                                                                                                                                                      property type

                                                                                                                                                                                                                                                                                                      type?: string | null;
                                                                                                                                                                                                                                                                                                      • ResourceReference type

                                                                                                                                                                                                                                                                                                      enum FieldBehavior

                                                                                                                                                                                                                                                                                                      enum FieldBehavior {
                                                                                                                                                                                                                                                                                                      FIELD_BEHAVIOR_UNSPECIFIED = 0,
                                                                                                                                                                                                                                                                                                      OPTIONAL = 1,
                                                                                                                                                                                                                                                                                                      REQUIRED = 2,
                                                                                                                                                                                                                                                                                                      OUTPUT_ONLY = 3,
                                                                                                                                                                                                                                                                                                      INPUT_ONLY = 4,
                                                                                                                                                                                                                                                                                                      IMMUTABLE = 5,
                                                                                                                                                                                                                                                                                                      UNORDERED_LIST = 6,
                                                                                                                                                                                                                                                                                                      NON_EMPTY_DEFAULT = 7,
                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                      • FieldBehavior enum.

                                                                                                                                                                                                                                                                                                      member FIELD_BEHAVIOR_UNSPECIFIED

                                                                                                                                                                                                                                                                                                      FIELD_BEHAVIOR_UNSPECIFIED = 0

                                                                                                                                                                                                                                                                                                        member IMMUTABLE

                                                                                                                                                                                                                                                                                                        IMMUTABLE = 5

                                                                                                                                                                                                                                                                                                          member INPUT_ONLY

                                                                                                                                                                                                                                                                                                          INPUT_ONLY = 4

                                                                                                                                                                                                                                                                                                            member NON_EMPTY_DEFAULT

                                                                                                                                                                                                                                                                                                            NON_EMPTY_DEFAULT = 7

                                                                                                                                                                                                                                                                                                              member OPTIONAL

                                                                                                                                                                                                                                                                                                              OPTIONAL = 1

                                                                                                                                                                                                                                                                                                                member OUTPUT_ONLY

                                                                                                                                                                                                                                                                                                                OUTPUT_ONLY = 3

                                                                                                                                                                                                                                                                                                                  member REQUIRED

                                                                                                                                                                                                                                                                                                                  REQUIRED = 2

                                                                                                                                                                                                                                                                                                                    member UNORDERED_LIST

                                                                                                                                                                                                                                                                                                                    UNORDERED_LIST = 6

                                                                                                                                                                                                                                                                                                                      namespace protos.google.api.ResourceDescriptor

                                                                                                                                                                                                                                                                                                                      namespace protos.google.api.ResourceDescriptor {}

                                                                                                                                                                                                                                                                                                                        enum History

                                                                                                                                                                                                                                                                                                                        enum History {
                                                                                                                                                                                                                                                                                                                        HISTORY_UNSPECIFIED = 0,
                                                                                                                                                                                                                                                                                                                        ORIGINALLY_SINGLE_PATTERN = 1,
                                                                                                                                                                                                                                                                                                                        FUTURE_MULTI_PATTERN = 2,
                                                                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                                                                        • History enum.

                                                                                                                                                                                                                                                                                                                        member FUTURE_MULTI_PATTERN

                                                                                                                                                                                                                                                                                                                        FUTURE_MULTI_PATTERN = 2

                                                                                                                                                                                                                                                                                                                          member HISTORY_UNSPECIFIED

                                                                                                                                                                                                                                                                                                                          HISTORY_UNSPECIFIED = 0

                                                                                                                                                                                                                                                                                                                            member ORIGINALLY_SINGLE_PATTERN

                                                                                                                                                                                                                                                                                                                            ORIGINALLY_SINGLE_PATTERN = 1

                                                                                                                                                                                                                                                                                                                              enum Style

                                                                                                                                                                                                                                                                                                                              enum Style {
                                                                                                                                                                                                                                                                                                                              STYLE_UNSPECIFIED = 0,
                                                                                                                                                                                                                                                                                                                              DECLARATIVE_FRIENDLY = 1,
                                                                                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                                                                                              • Style enum.

                                                                                                                                                                                                                                                                                                                              member DECLARATIVE_FRIENDLY

                                                                                                                                                                                                                                                                                                                              DECLARATIVE_FRIENDLY = 1

                                                                                                                                                                                                                                                                                                                                member STYLE_UNSPECIFIED

                                                                                                                                                                                                                                                                                                                                STYLE_UNSPECIFIED = 0

                                                                                                                                                                                                                                                                                                                                  namespace protos.google.protobuf

                                                                                                                                                                                                                                                                                                                                  namespace protos.google.protobuf {}
                                                                                                                                                                                                                                                                                                                                  • Namespace protobuf.

                                                                                                                                                                                                                                                                                                                                  class DescriptorProto

                                                                                                                                                                                                                                                                                                                                  class DescriptorProto implements IDescriptorProto {}
                                                                                                                                                                                                                                                                                                                                  • Represents a DescriptorProto.

                                                                                                                                                                                                                                                                                                                                  constructor

                                                                                                                                                                                                                                                                                                                                  constructor(properties?: IDescriptorProto);
                                                                                                                                                                                                                                                                                                                                  • Constructs a new DescriptorProto.

                                                                                                                                                                                                                                                                                                                                    Parameter properties

                                                                                                                                                                                                                                                                                                                                    Properties to set

                                                                                                                                                                                                                                                                                                                                  property enumType

                                                                                                                                                                                                                                                                                                                                  enumType: IEnumDescriptorProto[];
                                                                                                                                                                                                                                                                                                                                  • DescriptorProto enumType.

                                                                                                                                                                                                                                                                                                                                  property extension

                                                                                                                                                                                                                                                                                                                                  extension: IFieldDescriptorProto[];
                                                                                                                                                                                                                                                                                                                                  • DescriptorProto extension.

                                                                                                                                                                                                                                                                                                                                  property extensionRange

                                                                                                                                                                                                                                                                                                                                  extensionRange: DescriptorProto.IExtensionRange[];
                                                                                                                                                                                                                                                                                                                                  • DescriptorProto extensionRange.

                                                                                                                                                                                                                                                                                                                                  property field

                                                                                                                                                                                                                                                                                                                                  field: IFieldDescriptorProto[];
                                                                                                                                                                                                                                                                                                                                  • DescriptorProto field.

                                                                                                                                                                                                                                                                                                                                  property name

                                                                                                                                                                                                                                                                                                                                  name: string;
                                                                                                                                                                                                                                                                                                                                  • DescriptorProto name.

                                                                                                                                                                                                                                                                                                                                  property nestedType

                                                                                                                                                                                                                                                                                                                                  nestedType: IDescriptorProto[];
                                                                                                                                                                                                                                                                                                                                  • DescriptorProto nestedType.

                                                                                                                                                                                                                                                                                                                                  property oneofDecl

                                                                                                                                                                                                                                                                                                                                  oneofDecl: IOneofDescriptorProto[];
                                                                                                                                                                                                                                                                                                                                  • DescriptorProto oneofDecl.

                                                                                                                                                                                                                                                                                                                                  property options

                                                                                                                                                                                                                                                                                                                                  options?: IMessageOptions;
                                                                                                                                                                                                                                                                                                                                  • DescriptorProto options.

                                                                                                                                                                                                                                                                                                                                  property reservedName

                                                                                                                                                                                                                                                                                                                                  reservedName: string[];
                                                                                                                                                                                                                                                                                                                                  • DescriptorProto reservedName.

                                                                                                                                                                                                                                                                                                                                  property reservedRange

                                                                                                                                                                                                                                                                                                                                  reservedRange: DescriptorProto.IReservedRange[];
                                                                                                                                                                                                                                                                                                                                  • DescriptorProto reservedRange.

                                                                                                                                                                                                                                                                                                                                  method create

                                                                                                                                                                                                                                                                                                                                  static create: (
                                                                                                                                                                                                                                                                                                                                  properties?: google.protobuf.IDescriptorProto
                                                                                                                                                                                                                                                                                                                                  ) => google.protobuf.DescriptorProto;
                                                                                                                                                                                                                                                                                                                                  • Creates a new DescriptorProto instance using the specified properties.

                                                                                                                                                                                                                                                                                                                                    Parameter properties

                                                                                                                                                                                                                                                                                                                                    Properties to set

                                                                                                                                                                                                                                                                                                                                    Returns

                                                                                                                                                                                                                                                                                                                                    DescriptorProto instance

                                                                                                                                                                                                                                                                                                                                  method decode

                                                                                                                                                                                                                                                                                                                                  static decode: (
                                                                                                                                                                                                                                                                                                                                  reader: $protobuf.Reader | Uint8Array,
                                                                                                                                                                                                                                                                                                                                  length?: number
                                                                                                                                                                                                                                                                                                                                  ) => google.protobuf.DescriptorProto;
                                                                                                                                                                                                                                                                                                                                  • Decodes a DescriptorProto message from the specified reader or buffer.

                                                                                                                                                                                                                                                                                                                                    Parameter reader

                                                                                                                                                                                                                                                                                                                                    Reader or buffer to decode from

                                                                                                                                                                                                                                                                                                                                    Parameter length

                                                                                                                                                                                                                                                                                                                                    Message length if known beforehand

                                                                                                                                                                                                                                                                                                                                    Returns

                                                                                                                                                                                                                                                                                                                                    DescriptorProto

                                                                                                                                                                                                                                                                                                                                    Throws

                                                                                                                                                                                                                                                                                                                                    {Error} If the payload is not a reader or valid buffer

                                                                                                                                                                                                                                                                                                                                    Throws

                                                                                                                                                                                                                                                                                                                                    {$protobuf.util.ProtocolError} If required fields are missing

                                                                                                                                                                                                                                                                                                                                  method decodeDelimited

                                                                                                                                                                                                                                                                                                                                  static decodeDelimited: (
                                                                                                                                                                                                                                                                                                                                  reader: $protobuf.Reader | Uint8Array
                                                                                                                                                                                                                                                                                                                                  ) => google.protobuf.DescriptorProto;
                                                                                                                                                                                                                                                                                                                                  • Decodes a DescriptorProto message from the specified reader or buffer, length delimited.

                                                                                                                                                                                                                                                                                                                                    Parameter reader

                                                                                                                                                                                                                                                                                                                                    Reader or buffer to decode from

                                                                                                                                                                                                                                                                                                                                    Returns

                                                                                                                                                                                                                                                                                                                                    DescriptorProto

                                                                                                                                                                                                                                                                                                                                    Throws

                                                                                                                                                                                                                                                                                                                                    {Error} If the payload is not a reader or valid buffer

                                                                                                                                                                                                                                                                                                                                    Throws

                                                                                                                                                                                                                                                                                                                                    {$protobuf.util.ProtocolError} If required fields are missing

                                                                                                                                                                                                                                                                                                                                  method encode

                                                                                                                                                                                                                                                                                                                                  static encode: (
                                                                                                                                                                                                                                                                                                                                  message: google.protobuf.IDescriptorProto,
                                                                                                                                                                                                                                                                                                                                  writer?: $protobuf.Writer
                                                                                                                                                                                                                                                                                                                                  ) => $protobuf.Writer;
                                                                                                                                                                                                                                                                                                                                  • Encodes the specified DescriptorProto message. Does not implicitly verify messages.

                                                                                                                                                                                                                                                                                                                                    Parameter message

                                                                                                                                                                                                                                                                                                                                    DescriptorProto message or plain object to encode

                                                                                                                                                                                                                                                                                                                                    Parameter writer

                                                                                                                                                                                                                                                                                                                                    Writer to encode to

                                                                                                                                                                                                                                                                                                                                    Returns

                                                                                                                                                                                                                                                                                                                                    Writer

                                                                                                                                                                                                                                                                                                                                  method encodeDelimited

                                                                                                                                                                                                                                                                                                                                  static encodeDelimited: (
                                                                                                                                                                                                                                                                                                                                  message: google.protobuf.IDescriptorProto,
                                                                                                                                                                                                                                                                                                                                  writer?: $protobuf.Writer
                                                                                                                                                                                                                                                                                                                                  ) => $protobuf.Writer;
                                                                                                                                                                                                                                                                                                                                  • Encodes the specified DescriptorProto message, length delimited. Does not implicitly verify messages.

                                                                                                                                                                                                                                                                                                                                    Parameter message

                                                                                                                                                                                                                                                                                                                                    DescriptorProto message or plain object to encode

                                                                                                                                                                                                                                                                                                                                    Parameter writer

                                                                                                                                                                                                                                                                                                                                    Writer to encode to

                                                                                                                                                                                                                                                                                                                                    Returns

                                                                                                                                                                                                                                                                                                                                    Writer

                                                                                                                                                                                                                                                                                                                                  method fromObject

                                                                                                                                                                                                                                                                                                                                  static fromObject: (object: {
                                                                                                                                                                                                                                                                                                                                  [k: string]: any;
                                                                                                                                                                                                                                                                                                                                  }) => google.protobuf.DescriptorProto;
                                                                                                                                                                                                                                                                                                                                  • Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types.

                                                                                                                                                                                                                                                                                                                                    Parameter object

                                                                                                                                                                                                                                                                                                                                    Plain object

                                                                                                                                                                                                                                                                                                                                    Returns

                                                                                                                                                                                                                                                                                                                                    DescriptorProto

                                                                                                                                                                                                                                                                                                                                  method toJSON

                                                                                                                                                                                                                                                                                                                                  toJSON: () => { [k: string]: any };
                                                                                                                                                                                                                                                                                                                                  • Converts this DescriptorProto to JSON.

                                                                                                                                                                                                                                                                                                                                    Returns

                                                                                                                                                                                                                                                                                                                                    JSON object

                                                                                                                                                                                                                                                                                                                                  method toObject

                                                                                                                                                                                                                                                                                                                                  static toObject: (
                                                                                                                                                                                                                                                                                                                                  message: google.protobuf.DescriptorProto,
                                                                                                                                                                                                                                                                                                                                  options?: $protobuf.IConversionOptions
                                                                                                                                                                                                                                                                                                                                  ) => { [k: string]: any };
                                                                                                                                                                                                                                                                                                                                  • Creates a plain object from a DescriptorProto message. Also converts values to other types if specified.

                                                                                                                                                                                                                                                                                                                                    Parameter message

                                                                                                                                                                                                                                                                                                                                    DescriptorProto

                                                                                                                                                                                                                                                                                                                                    Parameter options

                                                                                                                                                                                                                                                                                                                                    Conversion options

                                                                                                                                                                                                                                                                                                                                    Returns

                                                                                                                                                                                                                                                                                                                                    Plain object

                                                                                                                                                                                                                                                                                                                                  method verify

                                                                                                                                                                                                                                                                                                                                  static verify: (message: { [k: string]: any }) => string | null