From 09fc4241c8782d2f60c1a78dda316628eca5f751 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 31 Jan 2024 14:01:37 -0500 Subject: [PATCH] feat: add enforce_in_transit fields and optional annotations (#1873) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: improve retry logic for streaming API calls build: update typescript generator version to 4.3.0 The streaming API call retry logic has changed, which in some rare cases may require code changes. Please feel free to reach out to us in the issues if you experience new problems with retrying streaming calls after this update. PiperOrigin-RevId: 599622271 Source-Link: https://github.com/googleapis/googleapis/commit/6239c217f083277d7a43c8bee55969654c3b2fee Source-Link: https://github.com/googleapis/googleapis-gen/commit/da13d8222d3ba33734501999864458640f1405ae Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZGExM2Q4MjIyZDNiYTMzNzM0NTAxOTk5ODY0NDU4NjQwZjE0MDVhZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add `ingestion_data_source_settings` field to `Topic` PiperOrigin-RevId: 600786127 Source-Link: https://github.com/googleapis/googleapis/commit/708f769ea3987faa1b810fcb44d9e0ee9172b352 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3b85818ca8f12ace75390cea24e5f3df5ac70be7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiM2I4NTgxOGNhOGYxMmFjZTc1MzkwY2VhMjRlNWYzZGY1YWM3MGJlNyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add enforce_in_transit fields and optional annotations PiperOrigin-RevId: 601205737 Source-Link: https://github.com/googleapis/googleapis/commit/27f83015e8aacb6695f56435b3185f6d45fad995 Source-Link: https://github.com/googleapis/googleapis-gen/commit/daf775c7ecd90de69e1304b840a28d201c025f08 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZGFmNzc1YzdlY2Q5MGRlNjllMTMwNGI4NDBhMjhkMjAxYzAyNWYwOCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: Megan Potter <57276408+feywind@users.noreply.github.com> --- protos/google/pubsub/v1/pubsub.proto | 855 ++++++++++++++++----------- protos/google/pubsub/v1/schema.proto | 4 +- protos/protos.d.ts | 271 ++++++++- protos/protos.js | 713 ++++++++++++++++++++++ protos/protos.json | 600 +++++++++++++++---- src/v1/publisher_client.ts | 156 ++--- src/v1/schema_service_client.ts | 4 +- src/v1/subscriber_client.ts | 206 +++---- 8 files changed, 2175 insertions(+), 634 deletions(-) diff --git a/protos/google/pubsub/v1/pubsub.proto b/protos/google/pubsub/v1/pubsub.proto index 393893b10..c548b2680 100644 --- a/protos/google/pubsub/v1/pubsub.proto +++ b/protos/google/pubsub/v1/pubsub.proto @@ -53,8 +53,8 @@ service Publisher { option (google.api.method_signature) = "name"; } - // Updates an existing topic. Note that certain properties of a - // topic are not modifiable. + // Updates an existing topic by updating the fields specified in the update + // mask. Note that certain properties of a topic are not modifiable. rpc UpdateTopic(UpdateTopicRequest) returns (Topic) { option (google.api.http) = { patch: "/v1/{topic.name=projects/*/topics/*}" @@ -137,13 +137,21 @@ service Publisher { // A policy constraining the storage of messages published to the topic. message MessageStoragePolicy { - // A list of IDs of Google Cloud regions where messages that are published - // to the topic may be persisted in storage. Messages published by publishers - // running in non-allowed Google Cloud regions (or running outside of Google - // Cloud altogether) are routed for storage in one of the allowed regions. - // An empty list means that no regions are allowed, and is not a valid - // configuration. - repeated string allowed_persistence_regions = 1; + // Optional. A list of IDs of Google Cloud regions where messages that are + // published to the topic may be persisted in storage. Messages published by + // publishers running in non-allowed Google Cloud regions (or running outside + // of Google Cloud altogether) are routed for storage in one of the allowed + // regions. An empty list means that no regions are allowed, and is not a + // valid configuration. + repeated string allowed_persistence_regions = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, `allowed_persistence_regions` is also used to enforce + // in-transit guarantees for messages. That is, Pub/Sub will fail + // Publish operations on this topic and subscribe operations + // on any subscription attached to this topic in any region that is + // not in `allowed_persistence_regions`. + bool enforce_in_transit = 2 [(google.api.field_behavior) = OPTIONAL]; } // Settings for validating messages published against a schema. @@ -157,18 +165,83 @@ message SchemaSettings { (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" } ]; - // The encoding of messages validated against `schema`. - Encoding encoding = 2; + // Optional. The encoding of messages validated against `schema`. + Encoding encoding = 2 [(google.api.field_behavior) = OPTIONAL]; - // The minimum (inclusive) revision allowed for validating messages. If empty - // or not present, allow any revision to be validated against last_revision or - // any revision created before. - string first_revision_id = 3; + // Optional. The minimum (inclusive) revision allowed for validating messages. + // If empty or not present, allow any revision to be validated against + // last_revision or any revision created before. + string first_revision_id = 3 [(google.api.field_behavior) = OPTIONAL]; - // The maximum (inclusive) revision allowed for validating messages. If empty - // or not present, allow any revision to be validated against first_revision - // or any revision created after. - string last_revision_id = 4; + // Optional. The maximum (inclusive) revision allowed for validating messages. + // If empty or not present, allow any revision to be validated against + // first_revision or any revision created after. + string last_revision_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings for an ingestion data source on a topic. +message IngestionDataSourceSettings { + // Ingestion settings for Amazon Kinesis Data Streams. + message AwsKinesis { + // Possible states for managed ingestion from Amazon Kinesis Data Streams. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // Ingestion is active. + ACTIVE = 1; + + // Permission denied encountered while consuming data from Kinesis. + // This can happen if: + // - The provided `aws_role_arn` does not exist or does not have the + // appropriate permissions attached. + // - The provided `aws_role_arn` is not set up properly for Identity + // Federation using `gcp_service_account`. + // - The Pub/Sub SA is not granted the + // `iam.serviceAccounts.getOpenIdToken` permission on + // `gcp_service_account`. + KINESIS_PERMISSION_DENIED = 2; + + // Permission denied encountered while publishing to the topic. This can + // happen due to Pub/Sub SA has not been granted the [appropriate publish + // permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher) + PUBLISH_PERMISSION_DENIED = 3; + + // The Kinesis stream does not exist. + STREAM_NOT_FOUND = 4; + + // The Kinesis consumer does not exist. + CONSUMER_NOT_FOUND = 5; + } + + // Output only. An output-only field that indicates the state of the Kinesis + // ingestion source. + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The Kinesis stream ARN to ingest data from. + string stream_arn = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Kinesis consumer ARN to used for ingestion in Enhanced + // Fan-Out mode. The consumer must be already created and ready to be used. + string consumer_arn = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. AWS role ARN to be used for Federated Identity authentication + // with Kinesis. Check the Pub/Sub docs for how to set up this role and the + // required permissions that need to be attached to it. + string aws_role_arn = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The GCP service account to be used for Federated Identity + // authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for + // the provided role). The `aws_role_arn` must be set up with + // `accounts.google.com:sub` equals to this service account number. + string gcp_service_account = 5 [(google.api.field_behavior) = REQUIRED]; + } + + // Only one source type can have settings set. + oneof source { + // Optional. Amazon Kinesis Data Streams. + AwsKinesis aws_kinesis = 1 [(google.api.field_behavior) = OPTIONAL]; + } } // A topic resource. @@ -179,6 +252,20 @@ message Topic { pattern: "_deleted-topic_" }; + // The state of the topic. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The topic does not have any persistent errors. + ACTIVE = 1; + + // Ingestion from the data source has encountered a permanent error. + // See the more detailed error state in the corresponding ingestion + // source configuration. + INGESTION_RESOURCE_ERROR = 2; + } + // Required. The name of the topic. It must have the format // `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), @@ -187,37 +274,48 @@ message Topic { // must not start with `"goog"`. string name = 1 [(google.api.field_behavior) = REQUIRED]; - // See [Creating and managing labels] + // Optional. See [Creating and managing labels] // (https://cloud.google.com/pubsub/docs/labels). - map labels = 2; + map labels = 2 [(google.api.field_behavior) = OPTIONAL]; - // Policy constraining the set of Google Cloud Platform regions where messages - // published to the topic may be stored. If not present, then no constraints - // are in effect. - MessageStoragePolicy message_storage_policy = 3; + // Optional. Policy constraining the set of Google Cloud Platform regions + // where messages published to the topic may be stored. If not present, then + // no constraints are in effect. + MessageStoragePolicy message_storage_policy = 3 + [(google.api.field_behavior) = OPTIONAL]; - // The resource name of the Cloud KMS CryptoKey to be used to protect access - // to messages published on this topic. + // Optional. The resource name of the Cloud KMS CryptoKey to be used to + // protect access to messages published on this topic. // // The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - string kms_key_name = 5; + string kms_key_name = 5 [(google.api.field_behavior) = OPTIONAL]; - // Settings for validating messages published against a schema. - SchemaSettings schema_settings = 6; + // Optional. Settings for validating messages published against a schema. + SchemaSettings schema_settings = 6 [(google.api.field_behavior) = OPTIONAL]; - // Reserved for future use. This field is set only in responses from the - // server; it is ignored if it is set in any requests. - bool satisfies_pzs = 7; + // Optional. Reserved for future use. This field is set only in responses from + // the server; it is ignored if it is set in any requests. + bool satisfies_pzs = 7 [(google.api.field_behavior) = OPTIONAL]; - // Indicates the minimum duration to retain a message after it is published to - // the topic. If this field is set, messages published to the topic in the - // last `message_retention_duration` are always available to subscribers. For - // instance, it allows any attached subscription to [seek to a + // Optional. Indicates the minimum duration to retain a message after it is + // published to the topic. If this field is set, messages published to the + // topic in the last `message_retention_duration` are always available to + // subscribers. For instance, it allows any attached subscription to [seek to + // a // timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) // that is up to `message_retention_duration` in the past. If this field is // not set, message retention is controlled by settings on individual // subscriptions. Cannot be more than 31 days or less than 10 minutes. - google.protobuf.Duration message_retention_duration = 8; + google.protobuf.Duration message_retention_duration = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. An output-only field indicating the state of the topic. + State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Settings for managed ingestion from a data source into this + // topic. + IngestionDataSourceSettings ingestion_data_source_settings = 10 + [(google.api.field_behavior) = OPTIONAL]; } // A message that is published by publishers and consumed by subscribers. The @@ -229,14 +327,14 @@ message Topic { // (https://cloud.google.com/pubsub/quotas) for more information about message // limits. message PubsubMessage { - // The message data field. If this field is empty, the message must contain - // at least one attribute. - bytes data = 1; + // Optional. The message data field. If this field is empty, the message must + // contain at least one attribute. + bytes data = 1 [(google.api.field_behavior) = OPTIONAL]; - // Attributes for this message. If this field is empty, the message must - // contain non-empty data. This can be used to filter messages on the + // Optional. Attributes for this message. If this field is empty, the message + // must contain non-empty data. This can be used to filter messages on the // subscription. - map attributes = 2; + map attributes = 2 [(google.api.field_behavior) = OPTIONAL]; // ID of this message, assigned by the server when the message is published. // Guaranteed to be unique within the topic. This value may be read by a @@ -249,15 +347,15 @@ message PubsubMessage { // publisher in a `Publish` call. google.protobuf.Timestamp publish_time = 4; - // If non-empty, identifies related messages for which publish order should be - // respected. If a `Subscription` has `enable_message_ordering` set to `true`, - // messages published with the same non-empty `ordering_key` value will be - // delivered to subscribers in the order in which they are received by the - // Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest` - // must specify the same `ordering_key` value. - // For more information, see [ordering + // Optional. If non-empty, identifies related messages for which publish order + // should be respected. If a `Subscription` has `enable_message_ordering` set + // to `true`, messages published with the same non-empty `ordering_key` value + // will be delivered to subscribers in the order in which they are received by + // the Pub/Sub system. All `PubsubMessage`s published in a given + // `PublishRequest` must specify the same `ordering_key` value. For more + // information, see [ordering // messages](https://cloud.google.com/pubsub/docs/ordering). - string ordering_key = 5; + string ordering_key = 5 [(google.api.field_behavior) = OPTIONAL]; } // Request for the GetTopic method. @@ -299,10 +397,10 @@ message PublishRequest { // Response for the `Publish` method. message PublishResponse { - // The server-assigned ID of each published message, in the same order as - // the messages in the request. IDs are guaranteed to be unique within - // the topic. - repeated string message_ids = 1; + // Optional. The server-assigned ID of each published message, in the same + // order as the messages in the request. IDs are guaranteed to be unique + // within the topic. + repeated string message_ids = 1 [(google.api.field_behavior) = OPTIONAL]; } // Request for the `ListTopics` method. @@ -316,23 +414,23 @@ message ListTopicsRequest { } ]; - // Maximum number of topics to return. - int32 page_size = 2; + // Optional. Maximum number of topics to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // The value returned by the last `ListTopicsResponse`; indicates that this is - // a continuation of a prior `ListTopics` call, and that the system should - // return the next page of data. - string page_token = 3; + // Optional. The value returned by the last `ListTopicsResponse`; indicates + // that this is a continuation of a prior `ListTopics` call, and that the + // system should return the next page of data. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; } // Response for the `ListTopics` method. message ListTopicsResponse { - // The resulting topics. - repeated Topic topics = 1; + // Optional. The resulting topics. + repeated Topic topics = 1 [(google.api.field_behavior) = OPTIONAL]; - // If not empty, indicates that there may be more topics that match the - // request; this value should be passed in a new `ListTopicsRequest`. - string next_page_token = 2; + // Optional. If not empty, indicates that there may be more topics that match + // the request; this value should be passed in a new `ListTopicsRequest`. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; } // Request for the `ListTopicSubscriptions` method. @@ -344,26 +442,30 @@ message ListTopicSubscriptionsRequest { (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } ]; - // Maximum number of subscription names to return. - int32 page_size = 2; + // Optional. Maximum number of subscription names to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // The value returned by the last `ListTopicSubscriptionsResponse`; indicates - // that this is a continuation of a prior `ListTopicSubscriptions` call, and - // that the system should return the next page of data. - string page_token = 3; + // Optional. The value returned by the last `ListTopicSubscriptionsResponse`; + // indicates that this is a continuation of a prior `ListTopicSubscriptions` + // call, and that the system should return the next page of data. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; } // Response for the `ListTopicSubscriptions` method. message ListTopicSubscriptionsResponse { - // The names of subscriptions attached to the topic specified in the request. - repeated string subscriptions = 1 [(google.api.resource_reference) = { - type: "pubsub.googleapis.com/Subscription" - }]; + // Optional. The names of subscriptions attached to the topic specified in the + // request. + repeated string subscriptions = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; - // If not empty, indicates that there may be more subscriptions that match - // the request; this value should be passed in a new + // Optional. If not empty, indicates that there may be more subscriptions that + // match the request; this value should be passed in a new // `ListTopicSubscriptionsRequest` to get more subscriptions. - string next_page_token = 2; + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; } // Request for the `ListTopicSnapshots` method. @@ -375,24 +477,24 @@ message ListTopicSnapshotsRequest { (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } ]; - // Maximum number of snapshot names to return. - int32 page_size = 2; + // Optional. Maximum number of snapshot names to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // The value returned by the last `ListTopicSnapshotsResponse`; indicates - // that this is a continuation of a prior `ListTopicSnapshots` call, and - // that the system should return the next page of data. - string page_token = 3; + // Optional. The value returned by the last `ListTopicSnapshotsResponse`; + // indicates that this is a continuation of a prior `ListTopicSnapshots` call, + // and that the system should return the next page of data. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; } // Response for the `ListTopicSnapshots` method. message ListTopicSnapshotsResponse { - // The names of the snapshots that match the request. - repeated string snapshots = 1; + // Optional. The names of the snapshots that match the request. + repeated string snapshots = 1 [(google.api.field_behavior) = OPTIONAL]; - // If not empty, indicates that there may be more snapshots that match - // the request; this value should be passed in a new + // Optional. If not empty, indicates that there may be more snapshots that + // match the request; this value should be passed in a new // `ListTopicSnapshotsRequest` to get more snapshots. - string next_page_token = 2; + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; } // Request for the `DeleteTopic` method. @@ -458,8 +560,9 @@ service Subscriber { option (google.api.method_signature) = "subscription"; } - // Updates an existing subscription. Note that certain properties of a - // subscription, such as its topic, are not modifiable. + // Updates an existing subscription by updating the fields specified in the + // update mask. Note that certain properties of a subscription, such as its + // topic, are not modifiable. rpc UpdateSubscription(UpdateSubscriptionRequest) returns (Subscription) { option (google.api.http) = { patch: "/v1/{subscription.name=projects/*/subscriptions/*}" @@ -604,7 +707,8 @@ service Subscriber { option (google.api.method_signature) = "name,subscription"; } - // Updates an existing snapshot. Snapshots are used in + // Updates an existing snapshot by updating the fields specified in the update + // mask. Snapshots are used in // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, // which allow you to manage message acknowledgments in bulk. That is, you can // set the acknowledgment state of messages in an existing subscription to the @@ -687,23 +791,24 @@ message Subscription { (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } ]; - // If push delivery is used with this subscription, this field is - // used to configure it. - PushConfig push_config = 4; - - // If delivery to BigQuery is used with this subscription, this field is + // Optional. If push delivery is used with this subscription, this field is // used to configure it. - BigQueryConfig bigquery_config = 18; + PushConfig push_config = 4 [(google.api.field_behavior) = OPTIONAL]; - // If delivery to Google Cloud Storage is used with this subscription, this + // Optional. If delivery to BigQuery is used with this subscription, this // field is used to configure it. - CloudStorageConfig cloud_storage_config = 22; - - // The approximate amount of time (on a best-effort basis) Pub/Sub waits for - // the subscriber to acknowledge receipt before resending the message. In the - // interval after the message is delivered and before it is acknowledged, it - // is considered to be _outstanding_. During that time period, the - // message will not be redelivered (on a best-effort basis). + BigQueryConfig bigquery_config = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If delivery to Google Cloud Storage is used with this + // subscription, this field is used to configure it. + CloudStorageConfig cloud_storage_config = 22 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The approximate amount of time (on a best-effort basis) Pub/Sub + // waits for the subscriber to acknowledge receipt before resending the + // message. In the interval after the message is delivered and before it is + // acknowledged, it is considered to be _outstanding_. During that time + // period, the message will not be redelivered (on a best-effort basis). // // For pull subscriptions, this value is used as the initial value for the ack // deadline. To override this value for a given message, call @@ -719,78 +824,81 @@ message Subscription { // // If the subscriber never acknowledges the message, the Pub/Sub // system will eventually redeliver the message. - int32 ack_deadline_seconds = 5; + int32 ack_deadline_seconds = 5 [(google.api.field_behavior) = OPTIONAL]; - // Indicates whether to retain acknowledged messages. If true, then + // Optional. Indicates whether to retain acknowledged messages. If true, then // messages are not expunged from the subscription's backlog, even if they are // acknowledged, until they fall out of the `message_retention_duration` // window. This must be true if you would like to [`Seek` to a timestamp] // (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in // the past to replay previously-acknowledged messages. - bool retain_acked_messages = 7; + bool retain_acked_messages = 7 [(google.api.field_behavior) = OPTIONAL]; - // How long to retain unacknowledged messages in the subscription's backlog, - // from the moment a message is published. - // If `retain_acked_messages` is true, then this also configures the retention - // of acknowledged messages, and thus configures how far back in time a `Seek` - // can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10 - // minutes. - google.protobuf.Duration message_retention_duration = 8; + // Optional. How long to retain unacknowledged messages in the subscription's + // backlog, from the moment a message is published. If `retain_acked_messages` + // is true, then this also configures the retention of acknowledged messages, + // and thus configures how far back in time a `Seek` can be done. Defaults to + // 7 days. Cannot be more than 7 days or less than 10 minutes. + google.protobuf.Duration message_retention_duration = 8 + [(google.api.field_behavior) = OPTIONAL]; - // See [Creating and managing + // Optional. See [Creating and managing // labels](https://cloud.google.com/pubsub/docs/labels). - map labels = 9; - - // If true, messages published with the same `ordering_key` in `PubsubMessage` - // will be delivered to the subscribers in the order in which they - // are received by the Pub/Sub system. Otherwise, they may be delivered in - // any order. - bool enable_message_ordering = 10; - - // A policy that specifies the conditions for this subscription's expiration. - // A subscription is considered active as long as any connected subscriber is - // successfully consuming messages from the subscription or is issuing - // operations on the subscription. If `expiration_policy` is not set, a - // *default policy* with `ttl` of 31 days will be used. The minimum allowed + map labels = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, messages published with the same `ordering_key` in + // `PubsubMessage` will be delivered to the subscribers in the order in which + // they are received by the Pub/Sub system. Otherwise, they may be delivered + // in any order. + bool enable_message_ordering = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A policy that specifies the conditions for this subscription's + // expiration. A subscription is considered active as long as any connected + // subscriber is successfully consuming messages from the subscription or is + // issuing operations on the subscription. If `expiration_policy` is not set, + // a *default policy* with `ttl` of 31 days will be used. The minimum allowed // value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, // but `expiration_policy.ttl` is not set, the subscription never expires. - ExpirationPolicy expiration_policy = 11; + ExpirationPolicy expiration_policy = 11 + [(google.api.field_behavior) = OPTIONAL]; - // An expression written in the Pub/Sub [filter + // Optional. An expression written in the Pub/Sub [filter // language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, // then only `PubsubMessage`s whose `attributes` field matches the filter are // delivered on this subscription. If empty, then no messages are filtered // out. - string filter = 12; + string filter = 12 [(google.api.field_behavior) = OPTIONAL]; - // A policy that specifies the conditions for dead lettering messages in - // this subscription. If dead_letter_policy is not set, dead lettering - // is disabled. + // Optional. A policy that specifies the conditions for dead lettering + // messages in this subscription. If dead_letter_policy is not set, dead + // lettering is disabled. // - // The Cloud Pub/Sub service account associated with this subscriptions's + // The Pub/Sub service account associated with this subscriptions's // parent project (i.e., // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have // permission to Acknowledge() messages on this subscription. - DeadLetterPolicy dead_letter_policy = 13; + DeadLetterPolicy dead_letter_policy = 13 + [(google.api.field_behavior) = OPTIONAL]; - // A policy that specifies how Pub/Sub retries message delivery for this - // subscription. + // Optional. A policy that specifies how Pub/Sub retries message delivery for + // this subscription. // // If not set, the default retry policy is applied. This generally implies // that messages will be retried as soon as possible for healthy subscribers. // RetryPolicy will be triggered on NACKs or acknowledgement deadline // exceeded events for a given message. - RetryPolicy retry_policy = 14; + RetryPolicy retry_policy = 14 [(google.api.field_behavior) = OPTIONAL]; - // Indicates whether the subscription is detached from its topic. Detached - // subscriptions don't receive messages from their topic and don't retain any - // backlog. `Pull` and `StreamingPull` requests will return + // Optional. Indicates whether the subscription is detached from its topic. + // Detached subscriptions don't receive messages from their topic and don't + // retain any backlog. `Pull` and `StreamingPull` requests will return // FAILED_PRECONDITION. If the subscription is a push subscription, pushes to // the endpoint will not be made. - bool detached = 15; + bool detached = 15 [(google.api.field_behavior) = OPTIONAL]; - // If true, Pub/Sub provides the following guarantees for the delivery of - // a message with a given value of `message_id` on this subscription: + // Optional. If true, Pub/Sub provides the following guarantees for the + // delivery of a message with a given value of `message_id` on this + // subscription: // // * The message sent to a subscriber is guaranteed not to be resent // before the message's acknowledgement deadline expires. @@ -800,7 +908,8 @@ message Subscription { // when `enable_exactly_once_delivery` is true if the message was published // multiple times by a publisher client. These copies are considered distinct // by Pub/Sub and have distinct `message_id` values. - bool enable_exactly_once_delivery = 16; + bool enable_exactly_once_delivery = 16 + [(google.api.field_behavior) = OPTIONAL]; // Output only. Indicates the minimum duration for which a message is retained // after it is published to the subscription's topic. If this field is set, @@ -816,7 +925,7 @@ message Subscription { State state = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// A policy that specifies how Cloud Pub/Sub retries message delivery. +// A policy that specifies how Pub/Sub retries message delivery. // // Retry delay will be exponential based on provided minimum and maximum // backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. @@ -828,13 +937,16 @@ message Subscription { // between consecutive deliveries may not match the configuration. That is, // delay can be more or less than configured backoff. message RetryPolicy { - // The minimum delay between consecutive deliveries of a given message. - // Value should be between 0 and 600 seconds. Defaults to 10 seconds. - google.protobuf.Duration minimum_backoff = 1; - - // The maximum delay between consecutive deliveries of a given message. - // Value should be between 0 and 600 seconds. Defaults to 600 seconds. - google.protobuf.Duration maximum_backoff = 2; + // Optional. The minimum delay between consecutive deliveries of a given + // message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. + google.protobuf.Duration minimum_backoff = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum delay between consecutive deliveries of a given + // message. Value should be between 0 and 600 seconds. Defaults to 600 + // seconds. + google.protobuf.Duration maximum_backoff = 2 + [(google.api.field_behavior) = OPTIONAL]; } // Dead lettering is done on a best effort basis. The same message might be @@ -843,19 +955,19 @@ message RetryPolicy { // If validation on any of the fields fails at subscription creation/updation, // the create/update subscription request will fail. message DeadLetterPolicy { - // The name of the topic to which dead letter messages should be published. - // Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service - // account associated with the enclosing subscription's parent project (i.e., - // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have - // permission to Publish() to this topic. + // Optional. The name of the topic to which dead letter messages should be + // published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub + // service account associated with the enclosing subscription's parent project + // (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must + // have permission to Publish() to this topic. // // The operation will fail if the topic does not exist. // Users should ensure that there is a subscription attached to this topic // since messages published to a topic with no subscriptions are lost. - string dead_letter_topic = 1; + string dead_letter_topic = 1 [(google.api.field_behavior) = OPTIONAL]; - // The maximum number of delivery attempts for any message. The value must be - // between 5 and 100. + // Optional. The maximum number of delivery attempts for any message. The + // value must be between 5 and 100. // // The number of delivery attempts is defined as 1 + (the sum of number of // NACKs and number of times the acknowledgement deadline has been exceeded @@ -867,19 +979,19 @@ message DeadLetterPolicy { // This field will be honored on a best effort basis. // // If this parameter is 0, a default value of 5 is used. - int32 max_delivery_attempts = 2; + int32 max_delivery_attempts = 2 [(google.api.field_behavior) = OPTIONAL]; } // A policy that specifies the conditions for resource expiration (i.e., // automatic resource deletion). message ExpirationPolicy { - // Specifies the "time-to-live" duration for an associated resource. The - // resource expires if it is not active for a period of `ttl`. The definition - // of "activity" depends on the type of the associated resource. The minimum - // and maximum allowed values for `ttl` depend on the type of the associated - // resource, as well. If `ttl` is not set, the associated resource never - // expires. - google.protobuf.Duration ttl = 1; + // Optional. Specifies the "time-to-live" duration for an associated resource. + // The resource expires if it is not active for a period of `ttl`. The + // definition of "activity" depends on the type of the associated resource. + // The minimum and maximum allowed values for `ttl` depend on the type of the + // associated resource, as well. If `ttl` is not set, the associated resource + // never expires. + google.protobuf.Duration ttl = 1 [(google.api.field_behavior) = OPTIONAL]; } // Configuration for a push delivery endpoint. @@ -888,20 +1000,21 @@ message PushConfig { // [OpenID Connect // token](https://developers.google.com/identity/protocols/OpenIDConnect). message OidcToken { - // [Service account + // Optional. [Service account // email](https://cloud.google.com/iam/docs/service-accounts) // used for generating the OIDC token. For more information // on setting up authentication, see // [Push subscriptions](https://cloud.google.com/pubsub/docs/push). - string service_account_email = 1; - - // Audience to be used when generating OIDC token. The audience claim - // identifies the recipients that the JWT is intended for. The audience - // value is a single case-sensitive string. Having multiple values (array) - // for the audience field is not supported. More info about the OIDC JWT - // token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 - // Note: if not specified, the Push endpoint URL will be used. - string audience = 2; + string service_account_email = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Audience to be used when generating OIDC token. The audience + // claim identifies the recipients that the JWT is intended for. The + // audience value is a single case-sensitive string. Having multiple values + // (array) for the audience field is not supported. More info about the OIDC + // JWT token audience here: + // https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, + // the Push endpoint URL will be used. + string audience = 2 [(google.api.field_behavior) = OPTIONAL]; } // The payload to the push endpoint is in the form of the JSON representation @@ -911,18 +1024,18 @@ message PushConfig { // Sets the `data` field as the HTTP body for delivery. message NoWrapper { - // When true, writes the Pub/Sub message metadata to + // Optional. When true, writes the Pub/Sub message metadata to // `x-goog-pubsub-:` headers of the HTTP request. Writes the // Pub/Sub message attributes to `:` headers of the HTTP request. - bool write_metadata = 1; + bool write_metadata = 1 [(google.api.field_behavior) = OPTIONAL]; } - // A URL locating the endpoint to which messages should be pushed. + // Optional. A URL locating the endpoint to which messages should be pushed. // For example, a Webhook endpoint might use `https://example.com/push`. - string push_endpoint = 1; + string push_endpoint = 1 [(google.api.field_behavior) = OPTIONAL]; - // Endpoint configuration attributes that can be used to control different - // aspects of the message delivery. + // Optional. Endpoint configuration attributes that can be used to control + // different aspects of the message delivery. // // The only currently supported attribute is `x-goog-version`, which you can // use to change the format of the pushed message. This attribute @@ -942,29 +1055,30 @@ message PushConfig { // // For example: // `attributes { "x-goog-version": "v1" }` - map attributes = 2; + map attributes = 2 [(google.api.field_behavior) = OPTIONAL]; // An authentication method used by push endpoints to verify the source of // push requests. This can be used with push endpoints that are private by - // default to allow requests only from the Cloud Pub/Sub system, for example. + // default to allow requests only from the Pub/Sub system, for example. // This field is optional and should be set only by users interested in // authenticated push. oneof authentication_method { - // If specified, Pub/Sub will generate and attach an OIDC JWT token as an - // `Authorization` header in the HTTP request for every pushed message. - OidcToken oidc_token = 3; + // Optional. If specified, Pub/Sub will generate and attach an OIDC JWT + // token as an `Authorization` header in the HTTP request for every pushed + // message. + OidcToken oidc_token = 3 [(google.api.field_behavior) = OPTIONAL]; } // The format of the delivered message to the push endpoint is defined by // the chosen wrapper. When unset, `PubsubWrapper` is used. oneof wrapper { - // When set, the payload to the push endpoint is in the form of the JSON - // representation of a PubsubMessage + // Optional. When set, the payload to the push endpoint is in the form of + // the JSON representation of a PubsubMessage // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). - PubsubWrapper pubsub_wrapper = 4; + PubsubWrapper pubsub_wrapper = 4 [(google.api.field_behavior) = OPTIONAL]; - // When set, the payload to the push endpoint is not wrapped. - NoWrapper no_wrapper = 5; + // Optional. When set, the payload to the push endpoint is not wrapped. + NoWrapper no_wrapper = 5 [(google.api.field_behavior) = OPTIONAL]; } } @@ -991,30 +1105,34 @@ message BigQueryConfig { // Cannot write to the BigQuery table due to a schema mismatch. SCHEMA_MISMATCH = 4; + + // Cannot write to the destination because enforce_in_transit is set to true + // and the destination locations are not in the allowed regions. + IN_TRANSIT_LOCATION_RESTRICTION = 5; } - // The name of the table to which to write data, of the form + // Optional. The name of the table to which to write data, of the form // {projectId}.{datasetId}.{tableId} - string table = 1; + string table = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. When true, use the topic's schema as the columns to write to in // BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be // enabled at the same time. bool use_topic_schema = 2 [(google.api.field_behavior) = OPTIONAL]; - // When true, write the subscription name, message_id, publish_time, + // Optional. When true, write the subscription name, message_id, publish_time, // attributes, and ordering_key to additional columns in the table. The // subscription name, message_id, and publish_time fields are put in their own // columns while all other message properties (other than data) are written to // a JSON object in the attributes column. - bool write_metadata = 3; + bool write_metadata = 3 [(google.api.field_behavior) = OPTIONAL]; - // When true and use_topic_schema is true, any fields that are a part of the - // topic schema that are not part of the BigQuery table schema are dropped - // when writing to BigQuery. Otherwise, the schemas must be kept in sync and - // any messages with extra fields are not written and remain in the + // Optional. When true and use_topic_schema is true, any fields that are a + // part of the topic schema that are not part of the BigQuery table schema are + // dropped when writing to BigQuery. Otherwise, the schemas must be kept in + // sync and any messages with extra fields are not written and remain in the // subscription's backlog. - bool drop_unknown_fields = 4; + bool drop_unknown_fields = 4 [(google.api.field_behavior) = OPTIONAL]; // Output only. An output-only field that indicates whether or not the // subscription can receive messages. @@ -1036,13 +1154,13 @@ message CloudStorageConfig { // Configuration for writing message data in Avro format. // Message payloads and metadata will be written to files as an Avro binary. message AvroConfig { - // When true, write the subscription name, message_id, publish_time, - // attributes, and ordering_key as additional fields in the output. The - // subscription name, message_id, and publish_time fields are put in their - // own fields while all other message properties other than data (for - // example, an ordering_key, if present) are added as entries in the - // attributes map. - bool write_metadata = 1; + // Optional. When true, write the subscription name, message_id, + // publish_time, attributes, and ordering_key as additional fields in the + // output. The subscription name, message_id, and publish_time fields are + // put in their own fields while all other message properties other than + // data (for example, an ordering_key, if present) are added as entries in + // the attributes map. + bool write_metadata = 1 [(google.api.field_behavior) = OPTIONAL]; } // Possible states for a Cloud Storage subscription. @@ -1059,6 +1177,10 @@ message CloudStorageConfig { // Cannot write to the Cloud Storage bucket because it does not exist. NOT_FOUND = 3; + + // Cannot write to the destination because enforce_in_transit is set to true + // and the destination locations are not in the allowed regions. + IN_TRANSIT_LOCATION_RESTRICTION = 4; } // Required. User-provided name for the Cloud Storage bucket. @@ -1067,33 +1189,36 @@ message CloudStorageConfig { // requirements] (https://cloud.google.com/storage/docs/buckets#naming). string bucket = 1 [(google.api.field_behavior) = REQUIRED]; - // User-provided prefix for Cloud Storage filename. See the [object naming - // requirements](https://cloud.google.com/storage/docs/objects#naming). - string filename_prefix = 2; + // Optional. User-provided prefix for Cloud Storage filename. See the [object + // naming requirements](https://cloud.google.com/storage/docs/objects#naming). + string filename_prefix = 2 [(google.api.field_behavior) = OPTIONAL]; - // User-provided suffix for Cloud Storage filename. See the [object naming - // requirements](https://cloud.google.com/storage/docs/objects#naming). Must - // not end in "/". - string filename_suffix = 3; + // Optional. User-provided suffix for Cloud Storage filename. See the [object + // naming requirements](https://cloud.google.com/storage/docs/objects#naming). + // Must not end in "/". + string filename_suffix = 3 [(google.api.field_behavior) = OPTIONAL]; // Defaults to text format. oneof output_format { - // If set, message data will be written to Cloud Storage in text format. - TextConfig text_config = 4; + // Optional. If set, message data will be written to Cloud Storage in text + // format. + TextConfig text_config = 4 [(google.api.field_behavior) = OPTIONAL]; - // If set, message data will be written to Cloud Storage in Avro format. - AvroConfig avro_config = 5; + // Optional. If set, message data will be written to Cloud Storage in Avro + // format. + AvroConfig avro_config = 5 [(google.api.field_behavior) = OPTIONAL]; } - // The maximum duration that can elapse before a new Cloud Storage file is - // created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed - // the subscription's acknowledgement deadline. - google.protobuf.Duration max_duration = 6; + // Optional. The maximum duration that can elapse before a new Cloud Storage + // file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not + // exceed the subscription's acknowledgement deadline. + google.protobuf.Duration max_duration = 6 + [(google.api.field_behavior) = OPTIONAL]; - // The maximum bytes that can be written to a Cloud Storage file before a new - // file is created. Min 1 KB, max 10 GiB. The max_bytes limit may be exceeded - // in cases where messages are larger than the limit. - int64 max_bytes = 7; + // Optional. The maximum bytes that can be written to a Cloud Storage file + // before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may + // be exceeded in cases where messages are larger than the limit. + int64 max_bytes = 7 [(google.api.field_behavior) = OPTIONAL]; // Output only. An output-only field that indicates whether or not the // subscription can receive messages. @@ -1102,14 +1227,14 @@ message CloudStorageConfig { // A message and its corresponding acknowledgment ID. message ReceivedMessage { - // This ID can be used to acknowledge the received message. - string ack_id = 1; + // Optional. This ID can be used to acknowledge the received message. + string ack_id = 1 [(google.api.field_behavior) = OPTIONAL]; - // The message. - PubsubMessage message = 2; + // Optional. The message. + PubsubMessage message = 2 [(google.api.field_behavior) = OPTIONAL]; - // The approximate number of times that Cloud Pub/Sub has attempted to deliver - // the associated message to a subscriber. + // Optional. The approximate number of times that Pub/Sub has attempted to + // deliver the associated message to a subscriber. // // More precisely, this is 1 + (number of NACKs) + // (number of ack_deadline exceeds) for this message. @@ -1124,7 +1249,7 @@ message ReceivedMessage { // value of 1. The value is calculated at best effort and is approximate. // // If a DeadLetterPolicy is not set on the subscription, this will be 0. - int32 delivery_attempt = 3; + int32 delivery_attempt = 3 [(google.api.field_behavior) = OPTIONAL]; } // Request for the GetSubscription method. @@ -1161,24 +1286,25 @@ message ListSubscriptionsRequest { } ]; - // Maximum number of subscriptions to return. - int32 page_size = 2; + // Optional. Maximum number of subscriptions to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // The value returned by the last `ListSubscriptionsResponse`; indicates that - // this is a continuation of a prior `ListSubscriptions` call, and that the - // system should return the next page of data. - string page_token = 3; + // Optional. The value returned by the last `ListSubscriptionsResponse`; + // indicates that this is a continuation of a prior `ListSubscriptions` call, + // and that the system should return the next page of data. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; } // Response for the `ListSubscriptions` method. message ListSubscriptionsResponse { - // The subscriptions that match the request. - repeated Subscription subscriptions = 1; + // Optional. The subscriptions that match the request. + repeated Subscription subscriptions = 1 + [(google.api.field_behavior) = OPTIONAL]; - // If not empty, indicates that there may be more subscriptions that match - // the request; this value should be passed in a new + // Optional. If not empty, indicates that there may be more subscriptions that + // match the request; this value should be passed in a new // `ListSubscriptionsRequest` to get more subscriptions. - string next_page_token = 2; + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; } // Request for the DeleteSubscription method. @@ -1242,12 +1368,13 @@ message PullRequest { // Response for the `Pull` method. message PullResponse { - // Received Pub/Sub messages. The list will be empty if there are no more - // messages available in the backlog, or if no messages could be returned + // Optional. Received Pub/Sub messages. The list will be empty if there are no + // more messages available in the backlog, or if no messages could be returned // before the request timeout. For JSON, the response can be entirely // empty. The Pub/Sub system may return fewer than the `maxMessages` requested // even if there are more messages available in the backlog. - repeated ReceivedMessage received_messages = 1; + repeated ReceivedMessage received_messages = 1 + [(google.api.field_behavior) = OPTIONAL]; } // Request for the ModifyAckDeadline method. @@ -1271,7 +1398,8 @@ message ModifyAckDeadlineRequest { // delivery to another subscriber client. This typically results in an // increase in the rate of message redeliveries (that is, duplicates). // The minimum deadline you can specify is 0 seconds. - // The maximum deadline you can specify is 600 seconds (10 minutes). + // The maximum deadline you can specify in a single request is 600 seconds + // (10 minutes). int32 ack_deadline_seconds = 3 [(google.api.field_behavior) = REQUIRED]; } @@ -1307,14 +1435,15 @@ message StreamingPullRequest { } ]; - // List of acknowledgement IDs for acknowledging previously received messages - // (received on this stream or a different stream). If an ack ID has expired, - // the corresponding message may be redelivered later. Acknowledging a message - // more than once will not result in an error. If the acknowledgement ID is - // malformed, the stream will be aborted with status `INVALID_ARGUMENT`. - repeated string ack_ids = 2; + // Optional. List of acknowledgement IDs for acknowledging previously received + // messages (received on this stream or a different stream). If an ack ID has + // expired, the corresponding message may be redelivered later. Acknowledging + // a message more than once will not result in an error. If the + // acknowledgement ID is malformed, the stream will be aborted with status + // `INVALID_ARGUMENT`. + repeated string ack_ids = 2 [(google.api.field_behavior) = OPTIONAL]; - // The list of new ack deadlines for the IDs listed in + // Optional. The list of new ack deadlines for the IDs listed in // `modify_deadline_ack_ids`. The size of this list must be the same as the // size of `modify_deadline_ack_ids`. If it differs the stream will be aborted // with `INVALID_ARGUMENT`. Each element in this list is applied to the @@ -1325,14 +1454,16 @@ message StreamingPullRequest { // the message is immediately made available for another streaming or // non-streaming pull request. If the value is < 0 (an error), the stream will // be aborted with status `INVALID_ARGUMENT`. - repeated int32 modify_deadline_seconds = 3; + repeated int32 modify_deadline_seconds = 3 + [(google.api.field_behavior) = OPTIONAL]; - // List of acknowledgement IDs whose deadline will be modified based on the - // corresponding element in `modify_deadline_seconds`. This field can be used - // to indicate that more time is needed to process a message by the + // Optional. List of acknowledgement IDs whose deadline will be modified based + // on the corresponding element in `modify_deadline_seconds`. This field can + // be used to indicate that more time is needed to process a message by the // subscriber, or to make the message available for redelivery if the // processing was interrupted. - repeated string modify_deadline_ack_ids = 4; + repeated string modify_deadline_ack_ids = 4 + [(google.api.field_behavior) = OPTIONAL]; // Required. The ack deadline to use for the stream. This must be provided in // the first request on the stream, but it can also be updated on subsequent @@ -1341,16 +1472,16 @@ message StreamingPullRequest { int32 stream_ack_deadline_seconds = 5 [(google.api.field_behavior) = REQUIRED]; - // A unique identifier that is used to distinguish client instances from each - // other. Only needs to be provided on the initial request. When a stream - // disconnects and reconnects for the same stream, the client_id should be set - // to the same value so that state associated with the old stream can be - // transferred to the new stream. The same client_id should not be used for + // Optional. A unique identifier that is used to distinguish client instances + // from each other. Only needs to be provided on the initial request. When a + // stream disconnects and reconnects for the same stream, the client_id should + // be set to the same value so that state associated with the old stream can + // be transferred to the new stream. The same client_id should not be used for // different client instances. - string client_id = 6; + string client_id = 6 [(google.api.field_behavior) = OPTIONAL]; - // Flow control settings for the maximum number of outstanding messages. When - // there are `max_outstanding_messages` or more currently sent to the + // Optional. Flow control settings for the maximum number of outstanding + // messages. When there are `max_outstanding_messages` currently sent to the // streaming pull client that have not yet been acked or nacked, the server // stops sending more messages. The sending of messages resumes once the // number of outstanding messages is less than this value. If the value is @@ -1358,18 +1489,18 @@ message StreamingPullRequest { // property can only be set on the initial StreamingPullRequest. If it is set // on a subsequent request, the stream will be aborted with status // `INVALID_ARGUMENT`. - int64 max_outstanding_messages = 7; - - // Flow control settings for the maximum number of outstanding bytes. When - // there are `max_outstanding_bytes` or more worth of messages currently sent - // to the streaming pull client that have not yet been acked or nacked, the - // server will stop sending more messages. The sending of messages resumes - // once the number of outstanding bytes is less than this value. If the value - // is <= 0, there is no limit to the number of outstanding bytes. This - // property can only be set on the initial StreamingPullRequest. If it is set - // on a subsequent request, the stream will be aborted with status + int64 max_outstanding_messages = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Flow control settings for the maximum number of outstanding + // bytes. When there are `max_outstanding_bytes` or more worth of messages + // currently sent to the streaming pull client that have not yet been acked or + // nacked, the server will stop sending more messages. The sending of messages + // resumes once the number of outstanding bytes is less than this value. If + // the value is <= 0, there is no limit to the number of outstanding bytes. + // This property can only be set on the initial StreamingPullRequest. If it is + // set on a subsequent request, the stream will be aborted with status // `INVALID_ARGUMENT`. - int64 max_outstanding_bytes = 8; + int64 max_outstanding_bytes = 8 [(google.api.field_behavior) = OPTIONAL]; } // Response for the `StreamingPull` method. This response is used to stream @@ -1378,56 +1509,69 @@ message StreamingPullResponse { // Acknowledgement IDs sent in one or more previous requests to acknowledge a // previously received message. message AcknowledgeConfirmation { - // Successfully processed acknowledgement IDs. - repeated string ack_ids = 1; - - // List of acknowledgement IDs that were malformed or whose acknowledgement - // deadline has expired. - repeated string invalid_ack_ids = 2; - - // List of acknowledgement IDs that were out of order. - repeated string unordered_ack_ids = 3; - - // List of acknowledgement IDs that failed processing with temporary issues. - repeated string temporary_failed_ack_ids = 4; + // Optional. Successfully processed acknowledgement IDs. + repeated string ack_ids = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of acknowledgement IDs that were malformed or whose + // acknowledgement deadline has expired. + repeated string invalid_ack_ids = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of acknowledgement IDs that were out of order. + repeated string unordered_ack_ids = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of acknowledgement IDs that failed processing with + // temporary issues. + repeated string temporary_failed_ack_ids = 4 + [(google.api.field_behavior) = OPTIONAL]; } // Acknowledgement IDs sent in one or more previous requests to modify the // deadline for a specific message. message ModifyAckDeadlineConfirmation { - // Successfully processed acknowledgement IDs. - repeated string ack_ids = 1; - - // List of acknowledgement IDs that were malformed or whose acknowledgement - // deadline has expired. - repeated string invalid_ack_ids = 2; - - // List of acknowledgement IDs that failed processing with temporary issues. - repeated string temporary_failed_ack_ids = 3; + // Optional. Successfully processed acknowledgement IDs. + repeated string ack_ids = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of acknowledgement IDs that were malformed or whose + // acknowledgement deadline has expired. + repeated string invalid_ack_ids = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of acknowledgement IDs that failed processing with + // temporary issues. + repeated string temporary_failed_ack_ids = 3 + [(google.api.field_behavior) = OPTIONAL]; } // Subscription properties sent as part of the response. message SubscriptionProperties { - // True iff exactly once delivery is enabled for this subscription. - bool exactly_once_delivery_enabled = 1; + // Optional. True iff exactly once delivery is enabled for this + // subscription. + bool exactly_once_delivery_enabled = 1 + [(google.api.field_behavior) = OPTIONAL]; - // True iff message ordering is enabled for this subscription. - bool message_ordering_enabled = 2; + // Optional. True iff message ordering is enabled for this subscription. + bool message_ordering_enabled = 2 [(google.api.field_behavior) = OPTIONAL]; } - // Received Pub/Sub messages. This will not be empty. - repeated ReceivedMessage received_messages = 1; + // Optional. Received Pub/Sub messages. This will not be empty. + repeated ReceivedMessage received_messages = 1 + [(google.api.field_behavior) = OPTIONAL]; - // This field will only be set if `enable_exactly_once_delivery` is set to - // `true`. - AcknowledgeConfirmation acknowledge_confirmation = 5; + // Optional. This field will only be set if `enable_exactly_once_delivery` is + // set to `true`. + AcknowledgeConfirmation acknowledge_confirmation = 5 + [(google.api.field_behavior) = OPTIONAL]; - // This field will only be set if `enable_exactly_once_delivery` is set to - // `true`. - ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3; + // Optional. This field will only be set if `enable_exactly_once_delivery` is + // set to `true`. + ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3 + [(google.api.field_behavior) = OPTIONAL]; - // Properties associated with this subscription. - SubscriptionProperties subscription_properties = 4; + // Optional. Properties associated with this subscription. + SubscriptionProperties subscription_properties = 4 + [(google.api.field_behavior) = OPTIONAL]; } // Request for the `CreateSnapshot` method. @@ -1459,9 +1603,9 @@ message CreateSnapshotRequest { } ]; - // See [Creating and managing + // Optional. See [Creating and managing // labels](https://cloud.google.com/pubsub/docs/labels). - map labels = 3; + map labels = 3 [(google.api.field_behavior) = OPTIONAL]; } // Request for the UpdateSnapshot method. @@ -1486,15 +1630,17 @@ message Snapshot { pattern: "projects/{project}/snapshots/{snapshot}" }; - // The name of the snapshot. - string name = 1; + // Optional. The name of the snapshot. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; - // The name of the topic from which this snapshot is retaining messages. + // Optional. The name of the topic from which this snapshot is retaining + // messages. string topic = 2 [ + (google.api.field_behavior) = OPTIONAL, (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } ]; - // The snapshot is guaranteed to exist up until this time. + // Optional. The snapshot is guaranteed to exist up until this time. // A newly-created snapshot expires no later than 7 days from the time of its // creation. Its exact lifetime is determined at creation by the existing // backlog in the source subscription. Specifically, the lifetime of the @@ -1504,11 +1650,12 @@ message Snapshot { // will always capture this 3-day-old backlog as long as the snapshot // exists -- will expire in 4 days. The service will refuse to create a // snapshot that would expire in less than 1 hour after creation. - google.protobuf.Timestamp expire_time = 3; + google.protobuf.Timestamp expire_time = 3 + [(google.api.field_behavior) = OPTIONAL]; - // See [Creating and managing labels] + // Optional. See [Creating and managing labels] // (https://cloud.google.com/pubsub/docs/labels). - map labels = 4; + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; } // Request for the GetSnapshot method. @@ -1532,23 +1679,24 @@ message ListSnapshotsRequest { } ]; - // Maximum number of snapshots to return. - int32 page_size = 2; + // Optional. Maximum number of snapshots to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // The value returned by the last `ListSnapshotsResponse`; indicates that this - // is a continuation of a prior `ListSnapshots` call, and that the system - // should return the next page of data. - string page_token = 3; + // Optional. The value returned by the last `ListSnapshotsResponse`; indicates + // that this is a continuation of a prior `ListSnapshots` call, and that the + // system should return the next page of data. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; } // Response for the `ListSnapshots` method. message ListSnapshotsResponse { - // The resulting snapshots. - repeated Snapshot snapshots = 1; + // Optional. The resulting snapshots. + repeated Snapshot snapshots = 1 [(google.api.field_behavior) = OPTIONAL]; - // If not empty, indicates that there may be more snapshot that match the - // request; this value should be passed in a new `ListSnapshotsRequest`. - string next_page_token = 2; + // Optional. If not empty, indicates that there may be more snapshot that + // match the request; this value should be passed in a new + // `ListSnapshotsRequest`. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; } // Request for the `DeleteSnapshot` method. @@ -1572,7 +1720,7 @@ message SeekRequest { ]; oneof target { - // The time to seek to. + // Optional. The time to seek to. // Messages retained in the subscription that were published before this // time are marked as acknowledged, and messages retained in the // subscription that were published after this time are marked as @@ -1583,14 +1731,17 @@ message SeekRequest { // window (or to a point before the system's notion of the subscription // creation time), only retained messages will be marked as unacknowledged, // and already-expunged messages will not be restored. - google.protobuf.Timestamp time = 2; - - // The snapshot to seek to. The snapshot's topic must be the same as that of - // the provided subscription. - // Format is `projects/{project}/snapshots/{snap}`. - string snapshot = 3 [(google.api.resource_reference) = { - type: "pubsub.googleapis.com/Snapshot" - }]; + google.protobuf.Timestamp time = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The snapshot to seek to. The snapshot's topic must be the same + // as that of the provided subscription. Format is + // `projects/{project}/snapshots/{snap}`. + string snapshot = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Snapshot" + } + ]; } } diff --git a/protos/google/pubsub/v1/schema.proto b/protos/google/pubsub/v1/schema.proto index 32aa0d75c..bd17cf0f8 100644 --- a/protos/google/pubsub/v1/schema.proto +++ b/protos/google/pubsub/v1/schema.proto @@ -202,8 +202,8 @@ message CreateSchemaRequest { // The ID to use for the schema, which will become the final component of // the schema's resource name. // - // See https://cloud.google.com/pubsub/docs/admin#resource_names for resource - // name constraints. + // See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for + // resource name constraints. string schema_id = 3; } diff --git a/protos/protos.d.ts b/protos/protos.d.ts index eb65e4c60..dda11424e 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -241,6 +241,9 @@ export namespace google { /** MessageStoragePolicy allowedPersistenceRegions */ allowedPersistenceRegions?: (string[]|null); + + /** MessageStoragePolicy enforceInTransit */ + enforceInTransit?: (boolean|null); } /** Represents a MessageStoragePolicy. */ @@ -255,6 +258,9 @@ export namespace google { /** MessageStoragePolicy allowedPersistenceRegions. */ public allowedPersistenceRegions: string[]; + /** MessageStoragePolicy enforceInTransit. */ + public enforceInTransit: boolean; + /** * Creates a new MessageStoragePolicy instance using the specified properties. * @param [properties] Properties to set @@ -448,6 +454,243 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an IngestionDataSourceSettings. */ + interface IIngestionDataSourceSettings { + + /** IngestionDataSourceSettings awsKinesis */ + awsKinesis?: (google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis|null); + } + + /** Represents an IngestionDataSourceSettings. */ + class IngestionDataSourceSettings implements IIngestionDataSourceSettings { + + /** + * Constructs a new IngestionDataSourceSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IIngestionDataSourceSettings); + + /** IngestionDataSourceSettings awsKinesis. */ + public awsKinesis?: (google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis|null); + + /** IngestionDataSourceSettings source. */ + public source?: "awsKinesis"; + + /** + * Creates a new IngestionDataSourceSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns IngestionDataSourceSettings instance + */ + public static create(properties?: google.pubsub.v1.IIngestionDataSourceSettings): google.pubsub.v1.IngestionDataSourceSettings; + + /** + * Encodes the specified IngestionDataSourceSettings message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.verify|verify} messages. + * @param message IngestionDataSourceSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IIngestionDataSourceSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngestionDataSourceSettings message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.verify|verify} messages. + * @param message IngestionDataSourceSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IIngestionDataSourceSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngestionDataSourceSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngestionDataSourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionDataSourceSettings; + + /** + * Decodes an IngestionDataSourceSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngestionDataSourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionDataSourceSettings; + + /** + * Verifies an IngestionDataSourceSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IngestionDataSourceSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngestionDataSourceSettings + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionDataSourceSettings; + + /** + * Creates a plain object from an IngestionDataSourceSettings message. Also converts values to other types if specified. + * @param message IngestionDataSourceSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionDataSourceSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngestionDataSourceSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngestionDataSourceSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IngestionDataSourceSettings { + + /** Properties of an AwsKinesis. */ + interface IAwsKinesis { + + /** AwsKinesis state */ + state?: (google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State|keyof typeof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State|null); + + /** AwsKinesis streamArn */ + streamArn?: (string|null); + + /** AwsKinesis consumerArn */ + consumerArn?: (string|null); + + /** AwsKinesis awsRoleArn */ + awsRoleArn?: (string|null); + + /** AwsKinesis gcpServiceAccount */ + gcpServiceAccount?: (string|null); + } + + /** Represents an AwsKinesis. */ + class AwsKinesis implements IAwsKinesis { + + /** + * Constructs a new AwsKinesis. + * @param [properties] Properties to set + */ + constructor(properties?: google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis); + + /** AwsKinesis state. */ + public state: (google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State|keyof typeof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State); + + /** AwsKinesis streamArn. */ + public streamArn: string; + + /** AwsKinesis consumerArn. */ + public consumerArn: string; + + /** AwsKinesis awsRoleArn. */ + public awsRoleArn: string; + + /** AwsKinesis gcpServiceAccount. */ + public gcpServiceAccount: string; + + /** + * Creates a new AwsKinesis instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsKinesis instance + */ + public static create(properties?: google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis): google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis; + + /** + * Encodes the specified AwsKinesis message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify|verify} messages. + * @param message AwsKinesis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsKinesis message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify|verify} messages. + * @param message AwsKinesis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsKinesis message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsKinesis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis; + + /** + * Decodes an AwsKinesis message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsKinesis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis; + + /** + * Verifies an AwsKinesis message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AwsKinesis message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsKinesis + */ + public static fromObject(object: { [k: string]: any }): google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis; + + /** + * Creates a plain object from an AwsKinesis message. Also converts values to other types if specified. + * @param message AwsKinesis + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsKinesis to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwsKinesis + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AwsKinesis { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + KINESIS_PERMISSION_DENIED = 2, + PUBLISH_PERMISSION_DENIED = 3, + STREAM_NOT_FOUND = 4, + CONSUMER_NOT_FOUND = 5 + } + } + } + /** Properties of a Topic. */ interface ITopic { @@ -471,6 +714,12 @@ export namespace google { /** Topic messageRetentionDuration */ messageRetentionDuration?: (google.protobuf.IDuration|null); + + /** Topic state */ + state?: (google.pubsub.v1.Topic.State|keyof typeof google.pubsub.v1.Topic.State|null); + + /** Topic ingestionDataSourceSettings */ + ingestionDataSourceSettings?: (google.pubsub.v1.IIngestionDataSourceSettings|null); } /** Represents a Topic. */ @@ -503,6 +752,12 @@ export namespace google { /** Topic messageRetentionDuration. */ public messageRetentionDuration?: (google.protobuf.IDuration|null); + /** Topic state. */ + public state: (google.pubsub.v1.Topic.State|keyof typeof google.pubsub.v1.Topic.State); + + /** Topic ingestionDataSourceSettings. */ + public ingestionDataSourceSettings?: (google.pubsub.v1.IIngestionDataSourceSettings|null); + /** * Creates a new Topic instance using the specified properties. * @param [properties] Properties to set @@ -581,6 +836,16 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace Topic { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + INGESTION_RESOURCE_ERROR = 2 + } + } + /** Properties of a PubsubMessage. */ interface IPubsubMessage { @@ -3451,7 +3716,8 @@ export namespace google { ACTIVE = 1, PERMISSION_DENIED = 2, NOT_FOUND = 3, - SCHEMA_MISMATCH = 4 + SCHEMA_MISMATCH = 4, + IN_TRANSIT_LOCATION_RESTRICTION = 5 } } @@ -3792,7 +4058,8 @@ export namespace google { STATE_UNSPECIFIED = 0, ACTIVE = 1, PERMISSION_DENIED = 2, - NOT_FOUND = 3 + NOT_FOUND = 3, + IN_TRANSIT_LOCATION_RESTRICTION = 4 } } diff --git a/protos/protos.js b/protos/protos.js index b4d71be66..fa620f8e5 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -396,6 +396,7 @@ * @memberof google.pubsub.v1 * @interface IMessageStoragePolicy * @property {Array.|null} [allowedPersistenceRegions] MessageStoragePolicy allowedPersistenceRegions + * @property {boolean|null} [enforceInTransit] MessageStoragePolicy enforceInTransit */ /** @@ -422,6 +423,14 @@ */ MessageStoragePolicy.prototype.allowedPersistenceRegions = $util.emptyArray; + /** + * MessageStoragePolicy enforceInTransit. + * @member {boolean} enforceInTransit + * @memberof google.pubsub.v1.MessageStoragePolicy + * @instance + */ + MessageStoragePolicy.prototype.enforceInTransit = false; + /** * Creates a new MessageStoragePolicy instance using the specified properties. * @function create @@ -449,6 +458,8 @@ if (message.allowedPersistenceRegions != null && message.allowedPersistenceRegions.length) for (var i = 0; i < message.allowedPersistenceRegions.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedPersistenceRegions[i]); + if (message.enforceInTransit != null && Object.hasOwnProperty.call(message, "enforceInTransit")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enforceInTransit); return writer; }; @@ -489,6 +500,10 @@ message.allowedPersistenceRegions.push(reader.string()); break; } + case 2: { + message.enforceInTransit = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -531,6 +546,9 @@ if (!$util.isString(message.allowedPersistenceRegions[i])) return "allowedPersistenceRegions: string[] expected"; } + if (message.enforceInTransit != null && message.hasOwnProperty("enforceInTransit")) + if (typeof message.enforceInTransit !== "boolean") + return "enforceInTransit: boolean expected"; return null; }; @@ -553,6 +571,8 @@ for (var i = 0; i < object.allowedPersistenceRegions.length; ++i) message.allowedPersistenceRegions[i] = String(object.allowedPersistenceRegions[i]); } + if (object.enforceInTransit != null) + message.enforceInTransit = Boolean(object.enforceInTransit); return message; }; @@ -571,11 +591,15 @@ var object = {}; if (options.arrays || options.defaults) object.allowedPersistenceRegions = []; + if (options.defaults) + object.enforceInTransit = false; if (message.allowedPersistenceRegions && message.allowedPersistenceRegions.length) { object.allowedPersistenceRegions = []; for (var j = 0; j < message.allowedPersistenceRegions.length; ++j) object.allowedPersistenceRegions[j] = message.allowedPersistenceRegions[j]; } + if (message.enforceInTransit != null && message.hasOwnProperty("enforceInTransit")) + object.enforceInTransit = message.enforceInTransit; return object; }; @@ -905,6 +929,590 @@ return SchemaSettings; })(); + v1.IngestionDataSourceSettings = (function() { + + /** + * Properties of an IngestionDataSourceSettings. + * @memberof google.pubsub.v1 + * @interface IIngestionDataSourceSettings + * @property {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis|null} [awsKinesis] IngestionDataSourceSettings awsKinesis + */ + + /** + * Constructs a new IngestionDataSourceSettings. + * @memberof google.pubsub.v1 + * @classdesc Represents an IngestionDataSourceSettings. + * @implements IIngestionDataSourceSettings + * @constructor + * @param {google.pubsub.v1.IIngestionDataSourceSettings=} [properties] Properties to set + */ + function IngestionDataSourceSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IngestionDataSourceSettings awsKinesis. + * @member {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis|null|undefined} awsKinesis + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @instance + */ + IngestionDataSourceSettings.prototype.awsKinesis = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * IngestionDataSourceSettings source. + * @member {"awsKinesis"|undefined} source + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @instance + */ + Object.defineProperty(IngestionDataSourceSettings.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["awsKinesis"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IngestionDataSourceSettings instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {google.pubsub.v1.IIngestionDataSourceSettings=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionDataSourceSettings} IngestionDataSourceSettings instance + */ + IngestionDataSourceSettings.create = function create(properties) { + return new IngestionDataSourceSettings(properties); + }; + + /** + * Encodes the specified IngestionDataSourceSettings message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {google.pubsub.v1.IIngestionDataSourceSettings} message IngestionDataSourceSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestionDataSourceSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.awsKinesis != null && Object.hasOwnProperty.call(message, "awsKinesis")) + $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.encode(message.awsKinesis, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IngestionDataSourceSettings message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {google.pubsub.v1.IIngestionDataSourceSettings} message IngestionDataSourceSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestionDataSourceSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngestionDataSourceSettings message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionDataSourceSettings} IngestionDataSourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestionDataSourceSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionDataSourceSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.awsKinesis = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngestionDataSourceSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionDataSourceSettings} IngestionDataSourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestionDataSourceSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngestionDataSourceSettings message. + * @function verify + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngestionDataSourceSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.awsKinesis != null && message.hasOwnProperty("awsKinesis")) { + properties.source = 1; + { + var error = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify(message.awsKinesis); + if (error) + return "awsKinesis." + error; + } + } + return null; + }; + + /** + * Creates an IngestionDataSourceSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionDataSourceSettings} IngestionDataSourceSettings + */ + IngestionDataSourceSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionDataSourceSettings) + return object; + var message = new $root.google.pubsub.v1.IngestionDataSourceSettings(); + if (object.awsKinesis != null) { + if (typeof object.awsKinesis !== "object") + throw TypeError(".google.pubsub.v1.IngestionDataSourceSettings.awsKinesis: object expected"); + message.awsKinesis = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.fromObject(object.awsKinesis); + } + return message; + }; + + /** + * Creates a plain object from an IngestionDataSourceSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings} message IngestionDataSourceSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngestionDataSourceSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.awsKinesis != null && message.hasOwnProperty("awsKinesis")) { + object.awsKinesis = $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.toObject(message.awsKinesis, options); + if (options.oneofs) + object.source = "awsKinesis"; + } + return object; + }; + + /** + * Converts this IngestionDataSourceSettings to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @instance + * @returns {Object.} JSON object + */ + IngestionDataSourceSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngestionDataSourceSettings + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngestionDataSourceSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionDataSourceSettings"; + }; + + IngestionDataSourceSettings.AwsKinesis = (function() { + + /** + * Properties of an AwsKinesis. + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @interface IAwsKinesis + * @property {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State|null} [state] AwsKinesis state + * @property {string|null} [streamArn] AwsKinesis streamArn + * @property {string|null} [consumerArn] AwsKinesis consumerArn + * @property {string|null} [awsRoleArn] AwsKinesis awsRoleArn + * @property {string|null} [gcpServiceAccount] AwsKinesis gcpServiceAccount + */ + + /** + * Constructs a new AwsKinesis. + * @memberof google.pubsub.v1.IngestionDataSourceSettings + * @classdesc Represents an AwsKinesis. + * @implements IAwsKinesis + * @constructor + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis=} [properties] Properties to set + */ + function AwsKinesis(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsKinesis state. + * @member {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State} state + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + */ + AwsKinesis.prototype.state = 0; + + /** + * AwsKinesis streamArn. + * @member {string} streamArn + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + */ + AwsKinesis.prototype.streamArn = ""; + + /** + * AwsKinesis consumerArn. + * @member {string} consumerArn + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + */ + AwsKinesis.prototype.consumerArn = ""; + + /** + * AwsKinesis awsRoleArn. + * @member {string} awsRoleArn + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + */ + AwsKinesis.prototype.awsRoleArn = ""; + + /** + * AwsKinesis gcpServiceAccount. + * @member {string} gcpServiceAccount + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + */ + AwsKinesis.prototype.gcpServiceAccount = ""; + + /** + * Creates a new AwsKinesis instance using the specified properties. + * @function create + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis=} [properties] Properties to set + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} AwsKinesis instance + */ + AwsKinesis.create = function create(properties) { + return new AwsKinesis(properties); + }; + + /** + * Encodes the specified AwsKinesis message. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify|verify} messages. + * @function encode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis} message AwsKinesis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsKinesis.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.streamArn != null && Object.hasOwnProperty.call(message, "streamArn")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.streamArn); + if (message.consumerArn != null && Object.hasOwnProperty.call(message, "consumerArn")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.consumerArn); + if (message.awsRoleArn != null && Object.hasOwnProperty.call(message, "awsRoleArn")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.awsRoleArn); + if (message.gcpServiceAccount != null && Object.hasOwnProperty.call(message, "gcpServiceAccount")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.gcpServiceAccount); + return writer; + }; + + /** + * Encodes the specified AwsKinesis message, length delimited. Does not implicitly {@link google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.verify|verify} messages. + * @function encodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.IAwsKinesis} message AwsKinesis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsKinesis.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsKinesis message from the specified reader or buffer. + * @function decode + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} AwsKinesis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsKinesis.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.streamArn = reader.string(); + break; + } + case 3: { + message.consumerArn = reader.string(); + break; + } + case 4: { + message.awsRoleArn = reader.string(); + break; + } + case 5: { + message.gcpServiceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsKinesis message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} AwsKinesis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsKinesis.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsKinesis message. + * @function verify + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsKinesis.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.streamArn != null && message.hasOwnProperty("streamArn")) + if (!$util.isString(message.streamArn)) + return "streamArn: string expected"; + if (message.consumerArn != null && message.hasOwnProperty("consumerArn")) + if (!$util.isString(message.consumerArn)) + return "consumerArn: string expected"; + if (message.awsRoleArn != null && message.hasOwnProperty("awsRoleArn")) + if (!$util.isString(message.awsRoleArn)) + return "awsRoleArn: string expected"; + if (message.gcpServiceAccount != null && message.hasOwnProperty("gcpServiceAccount")) + if (!$util.isString(message.gcpServiceAccount)) + return "gcpServiceAccount: string expected"; + return null; + }; + + /** + * Creates an AwsKinesis message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {Object.} object Plain object + * @returns {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} AwsKinesis + */ + AwsKinesis.fromObject = function fromObject(object) { + if (object instanceof $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis) + return object; + var message = new $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "KINESIS_PERMISSION_DENIED": + case 2: + message.state = 2; + break; + case "PUBLISH_PERMISSION_DENIED": + case 3: + message.state = 3; + break; + case "STREAM_NOT_FOUND": + case 4: + message.state = 4; + break; + case "CONSUMER_NOT_FOUND": + case 5: + message.state = 5; + break; + } + if (object.streamArn != null) + message.streamArn = String(object.streamArn); + if (object.consumerArn != null) + message.consumerArn = String(object.consumerArn); + if (object.awsRoleArn != null) + message.awsRoleArn = String(object.awsRoleArn); + if (object.gcpServiceAccount != null) + message.gcpServiceAccount = String(object.gcpServiceAccount); + return message; + }; + + /** + * Creates a plain object from an AwsKinesis message. Also converts values to other types if specified. + * @function toObject + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis} message AwsKinesis + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsKinesis.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.streamArn = ""; + object.consumerArn = ""; + object.awsRoleArn = ""; + object.gcpServiceAccount = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State[message.state] : message.state; + if (message.streamArn != null && message.hasOwnProperty("streamArn")) + object.streamArn = message.streamArn; + if (message.consumerArn != null && message.hasOwnProperty("consumerArn")) + object.consumerArn = message.consumerArn; + if (message.awsRoleArn != null && message.hasOwnProperty("awsRoleArn")) + object.awsRoleArn = message.awsRoleArn; + if (message.gcpServiceAccount != null && message.hasOwnProperty("gcpServiceAccount")) + object.gcpServiceAccount = message.gcpServiceAccount; + return object; + }; + + /** + * Converts this AwsKinesis to JSON. + * @function toJSON + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @instance + * @returns {Object.} JSON object + */ + AwsKinesis.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwsKinesis + * @function getTypeUrl + * @memberof google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwsKinesis.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis"; + }; + + /** + * State enum. + * @name google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} KINESIS_PERMISSION_DENIED=2 KINESIS_PERMISSION_DENIED value + * @property {number} PUBLISH_PERMISSION_DENIED=3 PUBLISH_PERMISSION_DENIED value + * @property {number} STREAM_NOT_FOUND=4 STREAM_NOT_FOUND value + * @property {number} CONSUMER_NOT_FOUND=5 CONSUMER_NOT_FOUND value + */ + AwsKinesis.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "KINESIS_PERMISSION_DENIED"] = 2; + values[valuesById[3] = "PUBLISH_PERMISSION_DENIED"] = 3; + values[valuesById[4] = "STREAM_NOT_FOUND"] = 4; + values[valuesById[5] = "CONSUMER_NOT_FOUND"] = 5; + return values; + })(); + + return AwsKinesis; + })(); + + return IngestionDataSourceSettings; + })(); + v1.Topic = (function() { /** @@ -918,6 +1526,8 @@ * @property {google.pubsub.v1.ISchemaSettings|null} [schemaSettings] Topic schemaSettings * @property {boolean|null} [satisfiesPzs] Topic satisfiesPzs * @property {google.protobuf.IDuration|null} [messageRetentionDuration] Topic messageRetentionDuration + * @property {google.pubsub.v1.Topic.State|null} [state] Topic state + * @property {google.pubsub.v1.IIngestionDataSourceSettings|null} [ingestionDataSourceSettings] Topic ingestionDataSourceSettings */ /** @@ -992,6 +1602,22 @@ */ Topic.prototype.messageRetentionDuration = null; + /** + * Topic state. + * @member {google.pubsub.v1.Topic.State} state + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.state = 0; + + /** + * Topic ingestionDataSourceSettings. + * @member {google.pubsub.v1.IIngestionDataSourceSettings|null|undefined} ingestionDataSourceSettings + * @memberof google.pubsub.v1.Topic + * @instance + */ + Topic.prototype.ingestionDataSourceSettings = null; + /** * Creates a new Topic instance using the specified properties. * @function create @@ -1031,6 +1657,10 @@ writer.uint32(/* id 7, wireType 0 =*/56).bool(message.satisfiesPzs); if (message.messageRetentionDuration != null && Object.hasOwnProperty.call(message, "messageRetentionDuration")) $root.google.protobuf.Duration.encode(message.messageRetentionDuration, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.state); + if (message.ingestionDataSourceSettings != null && Object.hasOwnProperty.call(message, "ingestionDataSourceSettings")) + $root.google.pubsub.v1.IngestionDataSourceSettings.encode(message.ingestionDataSourceSettings, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -1112,6 +1742,14 @@ message.messageRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } + case 9: { + message.state = reader.int32(); + break; + } + case 10: { + message.ingestionDataSourceSettings = $root.google.pubsub.v1.IngestionDataSourceSettings.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -1179,6 +1817,20 @@ if (error) return "messageRetentionDuration." + error; } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.ingestionDataSourceSettings != null && message.hasOwnProperty("ingestionDataSourceSettings")) { + var error = $root.google.pubsub.v1.IngestionDataSourceSettings.verify(message.ingestionDataSourceSettings); + if (error) + return "ingestionDataSourceSettings." + error; + } return null; }; @@ -1222,6 +1874,31 @@ throw TypeError(".google.pubsub.v1.Topic.messageRetentionDuration: object expected"); message.messageRetentionDuration = $root.google.protobuf.Duration.fromObject(object.messageRetentionDuration); } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "INGESTION_RESOURCE_ERROR": + case 2: + message.state = 2; + break; + } + if (object.ingestionDataSourceSettings != null) { + if (typeof object.ingestionDataSourceSettings !== "object") + throw TypeError(".google.pubsub.v1.Topic.ingestionDataSourceSettings: object expected"); + message.ingestionDataSourceSettings = $root.google.pubsub.v1.IngestionDataSourceSettings.fromObject(object.ingestionDataSourceSettings); + } return message; }; @@ -1247,6 +1924,8 @@ object.schemaSettings = null; object.satisfiesPzs = false; object.messageRetentionDuration = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.ingestionDataSourceSettings = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1266,6 +1945,10 @@ object.satisfiesPzs = message.satisfiesPzs; if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) object.messageRetentionDuration = $root.google.protobuf.Duration.toObject(message.messageRetentionDuration, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.pubsub.v1.Topic.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.Topic.State[message.state] : message.state; + if (message.ingestionDataSourceSettings != null && message.hasOwnProperty("ingestionDataSourceSettings")) + object.ingestionDataSourceSettings = $root.google.pubsub.v1.IngestionDataSourceSettings.toObject(message.ingestionDataSourceSettings, options); return object; }; @@ -1295,6 +1978,22 @@ return typeUrlPrefix + "/google.pubsub.v1.Topic"; }; + /** + * State enum. + * @name google.pubsub.v1.Topic.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INGESTION_RESOURCE_ERROR=2 INGESTION_RESOURCE_ERROR value + */ + Topic.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INGESTION_RESOURCE_ERROR"] = 2; + return values; + })(); + return Topic; })(); @@ -7783,6 +8482,7 @@ case 2: case 3: case 4: + case 5: break; } if (message.useTableSchema != null && message.hasOwnProperty("useTableSchema")) @@ -7838,6 +8538,10 @@ case 4: message.state = 4; break; + case "IN_TRANSIT_LOCATION_RESTRICTION": + case 5: + message.state = 5; + break; } if (object.useTableSchema != null) message.useTableSchema = Boolean(object.useTableSchema); @@ -7915,6 +8619,7 @@ * @property {number} PERMISSION_DENIED=2 PERMISSION_DENIED value * @property {number} NOT_FOUND=3 NOT_FOUND value * @property {number} SCHEMA_MISMATCH=4 SCHEMA_MISMATCH value + * @property {number} IN_TRANSIT_LOCATION_RESTRICTION=5 IN_TRANSIT_LOCATION_RESTRICTION value */ BigQueryConfig.State = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -7923,6 +8628,7 @@ values[valuesById[2] = "PERMISSION_DENIED"] = 2; values[valuesById[3] = "NOT_FOUND"] = 3; values[valuesById[4] = "SCHEMA_MISMATCH"] = 4; + values[valuesById[5] = "IN_TRANSIT_LOCATION_RESTRICTION"] = 5; return values; })(); @@ -8223,6 +8929,7 @@ case 1: case 2: case 3: + case 4: break; } return null; @@ -8293,6 +9000,10 @@ case 3: message.state = 3; break; + case "IN_TRANSIT_LOCATION_RESTRICTION": + case 4: + message.state = 4; + break; } return message; }; @@ -8762,6 +9473,7 @@ * @property {number} ACTIVE=1 ACTIVE value * @property {number} PERMISSION_DENIED=2 PERMISSION_DENIED value * @property {number} NOT_FOUND=3 NOT_FOUND value + * @property {number} IN_TRANSIT_LOCATION_RESTRICTION=4 IN_TRANSIT_LOCATION_RESTRICTION value */ CloudStorageConfig.State = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -8769,6 +9481,7 @@ values[valuesById[1] = "ACTIVE"] = 1; values[valuesById[2] = "PERMISSION_DENIED"] = 2; values[valuesById[3] = "NOT_FOUND"] = 3; + values[valuesById[4] = "IN_TRANSIT_LOCATION_RESTRICTION"] = 4; return values; })(); diff --git a/protos/protos.json b/protos/protos.json index 3cdd783dd..9fecd46b3 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -193,7 +193,17 @@ "allowedPersistenceRegions": { "rule": "repeated", "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enforceInTransit": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -209,15 +219,95 @@ }, "encoding": { "type": "Encoding", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "firstRevisionId": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "lastRevisionId": { "type": "string", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "IngestionDataSourceSettings": { + "oneofs": { + "source": { + "oneof": [ + "awsKinesis" + ] + } + }, + "fields": { + "awsKinesis": { + "type": "AwsKinesis", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AwsKinesis": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "streamArn": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "consumerArn": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "awsRoleArn": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gcpServiceAccount": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "KINESIS_PERMISSION_DENIED": 2, + "PUBLISH_PERMISSION_DENIED": 3, + "STREAM_NOT_FOUND": 4, + "CONSUMER_NOT_FOUND": 5 + } + } + } } } }, @@ -237,27 +327,68 @@ "labels": { "keyType": "string", "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "messageStoragePolicy": { "type": "MessageStoragePolicy", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "kmsKeyName": { "type": "string", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "schemaSettings": { "type": "SchemaSettings", - "id": 6 + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "satisfiesPzs": { "type": "bool", - "id": 7 + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "messageRetentionDuration": { "type": "google.protobuf.Duration", - "id": 8 + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ingestionDataSourceSettings": { + "type": "IngestionDataSourceSettings", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INGESTION_RESOURCE_ERROR": 2 + } } } }, @@ -265,12 +396,18 @@ "fields": { "data": { "type": "bytes", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "attributes": { "keyType": "string", "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "messageId": { "type": "string", @@ -282,7 +419,10 @@ }, "orderingKey": { "type": "string", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -341,7 +481,10 @@ "messageIds": { "rule": "repeated", "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -357,11 +500,17 @@ }, "pageSize": { "type": "int32", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "pageToken": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -370,11 +519,17 @@ "topics": { "rule": "repeated", "type": "Topic", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "nextPageToken": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -390,11 +545,17 @@ }, "pageSize": { "type": "int32", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "pageToken": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -405,12 +566,16 @@ "type": "string", "id": 1, "options": { + "(google.api.field_behavior)": "OPTIONAL", "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" } }, "nextPageToken": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -426,11 +591,17 @@ }, "pageSize": { "type": "int32", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "pageToken": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -439,11 +610,17 @@ "snapshots": { "rule": "repeated", "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "nextPageToken": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -798,60 +975,102 @@ }, "pushConfig": { "type": "PushConfig", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "bigqueryConfig": { "type": "BigQueryConfig", - "id": 18 + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "cloudStorageConfig": { "type": "CloudStorageConfig", - "id": 22 + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "ackDeadlineSeconds": { "type": "int32", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "retainAckedMessages": { "type": "bool", - "id": 7 + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "messageRetentionDuration": { "type": "google.protobuf.Duration", - "id": 8 + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "labels": { "keyType": "string", "type": "string", - "id": 9 + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "enableMessageOrdering": { "type": "bool", - "id": 10 + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "expirationPolicy": { "type": "ExpirationPolicy", - "id": 11 + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "filter": { "type": "string", - "id": 12 + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "deadLetterPolicy": { "type": "DeadLetterPolicy", - "id": 13 + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "retryPolicy": { "type": "RetryPolicy", - "id": 14 + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "detached": { "type": "bool", - "id": 15 + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "enableExactlyOnceDelivery": { "type": "bool", - "id": 16 + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "topicMessageRetentionDuration": { "type": "google.protobuf.Duration", @@ -882,11 +1101,17 @@ "fields": { "minimumBackoff": { "type": "google.protobuf.Duration", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "maximumBackoff": { "type": "google.protobuf.Duration", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -894,11 +1119,17 @@ "fields": { "deadLetterTopic": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "maxDeliveryAttempts": { "type": "int32", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -906,7 +1137,10 @@ "fields": { "ttl": { "type": "google.protobuf.Duration", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -927,24 +1161,39 @@ "fields": { "pushEndpoint": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "attributes": { "keyType": "string", "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "oidcToken": { "type": "OidcToken", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "pubsubWrapper": { "type": "PubsubWrapper", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "noWrapper": { "type": "NoWrapper", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -952,11 +1201,17 @@ "fields": { "serviceAccountEmail": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "audience": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -967,7 +1222,10 @@ "fields": { "writeMetadata": { "type": "bool", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } } @@ -977,7 +1235,10 @@ "fields": { "table": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "useTopicSchema": { "type": "bool", @@ -988,11 +1249,17 @@ }, "writeMetadata": { "type": "bool", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "dropUnknownFields": { "type": "bool", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "state": { "type": "State", @@ -1016,7 +1283,8 @@ "ACTIVE": 1, "PERMISSION_DENIED": 2, "NOT_FOUND": 3, - "SCHEMA_MISMATCH": 4 + "SCHEMA_MISMATCH": 4, + "IN_TRANSIT_LOCATION_RESTRICTION": 5 } } } @@ -1040,27 +1308,45 @@ }, "filenamePrefix": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "filenameSuffix": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "textConfig": { "type": "TextConfig", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "avroConfig": { "type": "AvroConfig", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "maxDuration": { "type": "google.protobuf.Duration", - "id": 6 + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "maxBytes": { "type": "int64", - "id": 7 + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "state": { "type": "State", @@ -1078,7 +1364,10 @@ "fields": { "writeMetadata": { "type": "bool", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1087,7 +1376,8 @@ "STATE_UNSPECIFIED": 0, "ACTIVE": 1, "PERMISSION_DENIED": 2, - "NOT_FOUND": 3 + "NOT_FOUND": 3, + "IN_TRANSIT_LOCATION_RESTRICTION": 4 } } } @@ -1096,15 +1386,24 @@ "fields": { "ackId": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "message": { "type": "PubsubMessage", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "deliveryAttempt": { "type": "int32", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1150,11 +1449,17 @@ }, "pageSize": { "type": "int32", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "pageToken": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1163,11 +1468,17 @@ "subscriptions": { "rule": "repeated", "type": "Subscription", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "nextPageToken": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1234,7 +1545,10 @@ "receivedMessages": { "rule": "repeated", "type": "ReceivedMessage", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1298,17 +1612,26 @@ "ackIds": { "rule": "repeated", "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "modifyDeadlineSeconds": { "rule": "repeated", "type": "int32", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "modifyDeadlineAckIds": { "rule": "repeated", "type": "string", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "streamAckDeadlineSeconds": { "type": "int32", @@ -1319,15 +1642,24 @@ }, "clientId": { "type": "string", - "id": 6 + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "maxOutstandingMessages": { "type": "int64", - "id": 7 + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "maxOutstandingBytes": { "type": "int64", - "id": 8 + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1336,19 +1668,31 @@ "receivedMessages": { "rule": "repeated", "type": "ReceivedMessage", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "acknowledgeConfirmation": { "type": "AcknowledgeConfirmation", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "modifyAckDeadlineConfirmation": { "type": "ModifyAckDeadlineConfirmation", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "subscriptionProperties": { "type": "SubscriptionProperties", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -1357,22 +1701,34 @@ "ackIds": { "rule": "repeated", "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "invalidAckIds": { "rule": "repeated", "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "unorderedAckIds": { "rule": "repeated", "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "temporaryFailedAckIds": { "rule": "repeated", "type": "string", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1381,17 +1737,26 @@ "ackIds": { "rule": "repeated", "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "invalidAckIds": { "rule": "repeated", "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "temporaryFailedAckIds": { "rule": "repeated", "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1399,11 +1764,17 @@ "fields": { "exactlyOnceDeliveryEnabled": { "type": "bool", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "messageOrderingEnabled": { "type": "bool", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } } @@ -1430,7 +1801,10 @@ "labels": { "keyType": "string", "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1460,23 +1834,33 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "topic": { "type": "string", "id": 2, "options": { + "(google.api.field_behavior)": "OPTIONAL", "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" } }, "expireTime": { "type": "google.protobuf.Timestamp", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "labels": { "keyType": "string", "type": "string", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1504,11 +1888,17 @@ }, "pageSize": { "type": "int32", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "pageToken": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1517,11 +1907,17 @@ "snapshots": { "rule": "repeated", "type": "Snapshot", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "nextPageToken": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1557,12 +1953,16 @@ }, "time": { "type": "google.protobuf.Timestamp", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "snapshot": { "type": "string", "id": 3, "options": { + "(google.api.field_behavior)": "OPTIONAL", "(google.api.resource_reference).type": "pubsub.googleapis.com/Snapshot" } } diff --git a/src/v1/publisher_client.ts b/src/v1/publisher_client.ts index 33e4e85db..d08e12139 100644 --- a/src/v1/publisher_client.ts +++ b/src/v1/publisher_client.ts @@ -397,32 +397,38 @@ export class PublisherClient { * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent * signs (`%`). It must be between 3 and 255 characters in length, and it * must not start with `"goog"`. - * @param {number[]} request.labels - * See [Creating and managing labels] + * @param {number[]} [request.labels] + * Optional. See [Creating and managing labels] * (https://cloud.google.com/pubsub/docs/labels). - * @param {google.pubsub.v1.MessageStoragePolicy} request.messageStoragePolicy - * Policy constraining the set of Google Cloud Platform regions where messages - * published to the topic may be stored. If not present, then no constraints - * are in effect. - * @param {string} request.kmsKeyName - * The resource name of the Cloud KMS CryptoKey to be used to protect access - * to messages published on this topic. + * @param {google.pubsub.v1.MessageStoragePolicy} [request.messageStoragePolicy] + * Optional. Policy constraining the set of Google Cloud Platform regions + * where messages published to the topic may be stored. If not present, then + * no constraints are in effect. + * @param {string} [request.kmsKeyName] + * Optional. The resource name of the Cloud KMS CryptoKey to be used to + * protect access to messages published on this topic. * * The expected format is `projects/* /locations/* /keyRings/* /cryptoKeys/*`. - * @param {google.pubsub.v1.SchemaSettings} request.schemaSettings - * Settings for validating messages published against a schema. - * @param {boolean} request.satisfiesPzs - * Reserved for future use. This field is set only in responses from the - * server; it is ignored if it is set in any requests. - * @param {google.protobuf.Duration} request.messageRetentionDuration - * Indicates the minimum duration to retain a message after it is published to - * the topic. If this field is set, messages published to the topic in the - * last `message_retention_duration` are always available to subscribers. For - * instance, it allows any attached subscription to [seek to a + * @param {google.pubsub.v1.SchemaSettings} [request.schemaSettings] + * Optional. Settings for validating messages published against a schema. + * @param {boolean} [request.satisfiesPzs] + * Optional. Reserved for future use. This field is set only in responses from + * the server; it is ignored if it is set in any requests. + * @param {google.protobuf.Duration} [request.messageRetentionDuration] + * Optional. Indicates the minimum duration to retain a message after it is + * published to the topic. If this field is set, messages published to the + * topic in the last `message_retention_duration` are always available to + * subscribers. For instance, it allows any attached subscription to [seek to + * a * timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) * that is up to `message_retention_duration` in the past. If this field is * not set, message retention is controlled by settings on individual * subscriptions. Cannot be more than 31 days or less than 10 minutes. + * @param {google.pubsub.v1.Topic.State} request.state + * Output only. An output-only field indicating the state of the topic. + * @param {google.pubsub.v1.IngestionDataSourceSettings} [request.ingestionDataSourceSettings] + * Optional. Settings for managed ingestion from a data source into this + * topic. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -497,8 +503,8 @@ export class PublisherClient { return this.innerApiCalls.createTopic(request, options, callback); } /** - * Updates an existing topic. Note that certain properties of a - * topic are not modifiable. + * Updates an existing topic by updating the fields specified in the update + * mask. Note that certain properties of a topic are not modifiable. * * @param {Object} request * The request object that will be sent. @@ -926,12 +932,12 @@ export class PublisherClient { * @param {string} request.project * Required. The name of the project in which to list topics. * Format is `projects/{project-id}`. - * @param {number} request.pageSize - * Maximum number of topics to return. - * @param {string} request.pageToken - * The value returned by the last `ListTopicsResponse`; indicates that this is - * a continuation of a prior `ListTopics` call, and that the system should - * return the next page of data. + * @param {number} [request.pageSize] + * Optional. Maximum number of topics to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicsResponse`; indicates + * that this is a continuation of a prior `ListTopics` call, and that the + * system should return the next page of data. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1018,12 +1024,12 @@ export class PublisherClient { * @param {string} request.project * Required. The name of the project in which to list topics. * Format is `projects/{project-id}`. - * @param {number} request.pageSize - * Maximum number of topics to return. - * @param {string} request.pageToken - * The value returned by the last `ListTopicsResponse`; indicates that this is - * a continuation of a prior `ListTopics` call, and that the system should - * return the next page of data. + * @param {number} [request.pageSize] + * Optional. Maximum number of topics to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicsResponse`; indicates + * that this is a continuation of a prior `ListTopics` call, and that the + * system should return the next page of data. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -1066,12 +1072,12 @@ export class PublisherClient { * @param {string} request.project * Required. The name of the project in which to list topics. * Format is `projects/{project-id}`. - * @param {number} request.pageSize - * Maximum number of topics to return. - * @param {string} request.pageToken - * The value returned by the last `ListTopicsResponse`; indicates that this is - * a continuation of a prior `ListTopics` call, and that the system should - * return the next page of data. + * @param {number} [request.pageSize] + * Optional. Maximum number of topics to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicsResponse`; indicates + * that this is a continuation of a prior `ListTopics` call, and that the + * system should return the next page of data. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -1111,12 +1117,12 @@ export class PublisherClient { * @param {string} request.topic * Required. The name of the topic that subscriptions are attached to. * Format is `projects/{project}/topics/{topic}`. - * @param {number} request.pageSize - * Maximum number of subscription names to return. - * @param {string} request.pageToken - * The value returned by the last `ListTopicSubscriptionsResponse`; indicates - * that this is a continuation of a prior `ListTopicSubscriptions` call, and - * that the system should return the next page of data. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscription names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListTopicSubscriptions` + * call, and that the system should return the next page of data. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1215,12 +1221,12 @@ export class PublisherClient { * @param {string} request.topic * Required. The name of the topic that subscriptions are attached to. * Format is `projects/{project}/topics/{topic}`. - * @param {number} request.pageSize - * Maximum number of subscription names to return. - * @param {string} request.pageToken - * The value returned by the last `ListTopicSubscriptionsResponse`; indicates - * that this is a continuation of a prior `ListTopicSubscriptions` call, and - * that the system should return the next page of data. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscription names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListTopicSubscriptions` + * call, and that the system should return the next page of data. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -1263,12 +1269,12 @@ export class PublisherClient { * @param {string} request.topic * Required. The name of the topic that subscriptions are attached to. * Format is `projects/{project}/topics/{topic}`. - * @param {number} request.pageSize - * Maximum number of subscription names to return. - * @param {string} request.pageToken - * The value returned by the last `ListTopicSubscriptionsResponse`; indicates - * that this is a continuation of a prior `ListTopicSubscriptions` call, and - * that the system should return the next page of data. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscription names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListTopicSubscriptions` + * call, and that the system should return the next page of data. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -1312,12 +1318,12 @@ export class PublisherClient { * @param {string} request.topic * Required. The name of the topic that snapshots are attached to. * Format is `projects/{project}/topics/{topic}`. - * @param {number} request.pageSize - * Maximum number of snapshot names to return. - * @param {string} request.pageToken - * The value returned by the last `ListTopicSnapshotsResponse`; indicates - * that this is a continuation of a prior `ListTopicSnapshots` call, and - * that the system should return the next page of data. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshot names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSnapshotsResponse`; + * indicates that this is a continuation of a prior `ListTopicSnapshots` call, + * and that the system should return the next page of data. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1406,12 +1412,12 @@ export class PublisherClient { * @param {string} request.topic * Required. The name of the topic that snapshots are attached to. * Format is `projects/{project}/topics/{topic}`. - * @param {number} request.pageSize - * Maximum number of snapshot names to return. - * @param {string} request.pageToken - * The value returned by the last `ListTopicSnapshotsResponse`; indicates - * that this is a continuation of a prior `ListTopicSnapshots` call, and - * that the system should return the next page of data. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshot names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSnapshotsResponse`; + * indicates that this is a continuation of a prior `ListTopicSnapshots` call, + * and that the system should return the next page of data. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -1454,12 +1460,12 @@ export class PublisherClient { * @param {string} request.topic * Required. The name of the topic that snapshots are attached to. * Format is `projects/{project}/topics/{topic}`. - * @param {number} request.pageSize - * Maximum number of snapshot names to return. - * @param {string} request.pageToken - * The value returned by the last `ListTopicSnapshotsResponse`; indicates - * that this is a continuation of a prior `ListTopicSnapshots` call, and - * that the system should return the next page of data. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshot names to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListTopicSnapshotsResponse`; + * indicates that this is a continuation of a prior `ListTopicSnapshots` call, + * and that the system should return the next page of data. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} diff --git a/src/v1/schema_service_client.ts b/src/v1/schema_service_client.ts index f65bd434f..3e86492ea 100644 --- a/src/v1/schema_service_client.ts +++ b/src/v1/schema_service_client.ts @@ -378,8 +378,8 @@ export class SchemaServiceClient { * The ID to use for the schema, which will become the final component of * the schema's resource name. * - * See https://cloud.google.com/pubsub/docs/admin#resource_names for resource - * name constraints. + * See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for + * resource name constraints. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. diff --git a/src/v1/subscriber_client.ts b/src/v1/subscriber_client.ts index bc0b4fdee..aab6b661a 100644 --- a/src/v1/subscriber_client.ts +++ b/src/v1/subscriber_client.ts @@ -221,7 +221,8 @@ export class SubscriberClient { this.descriptors.stream = { streamingPull: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.BIDI_STREAMING, - !!opts.fallback + !!opts.fallback, + /* gaxStreamingRetries: */ true ), }; @@ -418,21 +419,21 @@ export class SubscriberClient { * Required. The name of the topic from which this subscription is receiving * messages. Format is `projects/{project}/topics/{topic}`. The value of this * field will be `_deleted-topic_` if the topic has been deleted. - * @param {google.pubsub.v1.PushConfig} request.pushConfig - * If push delivery is used with this subscription, this field is - * used to configure it. - * @param {google.pubsub.v1.BigQueryConfig} request.bigqueryConfig - * If delivery to BigQuery is used with this subscription, this field is + * @param {google.pubsub.v1.PushConfig} [request.pushConfig] + * Optional. If push delivery is used with this subscription, this field is * used to configure it. - * @param {google.pubsub.v1.CloudStorageConfig} request.cloudStorageConfig - * If delivery to Google Cloud Storage is used with this subscription, this + * @param {google.pubsub.v1.BigQueryConfig} [request.bigqueryConfig] + * Optional. If delivery to BigQuery is used with this subscription, this * field is used to configure it. - * @param {number} request.ackDeadlineSeconds - * The approximate amount of time (on a best-effort basis) Pub/Sub waits for - * the subscriber to acknowledge receipt before resending the message. In the - * interval after the message is delivered and before it is acknowledged, it - * is considered to be _outstanding_. During that time period, the - * message will not be redelivered (on a best-effort basis). + * @param {google.pubsub.v1.CloudStorageConfig} [request.cloudStorageConfig] + * Optional. If delivery to Google Cloud Storage is used with this + * subscription, this field is used to configure it. + * @param {number} [request.ackDeadlineSeconds] + * Optional. The approximate amount of time (on a best-effort basis) Pub/Sub + * waits for the subscriber to acknowledge receipt before resending the + * message. In the interval after the message is delivered and before it is + * acknowledged, it is considered to be _outstanding_. During that time + * period, the message will not be redelivered (on a best-effort basis). * * For pull subscriptions, this value is used as the initial value for the ack * deadline. To override this value for a given message, call @@ -448,68 +449,68 @@ export class SubscriberClient { * * If the subscriber never acknowledges the message, the Pub/Sub * system will eventually redeliver the message. - * @param {boolean} request.retainAckedMessages - * Indicates whether to retain acknowledged messages. If true, then + * @param {boolean} [request.retainAckedMessages] + * Optional. Indicates whether to retain acknowledged messages. If true, then * messages are not expunged from the subscription's backlog, even if they are * acknowledged, until they fall out of the `message_retention_duration` * window. This must be true if you would like to [`Seek` to a timestamp] * (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in * the past to replay previously-acknowledged messages. - * @param {google.protobuf.Duration} request.messageRetentionDuration - * How long to retain unacknowledged messages in the subscription's backlog, - * from the moment a message is published. - * If `retain_acked_messages` is true, then this also configures the retention - * of acknowledged messages, and thus configures how far back in time a `Seek` - * can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10 - * minutes. - * @param {number[]} request.labels - * See [Creating and managing + * @param {google.protobuf.Duration} [request.messageRetentionDuration] + * Optional. How long to retain unacknowledged messages in the subscription's + * backlog, from the moment a message is published. If `retain_acked_messages` + * is true, then this also configures the retention of acknowledged messages, + * and thus configures how far back in time a `Seek` can be done. Defaults to + * 7 days. Cannot be more than 7 days or less than 10 minutes. + * @param {number[]} [request.labels] + * Optional. See [Creating and managing * labels](https://cloud.google.com/pubsub/docs/labels). - * @param {boolean} request.enableMessageOrdering - * If true, messages published with the same `ordering_key` in `PubsubMessage` - * will be delivered to the subscribers in the order in which they - * are received by the Pub/Sub system. Otherwise, they may be delivered in - * any order. - * @param {google.pubsub.v1.ExpirationPolicy} request.expirationPolicy - * A policy that specifies the conditions for this subscription's expiration. - * A subscription is considered active as long as any connected subscriber is - * successfully consuming messages from the subscription or is issuing - * operations on the subscription. If `expiration_policy` is not set, a - * *default policy* with `ttl` of 31 days will be used. The minimum allowed + * @param {boolean} [request.enableMessageOrdering] + * Optional. If true, messages published with the same `ordering_key` in + * `PubsubMessage` will be delivered to the subscribers in the order in which + * they are received by the Pub/Sub system. Otherwise, they may be delivered + * in any order. + * @param {google.pubsub.v1.ExpirationPolicy} [request.expirationPolicy] + * Optional. A policy that specifies the conditions for this subscription's + * expiration. A subscription is considered active as long as any connected + * subscriber is successfully consuming messages from the subscription or is + * issuing operations on the subscription. If `expiration_policy` is not set, + * a *default policy* with `ttl` of 31 days will be used. The minimum allowed * value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, * but `expiration_policy.ttl` is not set, the subscription never expires. - * @param {string} request.filter - * An expression written in the Pub/Sub [filter + * @param {string} [request.filter] + * Optional. An expression written in the Pub/Sub [filter * language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, * then only `PubsubMessage`s whose `attributes` field matches the filter are * delivered on this subscription. If empty, then no messages are filtered * out. - * @param {google.pubsub.v1.DeadLetterPolicy} request.deadLetterPolicy - * A policy that specifies the conditions for dead lettering messages in - * this subscription. If dead_letter_policy is not set, dead lettering - * is disabled. + * @param {google.pubsub.v1.DeadLetterPolicy} [request.deadLetterPolicy] + * Optional. A policy that specifies the conditions for dead lettering + * messages in this subscription. If dead_letter_policy is not set, dead + * lettering is disabled. * - * The Cloud Pub/Sub service account associated with this subscriptions's + * The Pub/Sub service account associated with this subscriptions's * parent project (i.e., * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have * permission to Acknowledge() messages on this subscription. - * @param {google.pubsub.v1.RetryPolicy} request.retryPolicy - * A policy that specifies how Pub/Sub retries message delivery for this - * subscription. + * @param {google.pubsub.v1.RetryPolicy} [request.retryPolicy] + * Optional. A policy that specifies how Pub/Sub retries message delivery for + * this subscription. * * If not set, the default retry policy is applied. This generally implies * that messages will be retried as soon as possible for healthy subscribers. * RetryPolicy will be triggered on NACKs or acknowledgement deadline * exceeded events for a given message. - * @param {boolean} request.detached - * Indicates whether the subscription is detached from its topic. Detached - * subscriptions don't receive messages from their topic and don't retain any - * backlog. `Pull` and `StreamingPull` requests will return + * @param {boolean} [request.detached] + * Optional. Indicates whether the subscription is detached from its topic. + * Detached subscriptions don't receive messages from their topic and don't + * retain any backlog. `Pull` and `StreamingPull` requests will return * FAILED_PRECONDITION. If the subscription is a push subscription, pushes to * the endpoint will not be made. - * @param {boolean} request.enableExactlyOnceDelivery - * If true, Pub/Sub provides the following guarantees for the delivery of - * a message with a given value of `message_id` on this subscription: + * @param {boolean} [request.enableExactlyOnceDelivery] + * Optional. If true, Pub/Sub provides the following guarantees for the + * delivery of a message with a given value of `message_id` on this + * subscription: * * * The message sent to a subscriber is guaranteed not to be resent * before the message's acknowledgement deadline expires. @@ -684,8 +685,9 @@ export class SubscriberClient { return this.innerApiCalls.getSubscription(request, options, callback); } /** - * Updates an existing subscription. Note that certain properties of a - * subscription, such as its topic, are not modifiable. + * Updates an existing subscription by updating the fields specified in the + * update mask. Note that certain properties of a subscription, such as its + * topic, are not modifiable. * * @param {Object} request * The request object that will be sent. @@ -874,7 +876,8 @@ export class SubscriberClient { * delivery to another subscriber client. This typically results in an * increase in the rate of message redeliveries (that is, duplicates). * The minimum deadline you can specify is 0 seconds. - * The maximum deadline you can specify is 600 seconds (10 minutes). + * The maximum deadline you can specify in a single request is 600 seconds + * (10 minutes). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1347,8 +1350,8 @@ export class SubscriberClient { * (b) Any messages published to the subscription's topic following the * successful completion of the CreateSnapshot request. * Format is `projects/{project}/subscriptions/{sub}`. - * @param {number[]} request.labels - * See [Creating and managing + * @param {number[]} [request.labels] + * Optional. See [Creating and managing * labels](https://cloud.google.com/pubsub/docs/labels). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -1424,7 +1427,8 @@ export class SubscriberClient { return this.innerApiCalls.createSnapshot(request, options, callback); } /** - * Updates an existing snapshot. Snapshots are used in + * Updates an existing snapshot by updating the fields specified in the update + * mask. Snapshots are used in * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, * which allow you to manage message acknowledgments in bulk. That is, you can * set the acknowledgment state of messages in an existing subscription to the @@ -1612,8 +1616,8 @@ export class SubscriberClient { * The request object that will be sent. * @param {string} request.subscription * Required. The subscription to affect. - * @param {google.protobuf.Timestamp} request.time - * The time to seek to. + * @param {google.protobuf.Timestamp} [request.time] + * Optional. The time to seek to. * Messages retained in the subscription that were published before this * time are marked as acknowledged, and messages retained in the * subscription that were published after this time are marked as @@ -1624,10 +1628,10 @@ export class SubscriberClient { * window (or to a point before the system's notion of the subscription * creation time), only retained messages will be marked as unacknowledged, * and already-expunged messages will not be restored. - * @param {string} request.snapshot - * The snapshot to seek to. The snapshot's topic must be the same as that of - * the provided subscription. - * Format is `projects/{project}/snapshots/{snap}`. + * @param {string} [request.snapshot] + * Optional. The snapshot to seek to. The snapshot's topic must be the same + * as that of the provided subscription. Format is + * `projects/{project}/snapshots/{snap}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1733,12 +1737,12 @@ export class SubscriberClient { * @param {string} request.project * Required. The name of the project in which to list subscriptions. * Format is `projects/{project-id}`. - * @param {number} request.pageSize - * Maximum number of subscriptions to return. - * @param {string} request.pageToken - * The value returned by the last `ListSubscriptionsResponse`; indicates that - * this is a continuation of a prior `ListSubscriptions` call, and that the - * system should return the next page of data. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscriptions to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListSubscriptions` call, + * and that the system should return the next page of data. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1825,12 +1829,12 @@ export class SubscriberClient { * @param {string} request.project * Required. The name of the project in which to list subscriptions. * Format is `projects/{project-id}`. - * @param {number} request.pageSize - * Maximum number of subscriptions to return. - * @param {string} request.pageToken - * The value returned by the last `ListSubscriptionsResponse`; indicates that - * this is a continuation of a prior `ListSubscriptions` call, and that the - * system should return the next page of data. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscriptions to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListSubscriptions` call, + * and that the system should return the next page of data. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -1873,12 +1877,12 @@ export class SubscriberClient { * @param {string} request.project * Required. The name of the project in which to list subscriptions. * Format is `projects/{project-id}`. - * @param {number} request.pageSize - * Maximum number of subscriptions to return. - * @param {string} request.pageToken - * The value returned by the last `ListSubscriptionsResponse`; indicates that - * this is a continuation of a prior `ListSubscriptions` call, and that the - * system should return the next page of data. + * @param {number} [request.pageSize] + * Optional. Maximum number of subscriptions to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSubscriptionsResponse`; + * indicates that this is a continuation of a prior `ListSubscriptions` call, + * and that the system should return the next page of data. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -1922,12 +1926,12 @@ export class SubscriberClient { * @param {string} request.project * Required. The name of the project in which to list snapshots. * Format is `projects/{project-id}`. - * @param {number} request.pageSize - * Maximum number of snapshots to return. - * @param {string} request.pageToken - * The value returned by the last `ListSnapshotsResponse`; indicates that this - * is a continuation of a prior `ListSnapshots` call, and that the system - * should return the next page of data. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshots to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSnapshotsResponse`; indicates + * that this is a continuation of a prior `ListSnapshots` call, and that the + * system should return the next page of data. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2014,12 +2018,12 @@ export class SubscriberClient { * @param {string} request.project * Required. The name of the project in which to list snapshots. * Format is `projects/{project-id}`. - * @param {number} request.pageSize - * Maximum number of snapshots to return. - * @param {string} request.pageToken - * The value returned by the last `ListSnapshotsResponse`; indicates that this - * is a continuation of a prior `ListSnapshots` call, and that the system - * should return the next page of data. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshots to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSnapshotsResponse`; indicates + * that this is a continuation of a prior `ListSnapshots` call, and that the + * system should return the next page of data. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -2062,12 +2066,12 @@ export class SubscriberClient { * @param {string} request.project * Required. The name of the project in which to list snapshots. * Format is `projects/{project-id}`. - * @param {number} request.pageSize - * Maximum number of snapshots to return. - * @param {string} request.pageToken - * The value returned by the last `ListSnapshotsResponse`; indicates that this - * is a continuation of a prior `ListSnapshots` call, and that the system - * should return the next page of data. + * @param {number} [request.pageSize] + * Optional. Maximum number of snapshots to return. + * @param {string} [request.pageToken] + * Optional. The value returned by the last `ListSnapshotsResponse`; indicates + * that this is a continuation of a prior `ListSnapshots` call, and that the + * system should return the next page of data. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object}