xref: /aosp_15_r20/external/googleapis/google/pubsub/v1/pubsub.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1*d5c09012SAndroid Build Coastguard Worker// Copyright 2023 Google LLC
2*d5c09012SAndroid Build Coastguard Worker//
3*d5c09012SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License");
4*d5c09012SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License.
5*d5c09012SAndroid Build Coastguard Worker// You may obtain a copy of the License at
6*d5c09012SAndroid Build Coastguard Worker//
7*d5c09012SAndroid Build Coastguard Worker//     http://www.apache.org/licenses/LICENSE-2.0
8*d5c09012SAndroid Build Coastguard Worker//
9*d5c09012SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software
10*d5c09012SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS,
11*d5c09012SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*d5c09012SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and
13*d5c09012SAndroid Build Coastguard Worker// limitations under the License.
14*d5c09012SAndroid Build Coastguard Worker
15*d5c09012SAndroid Build Coastguard Workersyntax = "proto3";
16*d5c09012SAndroid Build Coastguard Worker
17*d5c09012SAndroid Build Coastguard Workerpackage google.pubsub.v1;
18*d5c09012SAndroid Build Coastguard Worker
19*d5c09012SAndroid Build Coastguard Workerimport "google/api/annotations.proto";
20*d5c09012SAndroid Build Coastguard Workerimport "google/api/client.proto";
21*d5c09012SAndroid Build Coastguard Workerimport "google/api/field_behavior.proto";
22*d5c09012SAndroid Build Coastguard Workerimport "google/api/resource.proto";
23*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/duration.proto";
24*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/empty.proto";
25*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/field_mask.proto";
26*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/timestamp.proto";
27*d5c09012SAndroid Build Coastguard Workerimport "google/pubsub/v1/schema.proto";
28*d5c09012SAndroid Build Coastguard Worker
29*d5c09012SAndroid Build Coastguard Workeroption cc_enable_arenas = true;
30*d5c09012SAndroid Build Coastguard Workeroption csharp_namespace = "Google.Cloud.PubSub.V1";
31*d5c09012SAndroid Build Coastguard Workeroption go_package = "cloud.google.com/go/pubsub/apiv1/pubsubpb;pubsubpb";
32*d5c09012SAndroid Build Coastguard Workeroption java_multiple_files = true;
33*d5c09012SAndroid Build Coastguard Workeroption java_outer_classname = "PubsubProto";
34*d5c09012SAndroid Build Coastguard Workeroption java_package = "com.google.pubsub.v1";
35*d5c09012SAndroid Build Coastguard Workeroption php_namespace = "Google\\Cloud\\PubSub\\V1";
36*d5c09012SAndroid Build Coastguard Workeroption ruby_package = "Google::Cloud::PubSub::V1";
37*d5c09012SAndroid Build Coastguard Worker
38*d5c09012SAndroid Build Coastguard Worker// The service that an application uses to manipulate topics, and to send
39*d5c09012SAndroid Build Coastguard Worker// messages to a topic.
40*d5c09012SAndroid Build Coastguard Workerservice Publisher {
41*d5c09012SAndroid Build Coastguard Worker  option (google.api.default_host) = "pubsub.googleapis.com";
42*d5c09012SAndroid Build Coastguard Worker  option (google.api.oauth_scopes) =
43*d5c09012SAndroid Build Coastguard Worker      "https://www.googleapis.com/auth/cloud-platform,"
44*d5c09012SAndroid Build Coastguard Worker      "https://www.googleapis.com/auth/pubsub";
45*d5c09012SAndroid Build Coastguard Worker
46*d5c09012SAndroid Build Coastguard Worker  // Creates the given topic with the given name. See the [resource name rules]
47*d5c09012SAndroid Build Coastguard Worker  // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
48*d5c09012SAndroid Build Coastguard Worker  rpc CreateTopic(Topic) returns (Topic) {
49*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
50*d5c09012SAndroid Build Coastguard Worker      put: "/v1/{name=projects/*/topics/*}"
51*d5c09012SAndroid Build Coastguard Worker      body: "*"
52*d5c09012SAndroid Build Coastguard Worker    };
53*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "name";
54*d5c09012SAndroid Build Coastguard Worker  }
55*d5c09012SAndroid Build Coastguard Worker
56*d5c09012SAndroid Build Coastguard Worker  // Updates an existing topic by updating the fields specified in the update
57*d5c09012SAndroid Build Coastguard Worker  // mask. Note that certain properties of a topic are not modifiable.
58*d5c09012SAndroid Build Coastguard Worker  rpc UpdateTopic(UpdateTopicRequest) returns (Topic) {
59*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
60*d5c09012SAndroid Build Coastguard Worker      patch: "/v1/{topic.name=projects/*/topics/*}"
61*d5c09012SAndroid Build Coastguard Worker      body: "*"
62*d5c09012SAndroid Build Coastguard Worker    };
63*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "topic,update_mask";
64*d5c09012SAndroid Build Coastguard Worker  }
65*d5c09012SAndroid Build Coastguard Worker
66*d5c09012SAndroid Build Coastguard Worker  // Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
67*d5c09012SAndroid Build Coastguard Worker  // does not exist.
68*d5c09012SAndroid Build Coastguard Worker  rpc Publish(PublishRequest) returns (PublishResponse) {
69*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
70*d5c09012SAndroid Build Coastguard Worker      post: "/v1/{topic=projects/*/topics/*}:publish"
71*d5c09012SAndroid Build Coastguard Worker      body: "*"
72*d5c09012SAndroid Build Coastguard Worker    };
73*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "topic,messages";
74*d5c09012SAndroid Build Coastguard Worker  }
75*d5c09012SAndroid Build Coastguard Worker
76*d5c09012SAndroid Build Coastguard Worker  // Gets the configuration of a topic.
77*d5c09012SAndroid Build Coastguard Worker  rpc GetTopic(GetTopicRequest) returns (Topic) {
78*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
79*d5c09012SAndroid Build Coastguard Worker      get: "/v1/{topic=projects/*/topics/*}"
80*d5c09012SAndroid Build Coastguard Worker    };
81*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "topic";
82*d5c09012SAndroid Build Coastguard Worker  }
83*d5c09012SAndroid Build Coastguard Worker
84*d5c09012SAndroid Build Coastguard Worker  // Lists matching topics.
85*d5c09012SAndroid Build Coastguard Worker  rpc ListTopics(ListTopicsRequest) returns (ListTopicsResponse) {
86*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
87*d5c09012SAndroid Build Coastguard Worker      get: "/v1/{project=projects/*}/topics"
88*d5c09012SAndroid Build Coastguard Worker    };
89*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "project";
90*d5c09012SAndroid Build Coastguard Worker  }
91*d5c09012SAndroid Build Coastguard Worker
92*d5c09012SAndroid Build Coastguard Worker  // Lists the names of the attached subscriptions on this topic.
93*d5c09012SAndroid Build Coastguard Worker  rpc ListTopicSubscriptions(ListTopicSubscriptionsRequest)
94*d5c09012SAndroid Build Coastguard Worker      returns (ListTopicSubscriptionsResponse) {
95*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
96*d5c09012SAndroid Build Coastguard Worker      get: "/v1/{topic=projects/*/topics/*}/subscriptions"
97*d5c09012SAndroid Build Coastguard Worker    };
98*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "topic";
99*d5c09012SAndroid Build Coastguard Worker  }
100*d5c09012SAndroid Build Coastguard Worker
101*d5c09012SAndroid Build Coastguard Worker  // Lists the names of the snapshots on this topic. Snapshots are used in
102*d5c09012SAndroid Build Coastguard Worker  // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
103*d5c09012SAndroid Build Coastguard Worker  // which allow you to manage message acknowledgments in bulk. That is, you can
104*d5c09012SAndroid Build Coastguard Worker  // set the acknowledgment state of messages in an existing subscription to the
105*d5c09012SAndroid Build Coastguard Worker  // state captured by a snapshot.
106*d5c09012SAndroid Build Coastguard Worker  rpc ListTopicSnapshots(ListTopicSnapshotsRequest)
107*d5c09012SAndroid Build Coastguard Worker      returns (ListTopicSnapshotsResponse) {
108*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
109*d5c09012SAndroid Build Coastguard Worker      get: "/v1/{topic=projects/*/topics/*}/snapshots"
110*d5c09012SAndroid Build Coastguard Worker    };
111*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "topic";
112*d5c09012SAndroid Build Coastguard Worker  }
113*d5c09012SAndroid Build Coastguard Worker
114*d5c09012SAndroid Build Coastguard Worker  // Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
115*d5c09012SAndroid Build Coastguard Worker  // does not exist. After a topic is deleted, a new topic may be created with
116*d5c09012SAndroid Build Coastguard Worker  // the same name; this is an entirely new topic with none of the old
117*d5c09012SAndroid Build Coastguard Worker  // configuration or subscriptions. Existing subscriptions to this topic are
118*d5c09012SAndroid Build Coastguard Worker  // not deleted, but their `topic` field is set to `_deleted-topic_`.
119*d5c09012SAndroid Build Coastguard Worker  rpc DeleteTopic(DeleteTopicRequest) returns (google.protobuf.Empty) {
120*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
121*d5c09012SAndroid Build Coastguard Worker      delete: "/v1/{topic=projects/*/topics/*}"
122*d5c09012SAndroid Build Coastguard Worker    };
123*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "topic";
124*d5c09012SAndroid Build Coastguard Worker  }
125*d5c09012SAndroid Build Coastguard Worker
126*d5c09012SAndroid Build Coastguard Worker  // Detaches a subscription from this topic. All messages retained in the
127*d5c09012SAndroid Build Coastguard Worker  // subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
128*d5c09012SAndroid Build Coastguard Worker  // will return FAILED_PRECONDITION. If the subscription is a push
129*d5c09012SAndroid Build Coastguard Worker  // subscription, pushes to the endpoint will stop.
130*d5c09012SAndroid Build Coastguard Worker  rpc DetachSubscription(DetachSubscriptionRequest)
131*d5c09012SAndroid Build Coastguard Worker      returns (DetachSubscriptionResponse) {
132*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
133*d5c09012SAndroid Build Coastguard Worker      post: "/v1/{subscription=projects/*/subscriptions/*}:detach"
134*d5c09012SAndroid Build Coastguard Worker    };
135*d5c09012SAndroid Build Coastguard Worker  }
136*d5c09012SAndroid Build Coastguard Worker}
137*d5c09012SAndroid Build Coastguard Worker
138*d5c09012SAndroid Build Coastguard Worker// A policy constraining the storage of messages published to the topic.
139*d5c09012SAndroid Build Coastguard Workermessage MessageStoragePolicy {
140*d5c09012SAndroid Build Coastguard Worker  // Optional. A list of IDs of Google Cloud regions where messages that are
141*d5c09012SAndroid Build Coastguard Worker  // published to the topic may be persisted in storage. Messages published by
142*d5c09012SAndroid Build Coastguard Worker  // publishers running in non-allowed Google Cloud regions (or running outside
143*d5c09012SAndroid Build Coastguard Worker  // of Google Cloud altogether) are routed for storage in one of the allowed
144*d5c09012SAndroid Build Coastguard Worker  // regions. An empty list means that no regions are allowed, and is not a
145*d5c09012SAndroid Build Coastguard Worker  // valid configuration.
146*d5c09012SAndroid Build Coastguard Worker  repeated string allowed_persistence_regions = 1
147*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
148*d5c09012SAndroid Build Coastguard Worker
149*d5c09012SAndroid Build Coastguard Worker  // Optional. If true, `allowed_persistence_regions` is also used to enforce
150*d5c09012SAndroid Build Coastguard Worker  // in-transit guarantees for messages. That is, Pub/Sub will fail
151*d5c09012SAndroid Build Coastguard Worker  // Publish operations on this topic and subscribe operations
152*d5c09012SAndroid Build Coastguard Worker  // on any subscription attached to this topic in any region that is
153*d5c09012SAndroid Build Coastguard Worker  // not in `allowed_persistence_regions`.
154*d5c09012SAndroid Build Coastguard Worker  bool enforce_in_transit = 2 [(google.api.field_behavior) = OPTIONAL];
155*d5c09012SAndroid Build Coastguard Worker}
156*d5c09012SAndroid Build Coastguard Worker
157*d5c09012SAndroid Build Coastguard Worker// Settings for validating messages published against a schema.
158*d5c09012SAndroid Build Coastguard Workermessage SchemaSettings {
159*d5c09012SAndroid Build Coastguard Worker  // Required. The name of the schema that messages published should be
160*d5c09012SAndroid Build Coastguard Worker  // validated against. Format is `projects/{project}/schemas/{schema}`. The
161*d5c09012SAndroid Build Coastguard Worker  // value of this field will be `_deleted-schema_` if the schema has been
162*d5c09012SAndroid Build Coastguard Worker  // deleted.
163*d5c09012SAndroid Build Coastguard Worker  string schema = 1 [
164*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
165*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" }
166*d5c09012SAndroid Build Coastguard Worker  ];
167*d5c09012SAndroid Build Coastguard Worker
168*d5c09012SAndroid Build Coastguard Worker  // Optional. The encoding of messages validated against `schema`.
169*d5c09012SAndroid Build Coastguard Worker  Encoding encoding = 2 [(google.api.field_behavior) = OPTIONAL];
170*d5c09012SAndroid Build Coastguard Worker
171*d5c09012SAndroid Build Coastguard Worker  // Optional. The minimum (inclusive) revision allowed for validating messages.
172*d5c09012SAndroid Build Coastguard Worker  // If empty or not present, allow any revision to be validated against
173*d5c09012SAndroid Build Coastguard Worker  // last_revision or any revision created before.
174*d5c09012SAndroid Build Coastguard Worker  string first_revision_id = 3 [(google.api.field_behavior) = OPTIONAL];
175*d5c09012SAndroid Build Coastguard Worker
176*d5c09012SAndroid Build Coastguard Worker  // Optional. The maximum (inclusive) revision allowed for validating messages.
177*d5c09012SAndroid Build Coastguard Worker  // If empty or not present, allow any revision to be validated against
178*d5c09012SAndroid Build Coastguard Worker  // first_revision or any revision created after.
179*d5c09012SAndroid Build Coastguard Worker  string last_revision_id = 4 [(google.api.field_behavior) = OPTIONAL];
180*d5c09012SAndroid Build Coastguard Worker}
181*d5c09012SAndroid Build Coastguard Worker
182*d5c09012SAndroid Build Coastguard Worker// Settings for an ingestion data source on a topic.
183*d5c09012SAndroid Build Coastguard Workermessage IngestionDataSourceSettings {
184*d5c09012SAndroid Build Coastguard Worker  // Ingestion settings for Amazon Kinesis Data Streams.
185*d5c09012SAndroid Build Coastguard Worker  message AwsKinesis {
186*d5c09012SAndroid Build Coastguard Worker    // Possible states for ingestion from Amazon Kinesis Data Streams.
187*d5c09012SAndroid Build Coastguard Worker    enum State {
188*d5c09012SAndroid Build Coastguard Worker      // Default value. This value is unused.
189*d5c09012SAndroid Build Coastguard Worker      STATE_UNSPECIFIED = 0;
190*d5c09012SAndroid Build Coastguard Worker
191*d5c09012SAndroid Build Coastguard Worker      // Ingestion is active.
192*d5c09012SAndroid Build Coastguard Worker      ACTIVE = 1;
193*d5c09012SAndroid Build Coastguard Worker
194*d5c09012SAndroid Build Coastguard Worker      // Permission denied encountered while consuming data from Kinesis.
195*d5c09012SAndroid Build Coastguard Worker      // This can happen if:
196*d5c09012SAndroid Build Coastguard Worker      //   - The provided `aws_role_arn` does not exist or does not have the
197*d5c09012SAndroid Build Coastguard Worker      //     appropriate permissions attached.
198*d5c09012SAndroid Build Coastguard Worker      //   - The provided `aws_role_arn` is not set up properly for Identity
199*d5c09012SAndroid Build Coastguard Worker      //     Federation using `gcp_service_account`.
200*d5c09012SAndroid Build Coastguard Worker      //   - The Pub/Sub SA is not granted the
201*d5c09012SAndroid Build Coastguard Worker      //     `iam.serviceAccounts.getOpenIdToken` permission on
202*d5c09012SAndroid Build Coastguard Worker      //     `gcp_service_account`.
203*d5c09012SAndroid Build Coastguard Worker      KINESIS_PERMISSION_DENIED = 2;
204*d5c09012SAndroid Build Coastguard Worker
205*d5c09012SAndroid Build Coastguard Worker      // Permission denied encountered while publishing to the topic. This can
206*d5c09012SAndroid Build Coastguard Worker      // happen if the Pub/Sub SA has not been granted the [appropriate publish
207*d5c09012SAndroid Build Coastguard Worker      // permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher)
208*d5c09012SAndroid Build Coastguard Worker      PUBLISH_PERMISSION_DENIED = 3;
209*d5c09012SAndroid Build Coastguard Worker
210*d5c09012SAndroid Build Coastguard Worker      // The Kinesis stream does not exist.
211*d5c09012SAndroid Build Coastguard Worker      STREAM_NOT_FOUND = 4;
212*d5c09012SAndroid Build Coastguard Worker
213*d5c09012SAndroid Build Coastguard Worker      // The Kinesis consumer does not exist.
214*d5c09012SAndroid Build Coastguard Worker      CONSUMER_NOT_FOUND = 5;
215*d5c09012SAndroid Build Coastguard Worker    }
216*d5c09012SAndroid Build Coastguard Worker
217*d5c09012SAndroid Build Coastguard Worker    // Output only. An output-only field that indicates the state of the Kinesis
218*d5c09012SAndroid Build Coastguard Worker    // ingestion source.
219*d5c09012SAndroid Build Coastguard Worker    State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
220*d5c09012SAndroid Build Coastguard Worker
221*d5c09012SAndroid Build Coastguard Worker    // Required. The Kinesis stream ARN to ingest data from.
222*d5c09012SAndroid Build Coastguard Worker    string stream_arn = 2 [(google.api.field_behavior) = REQUIRED];
223*d5c09012SAndroid Build Coastguard Worker
224*d5c09012SAndroid Build Coastguard Worker    // Required. The Kinesis consumer ARN to used for ingestion in Enhanced
225*d5c09012SAndroid Build Coastguard Worker    // Fan-Out mode. The consumer must be already created and ready to be used.
226*d5c09012SAndroid Build Coastguard Worker    string consumer_arn = 3 [(google.api.field_behavior) = REQUIRED];
227*d5c09012SAndroid Build Coastguard Worker
228*d5c09012SAndroid Build Coastguard Worker    // Required. AWS role ARN to be used for Federated Identity authentication
229*d5c09012SAndroid Build Coastguard Worker    // with Kinesis. Check the Pub/Sub docs for how to set up this role and the
230*d5c09012SAndroid Build Coastguard Worker    // required permissions that need to be attached to it.
231*d5c09012SAndroid Build Coastguard Worker    string aws_role_arn = 4 [(google.api.field_behavior) = REQUIRED];
232*d5c09012SAndroid Build Coastguard Worker
233*d5c09012SAndroid Build Coastguard Worker    // Required. The GCP service account to be used for Federated Identity
234*d5c09012SAndroid Build Coastguard Worker    // authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for
235*d5c09012SAndroid Build Coastguard Worker    // the provided role). The `aws_role_arn` must be set up with
236*d5c09012SAndroid Build Coastguard Worker    // `accounts.google.com:sub` equals to this service account number.
237*d5c09012SAndroid Build Coastguard Worker    string gcp_service_account = 5 [(google.api.field_behavior) = REQUIRED];
238*d5c09012SAndroid Build Coastguard Worker  }
239*d5c09012SAndroid Build Coastguard Worker
240*d5c09012SAndroid Build Coastguard Worker  // Only one source type can have settings set.
241*d5c09012SAndroid Build Coastguard Worker  oneof source {
242*d5c09012SAndroid Build Coastguard Worker    // Optional. Amazon Kinesis Data Streams.
243*d5c09012SAndroid Build Coastguard Worker    AwsKinesis aws_kinesis = 1 [(google.api.field_behavior) = OPTIONAL];
244*d5c09012SAndroid Build Coastguard Worker  }
245*d5c09012SAndroid Build Coastguard Worker}
246*d5c09012SAndroid Build Coastguard Worker
247*d5c09012SAndroid Build Coastguard Worker// A topic resource.
248*d5c09012SAndroid Build Coastguard Workermessage Topic {
249*d5c09012SAndroid Build Coastguard Worker  option (google.api.resource) = {
250*d5c09012SAndroid Build Coastguard Worker    type: "pubsub.googleapis.com/Topic"
251*d5c09012SAndroid Build Coastguard Worker    pattern: "projects/{project}/topics/{topic}"
252*d5c09012SAndroid Build Coastguard Worker    pattern: "_deleted-topic_"
253*d5c09012SAndroid Build Coastguard Worker  };
254*d5c09012SAndroid Build Coastguard Worker
255*d5c09012SAndroid Build Coastguard Worker  // The state of the topic.
256*d5c09012SAndroid Build Coastguard Worker  enum State {
257*d5c09012SAndroid Build Coastguard Worker    // Default value. This value is unused.
258*d5c09012SAndroid Build Coastguard Worker    STATE_UNSPECIFIED = 0;
259*d5c09012SAndroid Build Coastguard Worker
260*d5c09012SAndroid Build Coastguard Worker    // The topic does not have any persistent errors.
261*d5c09012SAndroid Build Coastguard Worker    ACTIVE = 1;
262*d5c09012SAndroid Build Coastguard Worker
263*d5c09012SAndroid Build Coastguard Worker    // Ingestion from the data source has encountered a permanent error.
264*d5c09012SAndroid Build Coastguard Worker    // See the more detailed error state in the corresponding ingestion
265*d5c09012SAndroid Build Coastguard Worker    // source configuration.
266*d5c09012SAndroid Build Coastguard Worker    INGESTION_RESOURCE_ERROR = 2;
267*d5c09012SAndroid Build Coastguard Worker  }
268*d5c09012SAndroid Build Coastguard Worker
269*d5c09012SAndroid Build Coastguard Worker  // Required. The name of the topic. It must have the format
270*d5c09012SAndroid Build Coastguard Worker  // `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
271*d5c09012SAndroid Build Coastguard Worker  // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
272*d5c09012SAndroid Build Coastguard Worker  // underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
273*d5c09012SAndroid Build Coastguard Worker  // signs (`%`). It must be between 3 and 255 characters in length, and it
274*d5c09012SAndroid Build Coastguard Worker  // must not start with `"goog"`.
275*d5c09012SAndroid Build Coastguard Worker  string name = 1 [(google.api.field_behavior) = REQUIRED];
276*d5c09012SAndroid Build Coastguard Worker
277*d5c09012SAndroid Build Coastguard Worker  // Optional. See [Creating and managing labels]
278*d5c09012SAndroid Build Coastguard Worker  // (https://cloud.google.com/pubsub/docs/labels).
279*d5c09012SAndroid Build Coastguard Worker  map<string, string> labels = 2 [(google.api.field_behavior) = OPTIONAL];
280*d5c09012SAndroid Build Coastguard Worker
281*d5c09012SAndroid Build Coastguard Worker  // Optional. Policy constraining the set of Google Cloud Platform regions
282*d5c09012SAndroid Build Coastguard Worker  // where messages published to the topic may be stored. If not present, then
283*d5c09012SAndroid Build Coastguard Worker  // no constraints are in effect.
284*d5c09012SAndroid Build Coastguard Worker  MessageStoragePolicy message_storage_policy = 3
285*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
286*d5c09012SAndroid Build Coastguard Worker
287*d5c09012SAndroid Build Coastguard Worker  // Optional. The resource name of the Cloud KMS CryptoKey to be used to
288*d5c09012SAndroid Build Coastguard Worker  // protect access to messages published on this topic.
289*d5c09012SAndroid Build Coastguard Worker  //
290*d5c09012SAndroid Build Coastguard Worker  // The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
291*d5c09012SAndroid Build Coastguard Worker  string kms_key_name = 5 [(google.api.field_behavior) = OPTIONAL];
292*d5c09012SAndroid Build Coastguard Worker
293*d5c09012SAndroid Build Coastguard Worker  // Optional. Settings for validating messages published against a schema.
294*d5c09012SAndroid Build Coastguard Worker  SchemaSettings schema_settings = 6 [(google.api.field_behavior) = OPTIONAL];
295*d5c09012SAndroid Build Coastguard Worker
296*d5c09012SAndroid Build Coastguard Worker  // Optional. Reserved for future use. This field is set only in responses from
297*d5c09012SAndroid Build Coastguard Worker  // the server; it is ignored if it is set in any requests.
298*d5c09012SAndroid Build Coastguard Worker  bool satisfies_pzs = 7 [(google.api.field_behavior) = OPTIONAL];
299*d5c09012SAndroid Build Coastguard Worker
300*d5c09012SAndroid Build Coastguard Worker  // Optional. Indicates the minimum duration to retain a message after it is
301*d5c09012SAndroid Build Coastguard Worker  // published to the topic. If this field is set, messages published to the
302*d5c09012SAndroid Build Coastguard Worker  // topic in the last `message_retention_duration` are always available to
303*d5c09012SAndroid Build Coastguard Worker  // subscribers. For instance, it allows any attached subscription to [seek to
304*d5c09012SAndroid Build Coastguard Worker  // a
305*d5c09012SAndroid Build Coastguard Worker  // timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time)
306*d5c09012SAndroid Build Coastguard Worker  // that is up to `message_retention_duration` in the past. If this field is
307*d5c09012SAndroid Build Coastguard Worker  // not set, message retention is controlled by settings on individual
308*d5c09012SAndroid Build Coastguard Worker  // subscriptions. Cannot be more than 31 days or less than 10 minutes.
309*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Duration message_retention_duration = 8
310*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
311*d5c09012SAndroid Build Coastguard Worker
312*d5c09012SAndroid Build Coastguard Worker  // Output only. An output-only field indicating the state of the topic.
313*d5c09012SAndroid Build Coastguard Worker  State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
314*d5c09012SAndroid Build Coastguard Worker
315*d5c09012SAndroid Build Coastguard Worker  // Optional. Settings for ingestion from a data source into this topic.
316*d5c09012SAndroid Build Coastguard Worker  IngestionDataSourceSettings ingestion_data_source_settings = 10
317*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
318*d5c09012SAndroid Build Coastguard Worker}
319*d5c09012SAndroid Build Coastguard Worker
320*d5c09012SAndroid Build Coastguard Worker// A message that is published by publishers and consumed by subscribers. The
321*d5c09012SAndroid Build Coastguard Worker// message must contain either a non-empty data field or at least one attribute.
322*d5c09012SAndroid Build Coastguard Worker// Note that client libraries represent this object differently
323*d5c09012SAndroid Build Coastguard Worker// depending on the language. See the corresponding [client library
324*d5c09012SAndroid Build Coastguard Worker// documentation](https://cloud.google.com/pubsub/docs/reference/libraries) for
325*d5c09012SAndroid Build Coastguard Worker// more information. See [quotas and limits]
326*d5c09012SAndroid Build Coastguard Worker// (https://cloud.google.com/pubsub/quotas) for more information about message
327*d5c09012SAndroid Build Coastguard Worker// limits.
328*d5c09012SAndroid Build Coastguard Workermessage PubsubMessage {
329*d5c09012SAndroid Build Coastguard Worker  // Optional. The message data field. If this field is empty, the message must
330*d5c09012SAndroid Build Coastguard Worker  // contain at least one attribute.
331*d5c09012SAndroid Build Coastguard Worker  bytes data = 1 [(google.api.field_behavior) = OPTIONAL];
332*d5c09012SAndroid Build Coastguard Worker
333*d5c09012SAndroid Build Coastguard Worker  // Optional. Attributes for this message. If this field is empty, the message
334*d5c09012SAndroid Build Coastguard Worker  // must contain non-empty data. This can be used to filter messages on the
335*d5c09012SAndroid Build Coastguard Worker  // subscription.
336*d5c09012SAndroid Build Coastguard Worker  map<string, string> attributes = 2 [(google.api.field_behavior) = OPTIONAL];
337*d5c09012SAndroid Build Coastguard Worker
338*d5c09012SAndroid Build Coastguard Worker  // ID of this message, assigned by the server when the message is published.
339*d5c09012SAndroid Build Coastguard Worker  // Guaranteed to be unique within the topic. This value may be read by a
340*d5c09012SAndroid Build Coastguard Worker  // subscriber that receives a `PubsubMessage` via a `Pull` call or a push
341*d5c09012SAndroid Build Coastguard Worker  // delivery. It must not be populated by the publisher in a `Publish` call.
342*d5c09012SAndroid Build Coastguard Worker  string message_id = 3;
343*d5c09012SAndroid Build Coastguard Worker
344*d5c09012SAndroid Build Coastguard Worker  // The time at which the message was published, populated by the server when
345*d5c09012SAndroid Build Coastguard Worker  // it receives the `Publish` call. It must not be populated by the
346*d5c09012SAndroid Build Coastguard Worker  // publisher in a `Publish` call.
347*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Timestamp publish_time = 4;
348*d5c09012SAndroid Build Coastguard Worker
349*d5c09012SAndroid Build Coastguard Worker  // Optional. If non-empty, identifies related messages for which publish order
350*d5c09012SAndroid Build Coastguard Worker  // should be respected. If a `Subscription` has `enable_message_ordering` set
351*d5c09012SAndroid Build Coastguard Worker  // to `true`, messages published with the same non-empty `ordering_key` value
352*d5c09012SAndroid Build Coastguard Worker  // will be delivered to subscribers in the order in which they are received by
353*d5c09012SAndroid Build Coastguard Worker  // the Pub/Sub system. All `PubsubMessage`s published in a given
354*d5c09012SAndroid Build Coastguard Worker  // `PublishRequest` must specify the same `ordering_key` value. For more
355*d5c09012SAndroid Build Coastguard Worker  // information, see [ordering
356*d5c09012SAndroid Build Coastguard Worker  // messages](https://cloud.google.com/pubsub/docs/ordering).
357*d5c09012SAndroid Build Coastguard Worker  string ordering_key = 5 [(google.api.field_behavior) = OPTIONAL];
358*d5c09012SAndroid Build Coastguard Worker}
359*d5c09012SAndroid Build Coastguard Worker
360*d5c09012SAndroid Build Coastguard Worker// Request for the GetTopic method.
361*d5c09012SAndroid Build Coastguard Workermessage GetTopicRequest {
362*d5c09012SAndroid Build Coastguard Worker  // Required. The name of the topic to get.
363*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project}/topics/{topic}`.
364*d5c09012SAndroid Build Coastguard Worker  string topic = 1 [
365*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
366*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
367*d5c09012SAndroid Build Coastguard Worker  ];
368*d5c09012SAndroid Build Coastguard Worker}
369*d5c09012SAndroid Build Coastguard Worker
370*d5c09012SAndroid Build Coastguard Worker// Request for the UpdateTopic method.
371*d5c09012SAndroid Build Coastguard Workermessage UpdateTopicRequest {
372*d5c09012SAndroid Build Coastguard Worker  // Required. The updated topic object.
373*d5c09012SAndroid Build Coastguard Worker  Topic topic = 1 [(google.api.field_behavior) = REQUIRED];
374*d5c09012SAndroid Build Coastguard Worker
375*d5c09012SAndroid Build Coastguard Worker  // Required. Indicates which fields in the provided topic to update. Must be
376*d5c09012SAndroid Build Coastguard Worker  // specified and non-empty. Note that if `update_mask` contains
377*d5c09012SAndroid Build Coastguard Worker  // "message_storage_policy" but the `message_storage_policy` is not set in
378*d5c09012SAndroid Build Coastguard Worker  // the `topic` provided above, then the updated value is determined by the
379*d5c09012SAndroid Build Coastguard Worker  // policy configured at the project or organization level.
380*d5c09012SAndroid Build Coastguard Worker  google.protobuf.FieldMask update_mask = 2
381*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = REQUIRED];
382*d5c09012SAndroid Build Coastguard Worker}
383*d5c09012SAndroid Build Coastguard Worker
384*d5c09012SAndroid Build Coastguard Worker// Request for the Publish method.
385*d5c09012SAndroid Build Coastguard Workermessage PublishRequest {
386*d5c09012SAndroid Build Coastguard Worker  // Required. The messages in the request will be published on this topic.
387*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project}/topics/{topic}`.
388*d5c09012SAndroid Build Coastguard Worker  string topic = 1 [
389*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
390*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
391*d5c09012SAndroid Build Coastguard Worker  ];
392*d5c09012SAndroid Build Coastguard Worker
393*d5c09012SAndroid Build Coastguard Worker  // Required. The messages to publish.
394*d5c09012SAndroid Build Coastguard Worker  repeated PubsubMessage messages = 2 [(google.api.field_behavior) = REQUIRED];
395*d5c09012SAndroid Build Coastguard Worker}
396*d5c09012SAndroid Build Coastguard Worker
397*d5c09012SAndroid Build Coastguard Worker// Response for the `Publish` method.
398*d5c09012SAndroid Build Coastguard Workermessage PublishResponse {
399*d5c09012SAndroid Build Coastguard Worker  // Optional. The server-assigned ID of each published message, in the same
400*d5c09012SAndroid Build Coastguard Worker  // order as the messages in the request. IDs are guaranteed to be unique
401*d5c09012SAndroid Build Coastguard Worker  // within the topic.
402*d5c09012SAndroid Build Coastguard Worker  repeated string message_ids = 1 [(google.api.field_behavior) = OPTIONAL];
403*d5c09012SAndroid Build Coastguard Worker}
404*d5c09012SAndroid Build Coastguard Worker
405*d5c09012SAndroid Build Coastguard Worker// Request for the `ListTopics` method.
406*d5c09012SAndroid Build Coastguard Workermessage ListTopicsRequest {
407*d5c09012SAndroid Build Coastguard Worker  // Required. The name of the project in which to list topics.
408*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project-id}`.
409*d5c09012SAndroid Build Coastguard Worker  string project = 1 [
410*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
411*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
412*d5c09012SAndroid Build Coastguard Worker      type: "cloudresourcemanager.googleapis.com/Project"
413*d5c09012SAndroid Build Coastguard Worker    }
414*d5c09012SAndroid Build Coastguard Worker  ];
415*d5c09012SAndroid Build Coastguard Worker
416*d5c09012SAndroid Build Coastguard Worker  // Optional. Maximum number of topics to return.
417*d5c09012SAndroid Build Coastguard Worker  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
418*d5c09012SAndroid Build Coastguard Worker
419*d5c09012SAndroid Build Coastguard Worker  // Optional. The value returned by the last `ListTopicsResponse`; indicates
420*d5c09012SAndroid Build Coastguard Worker  // that this is a continuation of a prior `ListTopics` call, and that the
421*d5c09012SAndroid Build Coastguard Worker  // system should return the next page of data.
422*d5c09012SAndroid Build Coastguard Worker  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
423*d5c09012SAndroid Build Coastguard Worker}
424*d5c09012SAndroid Build Coastguard Worker
425*d5c09012SAndroid Build Coastguard Worker// Response for the `ListTopics` method.
426*d5c09012SAndroid Build Coastguard Workermessage ListTopicsResponse {
427*d5c09012SAndroid Build Coastguard Worker  // Optional. The resulting topics.
428*d5c09012SAndroid Build Coastguard Worker  repeated Topic topics = 1 [(google.api.field_behavior) = OPTIONAL];
429*d5c09012SAndroid Build Coastguard Worker
430*d5c09012SAndroid Build Coastguard Worker  // Optional. If not empty, indicates that there may be more topics that match
431*d5c09012SAndroid Build Coastguard Worker  // the request; this value should be passed in a new `ListTopicsRequest`.
432*d5c09012SAndroid Build Coastguard Worker  string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL];
433*d5c09012SAndroid Build Coastguard Worker}
434*d5c09012SAndroid Build Coastguard Worker
435*d5c09012SAndroid Build Coastguard Worker// Request for the `ListTopicSubscriptions` method.
436*d5c09012SAndroid Build Coastguard Workermessage ListTopicSubscriptionsRequest {
437*d5c09012SAndroid Build Coastguard Worker  // Required. The name of the topic that subscriptions are attached to.
438*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project}/topics/{topic}`.
439*d5c09012SAndroid Build Coastguard Worker  string topic = 1 [
440*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
441*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
442*d5c09012SAndroid Build Coastguard Worker  ];
443*d5c09012SAndroid Build Coastguard Worker
444*d5c09012SAndroid Build Coastguard Worker  // Optional. Maximum number of subscription names to return.
445*d5c09012SAndroid Build Coastguard Worker  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
446*d5c09012SAndroid Build Coastguard Worker
447*d5c09012SAndroid Build Coastguard Worker  // Optional. The value returned by the last `ListTopicSubscriptionsResponse`;
448*d5c09012SAndroid Build Coastguard Worker  // indicates that this is a continuation of a prior `ListTopicSubscriptions`
449*d5c09012SAndroid Build Coastguard Worker  // call, and that the system should return the next page of data.
450*d5c09012SAndroid Build Coastguard Worker  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
451*d5c09012SAndroid Build Coastguard Worker}
452*d5c09012SAndroid Build Coastguard Worker
453*d5c09012SAndroid Build Coastguard Worker// Response for the `ListTopicSubscriptions` method.
454*d5c09012SAndroid Build Coastguard Workermessage ListTopicSubscriptionsResponse {
455*d5c09012SAndroid Build Coastguard Worker  // Optional. The names of subscriptions attached to the topic specified in the
456*d5c09012SAndroid Build Coastguard Worker  // request.
457*d5c09012SAndroid Build Coastguard Worker  repeated string subscriptions = 1 [
458*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = OPTIONAL,
459*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
460*d5c09012SAndroid Build Coastguard Worker      type: "pubsub.googleapis.com/Subscription"
461*d5c09012SAndroid Build Coastguard Worker    }
462*d5c09012SAndroid Build Coastguard Worker  ];
463*d5c09012SAndroid Build Coastguard Worker
464*d5c09012SAndroid Build Coastguard Worker  // Optional. If not empty, indicates that there may be more subscriptions that
465*d5c09012SAndroid Build Coastguard Worker  // match the request; this value should be passed in a new
466*d5c09012SAndroid Build Coastguard Worker  // `ListTopicSubscriptionsRequest` to get more subscriptions.
467*d5c09012SAndroid Build Coastguard Worker  string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL];
468*d5c09012SAndroid Build Coastguard Worker}
469*d5c09012SAndroid Build Coastguard Worker
470*d5c09012SAndroid Build Coastguard Worker// Request for the `ListTopicSnapshots` method.
471*d5c09012SAndroid Build Coastguard Workermessage ListTopicSnapshotsRequest {
472*d5c09012SAndroid Build Coastguard Worker  // Required. The name of the topic that snapshots are attached to.
473*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project}/topics/{topic}`.
474*d5c09012SAndroid Build Coastguard Worker  string topic = 1 [
475*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
476*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
477*d5c09012SAndroid Build Coastguard Worker  ];
478*d5c09012SAndroid Build Coastguard Worker
479*d5c09012SAndroid Build Coastguard Worker  // Optional. Maximum number of snapshot names to return.
480*d5c09012SAndroid Build Coastguard Worker  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
481*d5c09012SAndroid Build Coastguard Worker
482*d5c09012SAndroid Build Coastguard Worker  // Optional. The value returned by the last `ListTopicSnapshotsResponse`;
483*d5c09012SAndroid Build Coastguard Worker  // indicates that this is a continuation of a prior `ListTopicSnapshots` call,
484*d5c09012SAndroid Build Coastguard Worker  // and that the system should return the next page of data.
485*d5c09012SAndroid Build Coastguard Worker  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
486*d5c09012SAndroid Build Coastguard Worker}
487*d5c09012SAndroid Build Coastguard Worker
488*d5c09012SAndroid Build Coastguard Worker// Response for the `ListTopicSnapshots` method.
489*d5c09012SAndroid Build Coastguard Workermessage ListTopicSnapshotsResponse {
490*d5c09012SAndroid Build Coastguard Worker  // Optional. The names of the snapshots that match the request.
491*d5c09012SAndroid Build Coastguard Worker  repeated string snapshots = 1 [(google.api.field_behavior) = OPTIONAL];
492*d5c09012SAndroid Build Coastguard Worker
493*d5c09012SAndroid Build Coastguard Worker  // Optional. If not empty, indicates that there may be more snapshots that
494*d5c09012SAndroid Build Coastguard Worker  // match the request; this value should be passed in a new
495*d5c09012SAndroid Build Coastguard Worker  // `ListTopicSnapshotsRequest` to get more snapshots.
496*d5c09012SAndroid Build Coastguard Worker  string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL];
497*d5c09012SAndroid Build Coastguard Worker}
498*d5c09012SAndroid Build Coastguard Worker
499*d5c09012SAndroid Build Coastguard Worker// Request for the `DeleteTopic` method.
500*d5c09012SAndroid Build Coastguard Workermessage DeleteTopicRequest {
501*d5c09012SAndroid Build Coastguard Worker  // Required. Name of the topic to delete.
502*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project}/topics/{topic}`.
503*d5c09012SAndroid Build Coastguard Worker  string topic = 1 [
504*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
505*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
506*d5c09012SAndroid Build Coastguard Worker  ];
507*d5c09012SAndroid Build Coastguard Worker}
508*d5c09012SAndroid Build Coastguard Worker
509*d5c09012SAndroid Build Coastguard Worker// Request for the DetachSubscription method.
510*d5c09012SAndroid Build Coastguard Workermessage DetachSubscriptionRequest {
511*d5c09012SAndroid Build Coastguard Worker  // Required. The subscription to detach.
512*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project}/subscriptions/{subscription}`.
513*d5c09012SAndroid Build Coastguard Worker  string subscription = 1 [
514*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
515*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
516*d5c09012SAndroid Build Coastguard Worker      type: "pubsub.googleapis.com/Subscription"
517*d5c09012SAndroid Build Coastguard Worker    }
518*d5c09012SAndroid Build Coastguard Worker  ];
519*d5c09012SAndroid Build Coastguard Worker}
520*d5c09012SAndroid Build Coastguard Worker
521*d5c09012SAndroid Build Coastguard Worker// Response for the DetachSubscription method.
522*d5c09012SAndroid Build Coastguard Worker// Reserved for future use.
523*d5c09012SAndroid Build Coastguard Workermessage DetachSubscriptionResponse {}
524*d5c09012SAndroid Build Coastguard Worker
525*d5c09012SAndroid Build Coastguard Worker// The service that an application uses to manipulate subscriptions and to
526*d5c09012SAndroid Build Coastguard Worker// consume messages from a subscription via the `Pull` method or by
527*d5c09012SAndroid Build Coastguard Worker// establishing a bi-directional stream using the `StreamingPull` method.
528*d5c09012SAndroid Build Coastguard Workerservice Subscriber {
529*d5c09012SAndroid Build Coastguard Worker  option (google.api.default_host) = "pubsub.googleapis.com";
530*d5c09012SAndroid Build Coastguard Worker  option (google.api.oauth_scopes) =
531*d5c09012SAndroid Build Coastguard Worker      "https://www.googleapis.com/auth/cloud-platform,"
532*d5c09012SAndroid Build Coastguard Worker      "https://www.googleapis.com/auth/pubsub";
533*d5c09012SAndroid Build Coastguard Worker
534*d5c09012SAndroid Build Coastguard Worker  // Creates a subscription to a given topic. See the [resource name rules]
535*d5c09012SAndroid Build Coastguard Worker  // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
536*d5c09012SAndroid Build Coastguard Worker  // If the subscription already exists, returns `ALREADY_EXISTS`.
537*d5c09012SAndroid Build Coastguard Worker  // If the corresponding topic doesn't exist, returns `NOT_FOUND`.
538*d5c09012SAndroid Build Coastguard Worker  //
539*d5c09012SAndroid Build Coastguard Worker  // If the name is not provided in the request, the server will assign a random
540*d5c09012SAndroid Build Coastguard Worker  // name for this subscription on the same project as the topic, conforming
541*d5c09012SAndroid Build Coastguard Worker  // to the [resource name format]
542*d5c09012SAndroid Build Coastguard Worker  // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The
543*d5c09012SAndroid Build Coastguard Worker  // generated name is populated in the returned Subscription object. Note that
544*d5c09012SAndroid Build Coastguard Worker  // for REST API requests, you must specify a name in the request.
545*d5c09012SAndroid Build Coastguard Worker  rpc CreateSubscription(Subscription) returns (Subscription) {
546*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
547*d5c09012SAndroid Build Coastguard Worker      put: "/v1/{name=projects/*/subscriptions/*}"
548*d5c09012SAndroid Build Coastguard Worker      body: "*"
549*d5c09012SAndroid Build Coastguard Worker    };
550*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) =
551*d5c09012SAndroid Build Coastguard Worker        "name,topic,push_config,ack_deadline_seconds";
552*d5c09012SAndroid Build Coastguard Worker  }
553*d5c09012SAndroid Build Coastguard Worker
554*d5c09012SAndroid Build Coastguard Worker  // Gets the configuration details of a subscription.
555*d5c09012SAndroid Build Coastguard Worker  rpc GetSubscription(GetSubscriptionRequest) returns (Subscription) {
556*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
557*d5c09012SAndroid Build Coastguard Worker      get: "/v1/{subscription=projects/*/subscriptions/*}"
558*d5c09012SAndroid Build Coastguard Worker    };
559*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "subscription";
560*d5c09012SAndroid Build Coastguard Worker  }
561*d5c09012SAndroid Build Coastguard Worker
562*d5c09012SAndroid Build Coastguard Worker  // Updates an existing subscription by updating the fields specified in the
563*d5c09012SAndroid Build Coastguard Worker  // update mask. Note that certain properties of a subscription, such as its
564*d5c09012SAndroid Build Coastguard Worker  // topic, are not modifiable.
565*d5c09012SAndroid Build Coastguard Worker  rpc UpdateSubscription(UpdateSubscriptionRequest) returns (Subscription) {
566*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
567*d5c09012SAndroid Build Coastguard Worker      patch: "/v1/{subscription.name=projects/*/subscriptions/*}"
568*d5c09012SAndroid Build Coastguard Worker      body: "*"
569*d5c09012SAndroid Build Coastguard Worker    };
570*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "subscription,update_mask";
571*d5c09012SAndroid Build Coastguard Worker  }
572*d5c09012SAndroid Build Coastguard Worker
573*d5c09012SAndroid Build Coastguard Worker  // Lists matching subscriptions.
574*d5c09012SAndroid Build Coastguard Worker  rpc ListSubscriptions(ListSubscriptionsRequest)
575*d5c09012SAndroid Build Coastguard Worker      returns (ListSubscriptionsResponse) {
576*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
577*d5c09012SAndroid Build Coastguard Worker      get: "/v1/{project=projects/*}/subscriptions"
578*d5c09012SAndroid Build Coastguard Worker    };
579*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "project";
580*d5c09012SAndroid Build Coastguard Worker  }
581*d5c09012SAndroid Build Coastguard Worker
582*d5c09012SAndroid Build Coastguard Worker  // Deletes an existing subscription. All messages retained in the subscription
583*d5c09012SAndroid Build Coastguard Worker  // are immediately dropped. Calls to `Pull` after deletion will return
584*d5c09012SAndroid Build Coastguard Worker  // `NOT_FOUND`. After a subscription is deleted, a new one may be created with
585*d5c09012SAndroid Build Coastguard Worker  // the same name, but the new one has no association with the old
586*d5c09012SAndroid Build Coastguard Worker  // subscription or its topic unless the same topic is specified.
587*d5c09012SAndroid Build Coastguard Worker  rpc DeleteSubscription(DeleteSubscriptionRequest)
588*d5c09012SAndroid Build Coastguard Worker      returns (google.protobuf.Empty) {
589*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
590*d5c09012SAndroid Build Coastguard Worker      delete: "/v1/{subscription=projects/*/subscriptions/*}"
591*d5c09012SAndroid Build Coastguard Worker    };
592*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "subscription";
593*d5c09012SAndroid Build Coastguard Worker  }
594*d5c09012SAndroid Build Coastguard Worker
595*d5c09012SAndroid Build Coastguard Worker  // Modifies the ack deadline for a specific message. This method is useful
596*d5c09012SAndroid Build Coastguard Worker  // to indicate that more time is needed to process a message by the
597*d5c09012SAndroid Build Coastguard Worker  // subscriber, or to make the message available for redelivery if the
598*d5c09012SAndroid Build Coastguard Worker  // processing was interrupted. Note that this does not modify the
599*d5c09012SAndroid Build Coastguard Worker  // subscription-level `ackDeadlineSeconds` used for subsequent messages.
600*d5c09012SAndroid Build Coastguard Worker  rpc ModifyAckDeadline(ModifyAckDeadlineRequest)
601*d5c09012SAndroid Build Coastguard Worker      returns (google.protobuf.Empty) {
602*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
603*d5c09012SAndroid Build Coastguard Worker      post: "/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline"
604*d5c09012SAndroid Build Coastguard Worker      body: "*"
605*d5c09012SAndroid Build Coastguard Worker    };
606*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) =
607*d5c09012SAndroid Build Coastguard Worker        "subscription,ack_ids,ack_deadline_seconds";
608*d5c09012SAndroid Build Coastguard Worker  }
609*d5c09012SAndroid Build Coastguard Worker
610*d5c09012SAndroid Build Coastguard Worker  // Acknowledges the messages associated with the `ack_ids` in the
611*d5c09012SAndroid Build Coastguard Worker  // `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages
612*d5c09012SAndroid Build Coastguard Worker  // from the subscription.
613*d5c09012SAndroid Build Coastguard Worker  //
614*d5c09012SAndroid Build Coastguard Worker  // Acknowledging a message whose ack deadline has expired may succeed,
615*d5c09012SAndroid Build Coastguard Worker  // but such a message may be redelivered later. Acknowledging a message more
616*d5c09012SAndroid Build Coastguard Worker  // than once will not result in an error.
617*d5c09012SAndroid Build Coastguard Worker  rpc Acknowledge(AcknowledgeRequest) returns (google.protobuf.Empty) {
618*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
619*d5c09012SAndroid Build Coastguard Worker      post: "/v1/{subscription=projects/*/subscriptions/*}:acknowledge"
620*d5c09012SAndroid Build Coastguard Worker      body: "*"
621*d5c09012SAndroid Build Coastguard Worker    };
622*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "subscription,ack_ids";
623*d5c09012SAndroid Build Coastguard Worker  }
624*d5c09012SAndroid Build Coastguard Worker
625*d5c09012SAndroid Build Coastguard Worker  // Pulls messages from the server.
626*d5c09012SAndroid Build Coastguard Worker  rpc Pull(PullRequest) returns (PullResponse) {
627*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
628*d5c09012SAndroid Build Coastguard Worker      post: "/v1/{subscription=projects/*/subscriptions/*}:pull"
629*d5c09012SAndroid Build Coastguard Worker      body: "*"
630*d5c09012SAndroid Build Coastguard Worker    };
631*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) =
632*d5c09012SAndroid Build Coastguard Worker        "subscription,return_immediately,max_messages";
633*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "subscription,max_messages";
634*d5c09012SAndroid Build Coastguard Worker  }
635*d5c09012SAndroid Build Coastguard Worker
636*d5c09012SAndroid Build Coastguard Worker  // Establishes a stream with the server, which sends messages down to the
637*d5c09012SAndroid Build Coastguard Worker  // client. The client streams acknowledgements and ack deadline modifications
638*d5c09012SAndroid Build Coastguard Worker  // back to the server. The server will close the stream and return the status
639*d5c09012SAndroid Build Coastguard Worker  // on any error. The server may close the stream with status `UNAVAILABLE` to
640*d5c09012SAndroid Build Coastguard Worker  // reassign server-side resources, in which case, the client should
641*d5c09012SAndroid Build Coastguard Worker  // re-establish the stream. Flow control can be achieved by configuring the
642*d5c09012SAndroid Build Coastguard Worker  // underlying RPC channel.
643*d5c09012SAndroid Build Coastguard Worker  rpc StreamingPull(stream StreamingPullRequest)
644*d5c09012SAndroid Build Coastguard Worker      returns (stream StreamingPullResponse) {}
645*d5c09012SAndroid Build Coastguard Worker
646*d5c09012SAndroid Build Coastguard Worker  // Modifies the `PushConfig` for a specified subscription.
647*d5c09012SAndroid Build Coastguard Worker  //
648*d5c09012SAndroid Build Coastguard Worker  // This may be used to change a push subscription to a pull one (signified by
649*d5c09012SAndroid Build Coastguard Worker  // an empty `PushConfig`) or vice versa, or change the endpoint URL and other
650*d5c09012SAndroid Build Coastguard Worker  // attributes of a push subscription. Messages will accumulate for delivery
651*d5c09012SAndroid Build Coastguard Worker  // continuously through the call regardless of changes to the `PushConfig`.
652*d5c09012SAndroid Build Coastguard Worker  rpc ModifyPushConfig(ModifyPushConfigRequest)
653*d5c09012SAndroid Build Coastguard Worker      returns (google.protobuf.Empty) {
654*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
655*d5c09012SAndroid Build Coastguard Worker      post: "/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig"
656*d5c09012SAndroid Build Coastguard Worker      body: "*"
657*d5c09012SAndroid Build Coastguard Worker    };
658*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "subscription,push_config";
659*d5c09012SAndroid Build Coastguard Worker  }
660*d5c09012SAndroid Build Coastguard Worker
661*d5c09012SAndroid Build Coastguard Worker  // Gets the configuration details of a snapshot. Snapshots are used in
662*d5c09012SAndroid Build Coastguard Worker  // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
663*d5c09012SAndroid Build Coastguard Worker  // which allow you to manage message acknowledgments in bulk. That is, you can
664*d5c09012SAndroid Build Coastguard Worker  // set the acknowledgment state of messages in an existing subscription to the
665*d5c09012SAndroid Build Coastguard Worker  // state captured by a snapshot.
666*d5c09012SAndroid Build Coastguard Worker  rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) {
667*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
668*d5c09012SAndroid Build Coastguard Worker      get: "/v1/{snapshot=projects/*/snapshots/*}"
669*d5c09012SAndroid Build Coastguard Worker    };
670*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "snapshot";
671*d5c09012SAndroid Build Coastguard Worker  }
672*d5c09012SAndroid Build Coastguard Worker
673*d5c09012SAndroid Build Coastguard Worker  // Lists the existing snapshots. Snapshots are used in [Seek](
674*d5c09012SAndroid Build Coastguard Worker  // https://cloud.google.com/pubsub/docs/replay-overview) operations, which
675*d5c09012SAndroid Build Coastguard Worker  // allow you to manage message acknowledgments in bulk. That is, you can set
676*d5c09012SAndroid Build Coastguard Worker  // the acknowledgment state of messages in an existing subscription to the
677*d5c09012SAndroid Build Coastguard Worker  // state captured by a snapshot.
678*d5c09012SAndroid Build Coastguard Worker  rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) {
679*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
680*d5c09012SAndroid Build Coastguard Worker      get: "/v1/{project=projects/*}/snapshots"
681*d5c09012SAndroid Build Coastguard Worker    };
682*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "project";
683*d5c09012SAndroid Build Coastguard Worker  }
684*d5c09012SAndroid Build Coastguard Worker
685*d5c09012SAndroid Build Coastguard Worker  // Creates a snapshot from the requested subscription. Snapshots are used in
686*d5c09012SAndroid Build Coastguard Worker  // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
687*d5c09012SAndroid Build Coastguard Worker  // which allow you to manage message acknowledgments in bulk. That is, you can
688*d5c09012SAndroid Build Coastguard Worker  // set the acknowledgment state of messages in an existing subscription to the
689*d5c09012SAndroid Build Coastguard Worker  // state captured by a snapshot.
690*d5c09012SAndroid Build Coastguard Worker  // If the snapshot already exists, returns `ALREADY_EXISTS`.
691*d5c09012SAndroid Build Coastguard Worker  // If the requested subscription doesn't exist, returns `NOT_FOUND`.
692*d5c09012SAndroid Build Coastguard Worker  // If the backlog in the subscription is too old -- and the resulting snapshot
693*d5c09012SAndroid Build Coastguard Worker  // would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned.
694*d5c09012SAndroid Build Coastguard Worker  // See also the `Snapshot.expire_time` field. If the name is not provided in
695*d5c09012SAndroid Build Coastguard Worker  // the request, the server will assign a random
696*d5c09012SAndroid Build Coastguard Worker  // name for this snapshot on the same project as the subscription, conforming
697*d5c09012SAndroid Build Coastguard Worker  // to the [resource name format]
698*d5c09012SAndroid Build Coastguard Worker  // (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The
699*d5c09012SAndroid Build Coastguard Worker  // generated name is populated in the returned Snapshot object. Note that for
700*d5c09012SAndroid Build Coastguard Worker  // REST API requests, you must specify a name in the request.
701*d5c09012SAndroid Build Coastguard Worker  rpc CreateSnapshot(CreateSnapshotRequest) returns (Snapshot) {
702*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
703*d5c09012SAndroid Build Coastguard Worker      put: "/v1/{name=projects/*/snapshots/*}"
704*d5c09012SAndroid Build Coastguard Worker      body: "*"
705*d5c09012SAndroid Build Coastguard Worker    };
706*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "name,subscription";
707*d5c09012SAndroid Build Coastguard Worker  }
708*d5c09012SAndroid Build Coastguard Worker
709*d5c09012SAndroid Build Coastguard Worker  // Updates an existing snapshot by updating the fields specified in the update
710*d5c09012SAndroid Build Coastguard Worker  // mask. Snapshots are used in
711*d5c09012SAndroid Build Coastguard Worker  // [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
712*d5c09012SAndroid Build Coastguard Worker  // which allow you to manage message acknowledgments in bulk. That is, you can
713*d5c09012SAndroid Build Coastguard Worker  // set the acknowledgment state of messages in an existing subscription to the
714*d5c09012SAndroid Build Coastguard Worker  // state captured by a snapshot.
715*d5c09012SAndroid Build Coastguard Worker  rpc UpdateSnapshot(UpdateSnapshotRequest) returns (Snapshot) {
716*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
717*d5c09012SAndroid Build Coastguard Worker      patch: "/v1/{snapshot.name=projects/*/snapshots/*}"
718*d5c09012SAndroid Build Coastguard Worker      body: "*"
719*d5c09012SAndroid Build Coastguard Worker    };
720*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "snapshot,update_mask";
721*d5c09012SAndroid Build Coastguard Worker  }
722*d5c09012SAndroid Build Coastguard Worker
723*d5c09012SAndroid Build Coastguard Worker  // Removes an existing snapshot. Snapshots are used in [Seek]
724*d5c09012SAndroid Build Coastguard Worker  // (https://cloud.google.com/pubsub/docs/replay-overview) operations, which
725*d5c09012SAndroid Build Coastguard Worker  // allow you to manage message acknowledgments in bulk. That is, you can set
726*d5c09012SAndroid Build Coastguard Worker  // the acknowledgment state of messages in an existing subscription to the
727*d5c09012SAndroid Build Coastguard Worker  // state captured by a snapshot.
728*d5c09012SAndroid Build Coastguard Worker  // When the snapshot is deleted, all messages retained in the snapshot
729*d5c09012SAndroid Build Coastguard Worker  // are immediately dropped. After a snapshot is deleted, a new one may be
730*d5c09012SAndroid Build Coastguard Worker  // created with the same name, but the new one has no association with the old
731*d5c09012SAndroid Build Coastguard Worker  // snapshot or its subscription, unless the same subscription is specified.
732*d5c09012SAndroid Build Coastguard Worker  rpc DeleteSnapshot(DeleteSnapshotRequest) returns (google.protobuf.Empty) {
733*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
734*d5c09012SAndroid Build Coastguard Worker      delete: "/v1/{snapshot=projects/*/snapshots/*}"
735*d5c09012SAndroid Build Coastguard Worker    };
736*d5c09012SAndroid Build Coastguard Worker    option (google.api.method_signature) = "snapshot";
737*d5c09012SAndroid Build Coastguard Worker  }
738*d5c09012SAndroid Build Coastguard Worker
739*d5c09012SAndroid Build Coastguard Worker  // Seeks an existing subscription to a point in time or to a given snapshot,
740*d5c09012SAndroid Build Coastguard Worker  // whichever is provided in the request. Snapshots are used in [Seek]
741*d5c09012SAndroid Build Coastguard Worker  // (https://cloud.google.com/pubsub/docs/replay-overview) operations, which
742*d5c09012SAndroid Build Coastguard Worker  // allow you to manage message acknowledgments in bulk. That is, you can set
743*d5c09012SAndroid Build Coastguard Worker  // the acknowledgment state of messages in an existing subscription to the
744*d5c09012SAndroid Build Coastguard Worker  // state captured by a snapshot. Note that both the subscription and the
745*d5c09012SAndroid Build Coastguard Worker  // snapshot must be on the same topic.
746*d5c09012SAndroid Build Coastguard Worker  rpc Seek(SeekRequest) returns (SeekResponse) {
747*d5c09012SAndroid Build Coastguard Worker    option (google.api.http) = {
748*d5c09012SAndroid Build Coastguard Worker      post: "/v1/{subscription=projects/*/subscriptions/*}:seek"
749*d5c09012SAndroid Build Coastguard Worker      body: "*"
750*d5c09012SAndroid Build Coastguard Worker    };
751*d5c09012SAndroid Build Coastguard Worker  }
752*d5c09012SAndroid Build Coastguard Worker}
753*d5c09012SAndroid Build Coastguard Worker
754*d5c09012SAndroid Build Coastguard Worker// A subscription resource. If none of `push_config`, `bigquery_config`, or
755*d5c09012SAndroid Build Coastguard Worker// `cloud_storage_config` is set, then the subscriber will pull and ack messages
756*d5c09012SAndroid Build Coastguard Worker// using API methods. At most one of these fields may be set.
757*d5c09012SAndroid Build Coastguard Workermessage Subscription {
758*d5c09012SAndroid Build Coastguard Worker  option (google.api.resource) = {
759*d5c09012SAndroid Build Coastguard Worker    type: "pubsub.googleapis.com/Subscription"
760*d5c09012SAndroid Build Coastguard Worker    pattern: "projects/{project}/subscriptions/{subscription}"
761*d5c09012SAndroid Build Coastguard Worker  };
762*d5c09012SAndroid Build Coastguard Worker
763*d5c09012SAndroid Build Coastguard Worker  // Possible states for a subscription.
764*d5c09012SAndroid Build Coastguard Worker  enum State {
765*d5c09012SAndroid Build Coastguard Worker    // Default value. This value is unused.
766*d5c09012SAndroid Build Coastguard Worker    STATE_UNSPECIFIED = 0;
767*d5c09012SAndroid Build Coastguard Worker
768*d5c09012SAndroid Build Coastguard Worker    // The subscription can actively receive messages
769*d5c09012SAndroid Build Coastguard Worker    ACTIVE = 1;
770*d5c09012SAndroid Build Coastguard Worker
771*d5c09012SAndroid Build Coastguard Worker    // The subscription cannot receive messages because of an error with the
772*d5c09012SAndroid Build Coastguard Worker    // resource to which it pushes messages. See the more detailed error state
773*d5c09012SAndroid Build Coastguard Worker    // in the corresponding configuration.
774*d5c09012SAndroid Build Coastguard Worker    RESOURCE_ERROR = 2;
775*d5c09012SAndroid Build Coastguard Worker  }
776*d5c09012SAndroid Build Coastguard Worker
777*d5c09012SAndroid Build Coastguard Worker  // Required. The name of the subscription. It must have the format
778*d5c09012SAndroid Build Coastguard Worker  // `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
779*d5c09012SAndroid Build Coastguard Worker  // start with a letter, and contain only letters (`[A-Za-z]`), numbers
780*d5c09012SAndroid Build Coastguard Worker  // (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
781*d5c09012SAndroid Build Coastguard Worker  // plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
782*d5c09012SAndroid Build Coastguard Worker  // in length, and it must not start with `"goog"`.
783*d5c09012SAndroid Build Coastguard Worker  string name = 1 [(google.api.field_behavior) = REQUIRED];
784*d5c09012SAndroid Build Coastguard Worker
785*d5c09012SAndroid Build Coastguard Worker  // Required. The name of the topic from which this subscription is receiving
786*d5c09012SAndroid Build Coastguard Worker  // messages. Format is `projects/{project}/topics/{topic}`. The value of this
787*d5c09012SAndroid Build Coastguard Worker  // field will be `_deleted-topic_` if the topic has been deleted.
788*d5c09012SAndroid Build Coastguard Worker  string topic = 2 [
789*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
790*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
791*d5c09012SAndroid Build Coastguard Worker  ];
792*d5c09012SAndroid Build Coastguard Worker
793*d5c09012SAndroid Build Coastguard Worker  // Optional. If push delivery is used with this subscription, this field is
794*d5c09012SAndroid Build Coastguard Worker  // used to configure it.
795*d5c09012SAndroid Build Coastguard Worker  PushConfig push_config = 4 [(google.api.field_behavior) = OPTIONAL];
796*d5c09012SAndroid Build Coastguard Worker
797*d5c09012SAndroid Build Coastguard Worker  // Optional. If delivery to BigQuery is used with this subscription, this
798*d5c09012SAndroid Build Coastguard Worker  // field is used to configure it.
799*d5c09012SAndroid Build Coastguard Worker  BigQueryConfig bigquery_config = 18 [(google.api.field_behavior) = OPTIONAL];
800*d5c09012SAndroid Build Coastguard Worker
801*d5c09012SAndroid Build Coastguard Worker  // Optional. If delivery to Google Cloud Storage is used with this
802*d5c09012SAndroid Build Coastguard Worker  // subscription, this field is used to configure it.
803*d5c09012SAndroid Build Coastguard Worker  CloudStorageConfig cloud_storage_config = 22
804*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
805*d5c09012SAndroid Build Coastguard Worker
806*d5c09012SAndroid Build Coastguard Worker  // Optional. The approximate amount of time (on a best-effort basis) Pub/Sub
807*d5c09012SAndroid Build Coastguard Worker  // waits for the subscriber to acknowledge receipt before resending the
808*d5c09012SAndroid Build Coastguard Worker  // message. In the interval after the message is delivered and before it is
809*d5c09012SAndroid Build Coastguard Worker  // acknowledged, it is considered to be _outstanding_. During that time
810*d5c09012SAndroid Build Coastguard Worker  // period, the message will not be redelivered (on a best-effort basis).
811*d5c09012SAndroid Build Coastguard Worker  //
812*d5c09012SAndroid Build Coastguard Worker  // For pull subscriptions, this value is used as the initial value for the ack
813*d5c09012SAndroid Build Coastguard Worker  // deadline. To override this value for a given message, call
814*d5c09012SAndroid Build Coastguard Worker  // `ModifyAckDeadline` with the corresponding `ack_id` if using
815*d5c09012SAndroid Build Coastguard Worker  // non-streaming pull or send the `ack_id` in a
816*d5c09012SAndroid Build Coastguard Worker  // `StreamingModifyAckDeadlineRequest` if using streaming pull.
817*d5c09012SAndroid Build Coastguard Worker  // The minimum custom deadline you can specify is 10 seconds.
818*d5c09012SAndroid Build Coastguard Worker  // The maximum custom deadline you can specify is 600 seconds (10 minutes).
819*d5c09012SAndroid Build Coastguard Worker  // If this parameter is 0, a default value of 10 seconds is used.
820*d5c09012SAndroid Build Coastguard Worker  //
821*d5c09012SAndroid Build Coastguard Worker  // For push delivery, this value is also used to set the request timeout for
822*d5c09012SAndroid Build Coastguard Worker  // the call to the push endpoint.
823*d5c09012SAndroid Build Coastguard Worker  //
824*d5c09012SAndroid Build Coastguard Worker  // If the subscriber never acknowledges the message, the Pub/Sub
825*d5c09012SAndroid Build Coastguard Worker  // system will eventually redeliver the message.
826*d5c09012SAndroid Build Coastguard Worker  int32 ack_deadline_seconds = 5 [(google.api.field_behavior) = OPTIONAL];
827*d5c09012SAndroid Build Coastguard Worker
828*d5c09012SAndroid Build Coastguard Worker  // Optional. Indicates whether to retain acknowledged messages. If true, then
829*d5c09012SAndroid Build Coastguard Worker  // messages are not expunged from the subscription's backlog, even if they are
830*d5c09012SAndroid Build Coastguard Worker  // acknowledged, until they fall out of the `message_retention_duration`
831*d5c09012SAndroid Build Coastguard Worker  // window. This must be true if you would like to [`Seek` to a timestamp]
832*d5c09012SAndroid Build Coastguard Worker  // (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in
833*d5c09012SAndroid Build Coastguard Worker  // the past to replay previously-acknowledged messages.
834*d5c09012SAndroid Build Coastguard Worker  bool retain_acked_messages = 7 [(google.api.field_behavior) = OPTIONAL];
835*d5c09012SAndroid Build Coastguard Worker
836*d5c09012SAndroid Build Coastguard Worker  // Optional. How long to retain unacknowledged messages in the subscription's
837*d5c09012SAndroid Build Coastguard Worker  // backlog, from the moment a message is published. If `retain_acked_messages`
838*d5c09012SAndroid Build Coastguard Worker  // is true, then this also configures the retention of acknowledged messages,
839*d5c09012SAndroid Build Coastguard Worker  // and thus configures how far back in time a `Seek` can be done. Defaults to
840*d5c09012SAndroid Build Coastguard Worker  // 7 days. Cannot be more than 7 days or less than 10 minutes.
841*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Duration message_retention_duration = 8
842*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
843*d5c09012SAndroid Build Coastguard Worker
844*d5c09012SAndroid Build Coastguard Worker  // Optional. See [Creating and managing
845*d5c09012SAndroid Build Coastguard Worker  // labels](https://cloud.google.com/pubsub/docs/labels).
846*d5c09012SAndroid Build Coastguard Worker  map<string, string> labels = 9 [(google.api.field_behavior) = OPTIONAL];
847*d5c09012SAndroid Build Coastguard Worker
848*d5c09012SAndroid Build Coastguard Worker  // Optional. If true, messages published with the same `ordering_key` in
849*d5c09012SAndroid Build Coastguard Worker  // `PubsubMessage` will be delivered to the subscribers in the order in which
850*d5c09012SAndroid Build Coastguard Worker  // they are received by the Pub/Sub system. Otherwise, they may be delivered
851*d5c09012SAndroid Build Coastguard Worker  // in any order.
852*d5c09012SAndroid Build Coastguard Worker  bool enable_message_ordering = 10 [(google.api.field_behavior) = OPTIONAL];
853*d5c09012SAndroid Build Coastguard Worker
854*d5c09012SAndroid Build Coastguard Worker  // Optional. A policy that specifies the conditions for this subscription's
855*d5c09012SAndroid Build Coastguard Worker  // expiration. A subscription is considered active as long as any connected
856*d5c09012SAndroid Build Coastguard Worker  // subscriber is successfully consuming messages from the subscription or is
857*d5c09012SAndroid Build Coastguard Worker  // issuing operations on the subscription. If `expiration_policy` is not set,
858*d5c09012SAndroid Build Coastguard Worker  // a *default policy* with `ttl` of 31 days will be used. The minimum allowed
859*d5c09012SAndroid Build Coastguard Worker  // value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
860*d5c09012SAndroid Build Coastguard Worker  // but `expiration_policy.ttl` is not set, the subscription never expires.
861*d5c09012SAndroid Build Coastguard Worker  ExpirationPolicy expiration_policy = 11
862*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
863*d5c09012SAndroid Build Coastguard Worker
864*d5c09012SAndroid Build Coastguard Worker  // Optional. An expression written in the Pub/Sub [filter
865*d5c09012SAndroid Build Coastguard Worker  // language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
866*d5c09012SAndroid Build Coastguard Worker  // then only `PubsubMessage`s whose `attributes` field matches the filter are
867*d5c09012SAndroid Build Coastguard Worker  // delivered on this subscription. If empty, then no messages are filtered
868*d5c09012SAndroid Build Coastguard Worker  // out.
869*d5c09012SAndroid Build Coastguard Worker  string filter = 12 [(google.api.field_behavior) = OPTIONAL];
870*d5c09012SAndroid Build Coastguard Worker
871*d5c09012SAndroid Build Coastguard Worker  // Optional. A policy that specifies the conditions for dead lettering
872*d5c09012SAndroid Build Coastguard Worker  // messages in this subscription. If dead_letter_policy is not set, dead
873*d5c09012SAndroid Build Coastguard Worker  // lettering is disabled.
874*d5c09012SAndroid Build Coastguard Worker  //
875*d5c09012SAndroid Build Coastguard Worker  // The Pub/Sub service account associated with this subscriptions's
876*d5c09012SAndroid Build Coastguard Worker  // parent project (i.e.,
877*d5c09012SAndroid Build Coastguard Worker  // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
878*d5c09012SAndroid Build Coastguard Worker  // permission to Acknowledge() messages on this subscription.
879*d5c09012SAndroid Build Coastguard Worker  DeadLetterPolicy dead_letter_policy = 13
880*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
881*d5c09012SAndroid Build Coastguard Worker
882*d5c09012SAndroid Build Coastguard Worker  // Optional. A policy that specifies how Pub/Sub retries message delivery for
883*d5c09012SAndroid Build Coastguard Worker  // this subscription.
884*d5c09012SAndroid Build Coastguard Worker  //
885*d5c09012SAndroid Build Coastguard Worker  // If not set, the default retry policy is applied. This generally implies
886*d5c09012SAndroid Build Coastguard Worker  // that messages will be retried as soon as possible for healthy subscribers.
887*d5c09012SAndroid Build Coastguard Worker  // RetryPolicy will be triggered on NACKs or acknowledgement deadline
888*d5c09012SAndroid Build Coastguard Worker  // exceeded events for a given message.
889*d5c09012SAndroid Build Coastguard Worker  RetryPolicy retry_policy = 14 [(google.api.field_behavior) = OPTIONAL];
890*d5c09012SAndroid Build Coastguard Worker
891*d5c09012SAndroid Build Coastguard Worker  // Optional. Indicates whether the subscription is detached from its topic.
892*d5c09012SAndroid Build Coastguard Worker  // Detached subscriptions don't receive messages from their topic and don't
893*d5c09012SAndroid Build Coastguard Worker  // retain any backlog. `Pull` and `StreamingPull` requests will return
894*d5c09012SAndroid Build Coastguard Worker  // FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
895*d5c09012SAndroid Build Coastguard Worker  // the endpoint will not be made.
896*d5c09012SAndroid Build Coastguard Worker  bool detached = 15 [(google.api.field_behavior) = OPTIONAL];
897*d5c09012SAndroid Build Coastguard Worker
898*d5c09012SAndroid Build Coastguard Worker  // Optional. If true, Pub/Sub provides the following guarantees for the
899*d5c09012SAndroid Build Coastguard Worker  // delivery of a message with a given value of `message_id` on this
900*d5c09012SAndroid Build Coastguard Worker  // subscription:
901*d5c09012SAndroid Build Coastguard Worker  //
902*d5c09012SAndroid Build Coastguard Worker  // * The message sent to a subscriber is guaranteed not to be resent
903*d5c09012SAndroid Build Coastguard Worker  // before the message's acknowledgement deadline expires.
904*d5c09012SAndroid Build Coastguard Worker  // * An acknowledged message will not be resent to a subscriber.
905*d5c09012SAndroid Build Coastguard Worker  //
906*d5c09012SAndroid Build Coastguard Worker  // Note that subscribers may still receive multiple copies of a message
907*d5c09012SAndroid Build Coastguard Worker  // when `enable_exactly_once_delivery` is true if the message was published
908*d5c09012SAndroid Build Coastguard Worker  // multiple times by a publisher client. These copies are  considered distinct
909*d5c09012SAndroid Build Coastguard Worker  // by Pub/Sub and have distinct `message_id` values.
910*d5c09012SAndroid Build Coastguard Worker  bool enable_exactly_once_delivery = 16
911*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
912*d5c09012SAndroid Build Coastguard Worker
913*d5c09012SAndroid Build Coastguard Worker  // Output only. Indicates the minimum duration for which a message is retained
914*d5c09012SAndroid Build Coastguard Worker  // after it is published to the subscription's topic. If this field is set,
915*d5c09012SAndroid Build Coastguard Worker  // messages published to the subscription's topic in the last
916*d5c09012SAndroid Build Coastguard Worker  // `topic_message_retention_duration` are always available to subscribers. See
917*d5c09012SAndroid Build Coastguard Worker  // the `message_retention_duration` field in `Topic`. This field is set only
918*d5c09012SAndroid Build Coastguard Worker  // in responses from the server; it is ignored if it is set in any requests.
919*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Duration topic_message_retention_duration = 17
920*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OUTPUT_ONLY];
921*d5c09012SAndroid Build Coastguard Worker
922*d5c09012SAndroid Build Coastguard Worker  // Output only. An output-only field indicating whether or not the
923*d5c09012SAndroid Build Coastguard Worker  // subscription can receive messages.
924*d5c09012SAndroid Build Coastguard Worker  State state = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
925*d5c09012SAndroid Build Coastguard Worker}
926*d5c09012SAndroid Build Coastguard Worker
927*d5c09012SAndroid Build Coastguard Worker// A policy that specifies how Pub/Sub retries message delivery.
928*d5c09012SAndroid Build Coastguard Worker//
929*d5c09012SAndroid Build Coastguard Worker// Retry delay will be exponential based on provided minimum and maximum
930*d5c09012SAndroid Build Coastguard Worker// backoffs. https://en.wikipedia.org/wiki/Exponential_backoff.
931*d5c09012SAndroid Build Coastguard Worker//
932*d5c09012SAndroid Build Coastguard Worker// RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded
933*d5c09012SAndroid Build Coastguard Worker// events for a given message.
934*d5c09012SAndroid Build Coastguard Worker//
935*d5c09012SAndroid Build Coastguard Worker// Retry Policy is implemented on a best effort basis. At times, the delay
936*d5c09012SAndroid Build Coastguard Worker// between consecutive deliveries may not match the configuration. That is,
937*d5c09012SAndroid Build Coastguard Worker// delay can be more or less than configured backoff.
938*d5c09012SAndroid Build Coastguard Workermessage RetryPolicy {
939*d5c09012SAndroid Build Coastguard Worker  // Optional. The minimum delay between consecutive deliveries of a given
940*d5c09012SAndroid Build Coastguard Worker  // message. Value should be between 0 and 600 seconds. Defaults to 10 seconds.
941*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Duration minimum_backoff = 1
942*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
943*d5c09012SAndroid Build Coastguard Worker
944*d5c09012SAndroid Build Coastguard Worker  // Optional. The maximum delay between consecutive deliveries of a given
945*d5c09012SAndroid Build Coastguard Worker  // message. Value should be between 0 and 600 seconds. Defaults to 600
946*d5c09012SAndroid Build Coastguard Worker  // seconds.
947*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Duration maximum_backoff = 2
948*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
949*d5c09012SAndroid Build Coastguard Worker}
950*d5c09012SAndroid Build Coastguard Worker
951*d5c09012SAndroid Build Coastguard Worker// Dead lettering is done on a best effort basis. The same message might be
952*d5c09012SAndroid Build Coastguard Worker// dead lettered multiple times.
953*d5c09012SAndroid Build Coastguard Worker//
954*d5c09012SAndroid Build Coastguard Worker// If validation on any of the fields fails at subscription creation/updation,
955*d5c09012SAndroid Build Coastguard Worker// the create/update subscription request will fail.
956*d5c09012SAndroid Build Coastguard Workermessage DeadLetterPolicy {
957*d5c09012SAndroid Build Coastguard Worker  // Optional. The name of the topic to which dead letter messages should be
958*d5c09012SAndroid Build Coastguard Worker  // published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub
959*d5c09012SAndroid Build Coastguard Worker  // service account associated with the enclosing subscription's parent project
960*d5c09012SAndroid Build Coastguard Worker  // (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must
961*d5c09012SAndroid Build Coastguard Worker  // have permission to Publish() to this topic.
962*d5c09012SAndroid Build Coastguard Worker  //
963*d5c09012SAndroid Build Coastguard Worker  // The operation will fail if the topic does not exist.
964*d5c09012SAndroid Build Coastguard Worker  // Users should ensure that there is a subscription attached to this topic
965*d5c09012SAndroid Build Coastguard Worker  // since messages published to a topic with no subscriptions are lost.
966*d5c09012SAndroid Build Coastguard Worker  string dead_letter_topic = 1 [(google.api.field_behavior) = OPTIONAL];
967*d5c09012SAndroid Build Coastguard Worker
968*d5c09012SAndroid Build Coastguard Worker  // Optional. The maximum number of delivery attempts for any message. The
969*d5c09012SAndroid Build Coastguard Worker  // value must be between 5 and 100.
970*d5c09012SAndroid Build Coastguard Worker  //
971*d5c09012SAndroid Build Coastguard Worker  // The number of delivery attempts is defined as 1 + (the sum of number of
972*d5c09012SAndroid Build Coastguard Worker  // NACKs and number of times the acknowledgement deadline has been exceeded
973*d5c09012SAndroid Build Coastguard Worker  // for the message).
974*d5c09012SAndroid Build Coastguard Worker  //
975*d5c09012SAndroid Build Coastguard Worker  // A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
976*d5c09012SAndroid Build Coastguard Worker  // client libraries may automatically extend ack_deadlines.
977*d5c09012SAndroid Build Coastguard Worker  //
978*d5c09012SAndroid Build Coastguard Worker  // This field will be honored on a best effort basis.
979*d5c09012SAndroid Build Coastguard Worker  //
980*d5c09012SAndroid Build Coastguard Worker  // If this parameter is 0, a default value of 5 is used.
981*d5c09012SAndroid Build Coastguard Worker  int32 max_delivery_attempts = 2 [(google.api.field_behavior) = OPTIONAL];
982*d5c09012SAndroid Build Coastguard Worker}
983*d5c09012SAndroid Build Coastguard Worker
984*d5c09012SAndroid Build Coastguard Worker// A policy that specifies the conditions for resource expiration (i.e.,
985*d5c09012SAndroid Build Coastguard Worker// automatic resource deletion).
986*d5c09012SAndroid Build Coastguard Workermessage ExpirationPolicy {
987*d5c09012SAndroid Build Coastguard Worker  // Optional. Specifies the "time-to-live" duration for an associated resource.
988*d5c09012SAndroid Build Coastguard Worker  // The resource expires if it is not active for a period of `ttl`. The
989*d5c09012SAndroid Build Coastguard Worker  // definition of "activity" depends on the type of the associated resource.
990*d5c09012SAndroid Build Coastguard Worker  // The minimum and maximum allowed values for `ttl` depend on the type of the
991*d5c09012SAndroid Build Coastguard Worker  // associated resource, as well. If `ttl` is not set, the associated resource
992*d5c09012SAndroid Build Coastguard Worker  // never expires.
993*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Duration ttl = 1 [(google.api.field_behavior) = OPTIONAL];
994*d5c09012SAndroid Build Coastguard Worker}
995*d5c09012SAndroid Build Coastguard Worker
996*d5c09012SAndroid Build Coastguard Worker// Configuration for a push delivery endpoint.
997*d5c09012SAndroid Build Coastguard Workermessage PushConfig {
998*d5c09012SAndroid Build Coastguard Worker  // Contains information needed for generating an
999*d5c09012SAndroid Build Coastguard Worker  // [OpenID Connect
1000*d5c09012SAndroid Build Coastguard Worker  // token](https://developers.google.com/identity/protocols/OpenIDConnect).
1001*d5c09012SAndroid Build Coastguard Worker  message OidcToken {
1002*d5c09012SAndroid Build Coastguard Worker    // Optional. [Service account
1003*d5c09012SAndroid Build Coastguard Worker    // email](https://cloud.google.com/iam/docs/service-accounts)
1004*d5c09012SAndroid Build Coastguard Worker    // used for generating the OIDC token. For more information
1005*d5c09012SAndroid Build Coastguard Worker    // on setting up authentication, see
1006*d5c09012SAndroid Build Coastguard Worker    // [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
1007*d5c09012SAndroid Build Coastguard Worker    string service_account_email = 1 [(google.api.field_behavior) = OPTIONAL];
1008*d5c09012SAndroid Build Coastguard Worker
1009*d5c09012SAndroid Build Coastguard Worker    // Optional. Audience to be used when generating OIDC token. The audience
1010*d5c09012SAndroid Build Coastguard Worker    // claim identifies the recipients that the JWT is intended for. The
1011*d5c09012SAndroid Build Coastguard Worker    // audience value is a single case-sensitive string. Having multiple values
1012*d5c09012SAndroid Build Coastguard Worker    // (array) for the audience field is not supported. More info about the OIDC
1013*d5c09012SAndroid Build Coastguard Worker    // JWT token audience here:
1014*d5c09012SAndroid Build Coastguard Worker    // https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified,
1015*d5c09012SAndroid Build Coastguard Worker    // the Push endpoint URL will be used.
1016*d5c09012SAndroid Build Coastguard Worker    string audience = 2 [(google.api.field_behavior) = OPTIONAL];
1017*d5c09012SAndroid Build Coastguard Worker  }
1018*d5c09012SAndroid Build Coastguard Worker
1019*d5c09012SAndroid Build Coastguard Worker  // The payload to the push endpoint is in the form of the JSON representation
1020*d5c09012SAndroid Build Coastguard Worker  // of a PubsubMessage
1021*d5c09012SAndroid Build Coastguard Worker  // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
1022*d5c09012SAndroid Build Coastguard Worker  message PubsubWrapper {}
1023*d5c09012SAndroid Build Coastguard Worker
1024*d5c09012SAndroid Build Coastguard Worker  // Sets the `data` field as the HTTP body for delivery.
1025*d5c09012SAndroid Build Coastguard Worker  message NoWrapper {
1026*d5c09012SAndroid Build Coastguard Worker    // Optional. When true, writes the Pub/Sub message metadata to
1027*d5c09012SAndroid Build Coastguard Worker    // `x-goog-pubsub-<KEY>:<VAL>` headers of the HTTP request. Writes the
1028*d5c09012SAndroid Build Coastguard Worker    // Pub/Sub message attributes to `<KEY>:<VAL>` headers of the HTTP request.
1029*d5c09012SAndroid Build Coastguard Worker    bool write_metadata = 1 [(google.api.field_behavior) = OPTIONAL];
1030*d5c09012SAndroid Build Coastguard Worker  }
1031*d5c09012SAndroid Build Coastguard Worker
1032*d5c09012SAndroid Build Coastguard Worker  // Optional. A URL locating the endpoint to which messages should be pushed.
1033*d5c09012SAndroid Build Coastguard Worker  // For example, a Webhook endpoint might use `https://example.com/push`.
1034*d5c09012SAndroid Build Coastguard Worker  string push_endpoint = 1 [(google.api.field_behavior) = OPTIONAL];
1035*d5c09012SAndroid Build Coastguard Worker
1036*d5c09012SAndroid Build Coastguard Worker  // Optional. Endpoint configuration attributes that can be used to control
1037*d5c09012SAndroid Build Coastguard Worker  // different aspects of the message delivery.
1038*d5c09012SAndroid Build Coastguard Worker  //
1039*d5c09012SAndroid Build Coastguard Worker  // The only currently supported attribute is `x-goog-version`, which you can
1040*d5c09012SAndroid Build Coastguard Worker  // use to change the format of the pushed message. This attribute
1041*d5c09012SAndroid Build Coastguard Worker  // indicates the version of the data expected by the endpoint. This
1042*d5c09012SAndroid Build Coastguard Worker  // controls the shape of the pushed message (i.e., its fields and metadata).
1043*d5c09012SAndroid Build Coastguard Worker  //
1044*d5c09012SAndroid Build Coastguard Worker  // If not present during the `CreateSubscription` call, it will default to
1045*d5c09012SAndroid Build Coastguard Worker  // the version of the Pub/Sub API used to make such call. If not present in a
1046*d5c09012SAndroid Build Coastguard Worker  // `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
1047*d5c09012SAndroid Build Coastguard Worker  // calls will always return a valid version, even if the subscription was
1048*d5c09012SAndroid Build Coastguard Worker  // created without this attribute.
1049*d5c09012SAndroid Build Coastguard Worker  //
1050*d5c09012SAndroid Build Coastguard Worker  // The only supported values for the `x-goog-version` attribute are:
1051*d5c09012SAndroid Build Coastguard Worker  //
1052*d5c09012SAndroid Build Coastguard Worker  // * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
1053*d5c09012SAndroid Build Coastguard Worker  // * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
1054*d5c09012SAndroid Build Coastguard Worker  //
1055*d5c09012SAndroid Build Coastguard Worker  // For example:
1056*d5c09012SAndroid Build Coastguard Worker  // `attributes { "x-goog-version": "v1" }`
1057*d5c09012SAndroid Build Coastguard Worker  map<string, string> attributes = 2 [(google.api.field_behavior) = OPTIONAL];
1058*d5c09012SAndroid Build Coastguard Worker
1059*d5c09012SAndroid Build Coastguard Worker  // An authentication method used by push endpoints to verify the source of
1060*d5c09012SAndroid Build Coastguard Worker  // push requests. This can be used with push endpoints that are private by
1061*d5c09012SAndroid Build Coastguard Worker  // default to allow requests only from the Pub/Sub system, for example.
1062*d5c09012SAndroid Build Coastguard Worker  // This field is optional and should be set only by users interested in
1063*d5c09012SAndroid Build Coastguard Worker  // authenticated push.
1064*d5c09012SAndroid Build Coastguard Worker  oneof authentication_method {
1065*d5c09012SAndroid Build Coastguard Worker    // Optional. If specified, Pub/Sub will generate and attach an OIDC JWT
1066*d5c09012SAndroid Build Coastguard Worker    // token as an `Authorization` header in the HTTP request for every pushed
1067*d5c09012SAndroid Build Coastguard Worker    // message.
1068*d5c09012SAndroid Build Coastguard Worker    OidcToken oidc_token = 3 [(google.api.field_behavior) = OPTIONAL];
1069*d5c09012SAndroid Build Coastguard Worker  }
1070*d5c09012SAndroid Build Coastguard Worker
1071*d5c09012SAndroid Build Coastguard Worker  // The format of the delivered message to the push endpoint is defined by
1072*d5c09012SAndroid Build Coastguard Worker  // the chosen wrapper. When unset, `PubsubWrapper` is used.
1073*d5c09012SAndroid Build Coastguard Worker  oneof wrapper {
1074*d5c09012SAndroid Build Coastguard Worker    // Optional. When set, the payload to the push endpoint is in the form of
1075*d5c09012SAndroid Build Coastguard Worker    // the JSON representation of a PubsubMessage
1076*d5c09012SAndroid Build Coastguard Worker    // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
1077*d5c09012SAndroid Build Coastguard Worker    PubsubWrapper pubsub_wrapper = 4 [(google.api.field_behavior) = OPTIONAL];
1078*d5c09012SAndroid Build Coastguard Worker
1079*d5c09012SAndroid Build Coastguard Worker    // Optional. When set, the payload to the push endpoint is not wrapped.
1080*d5c09012SAndroid Build Coastguard Worker    NoWrapper no_wrapper = 5 [(google.api.field_behavior) = OPTIONAL];
1081*d5c09012SAndroid Build Coastguard Worker  }
1082*d5c09012SAndroid Build Coastguard Worker}
1083*d5c09012SAndroid Build Coastguard Worker
1084*d5c09012SAndroid Build Coastguard Worker// Configuration for a BigQuery subscription.
1085*d5c09012SAndroid Build Coastguard Workermessage BigQueryConfig {
1086*d5c09012SAndroid Build Coastguard Worker  // Possible states for a BigQuery subscription.
1087*d5c09012SAndroid Build Coastguard Worker  enum State {
1088*d5c09012SAndroid Build Coastguard Worker    // Default value. This value is unused.
1089*d5c09012SAndroid Build Coastguard Worker    STATE_UNSPECIFIED = 0;
1090*d5c09012SAndroid Build Coastguard Worker
1091*d5c09012SAndroid Build Coastguard Worker    // The subscription can actively send messages to BigQuery
1092*d5c09012SAndroid Build Coastguard Worker    ACTIVE = 1;
1093*d5c09012SAndroid Build Coastguard Worker
1094*d5c09012SAndroid Build Coastguard Worker    // Cannot write to the BigQuery table because of permission denied errors.
1095*d5c09012SAndroid Build Coastguard Worker    // This can happen if
1096*d5c09012SAndroid Build Coastguard Worker    // - Pub/Sub SA has not been granted the [appropriate BigQuery IAM
1097*d5c09012SAndroid Build Coastguard Worker    // permissions](https://cloud.google.com/pubsub/docs/create-subscription#assign_bigquery_service_account)
1098*d5c09012SAndroid Build Coastguard Worker    // - bigquery.googleapis.com API is not enabled for the project
1099*d5c09012SAndroid Build Coastguard Worker    // ([instructions](https://cloud.google.com/service-usage/docs/enable-disable))
1100*d5c09012SAndroid Build Coastguard Worker    PERMISSION_DENIED = 2;
1101*d5c09012SAndroid Build Coastguard Worker
1102*d5c09012SAndroid Build Coastguard Worker    // Cannot write to the BigQuery table because it does not exist.
1103*d5c09012SAndroid Build Coastguard Worker    NOT_FOUND = 3;
1104*d5c09012SAndroid Build Coastguard Worker
1105*d5c09012SAndroid Build Coastguard Worker    // Cannot write to the BigQuery table due to a schema mismatch.
1106*d5c09012SAndroid Build Coastguard Worker    SCHEMA_MISMATCH = 4;
1107*d5c09012SAndroid Build Coastguard Worker
1108*d5c09012SAndroid Build Coastguard Worker    // Cannot write to the destination because enforce_in_transit is set to true
1109*d5c09012SAndroid Build Coastguard Worker    // and the destination locations are not in the allowed regions.
1110*d5c09012SAndroid Build Coastguard Worker    IN_TRANSIT_LOCATION_RESTRICTION = 5;
1111*d5c09012SAndroid Build Coastguard Worker  }
1112*d5c09012SAndroid Build Coastguard Worker
1113*d5c09012SAndroid Build Coastguard Worker  // Optional. The name of the table to which to write data, of the form
1114*d5c09012SAndroid Build Coastguard Worker  // {projectId}.{datasetId}.{tableId}
1115*d5c09012SAndroid Build Coastguard Worker  string table = 1 [(google.api.field_behavior) = OPTIONAL];
1116*d5c09012SAndroid Build Coastguard Worker
1117*d5c09012SAndroid Build Coastguard Worker  // Optional. When true, use the topic's schema as the columns to write to in
1118*d5c09012SAndroid Build Coastguard Worker  // BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
1119*d5c09012SAndroid Build Coastguard Worker  // enabled at the same time.
1120*d5c09012SAndroid Build Coastguard Worker  bool use_topic_schema = 2 [(google.api.field_behavior) = OPTIONAL];
1121*d5c09012SAndroid Build Coastguard Worker
1122*d5c09012SAndroid Build Coastguard Worker  // Optional. When true, write the subscription name, message_id, publish_time,
1123*d5c09012SAndroid Build Coastguard Worker  // attributes, and ordering_key to additional columns in the table. The
1124*d5c09012SAndroid Build Coastguard Worker  // subscription name, message_id, and publish_time fields are put in their own
1125*d5c09012SAndroid Build Coastguard Worker  // columns while all other message properties (other than data) are written to
1126*d5c09012SAndroid Build Coastguard Worker  // a JSON object in the attributes column.
1127*d5c09012SAndroid Build Coastguard Worker  bool write_metadata = 3 [(google.api.field_behavior) = OPTIONAL];
1128*d5c09012SAndroid Build Coastguard Worker
1129*d5c09012SAndroid Build Coastguard Worker  // Optional. When true and use_topic_schema is true, any fields that are a
1130*d5c09012SAndroid Build Coastguard Worker  // part of the topic schema that are not part of the BigQuery table schema are
1131*d5c09012SAndroid Build Coastguard Worker  // dropped when writing to BigQuery. Otherwise, the schemas must be kept in
1132*d5c09012SAndroid Build Coastguard Worker  // sync and any messages with extra fields are not written and remain in the
1133*d5c09012SAndroid Build Coastguard Worker  // subscription's backlog.
1134*d5c09012SAndroid Build Coastguard Worker  bool drop_unknown_fields = 4 [(google.api.field_behavior) = OPTIONAL];
1135*d5c09012SAndroid Build Coastguard Worker
1136*d5c09012SAndroid Build Coastguard Worker  // Output only. An output-only field that indicates whether or not the
1137*d5c09012SAndroid Build Coastguard Worker  // subscription can receive messages.
1138*d5c09012SAndroid Build Coastguard Worker  State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
1139*d5c09012SAndroid Build Coastguard Worker
1140*d5c09012SAndroid Build Coastguard Worker  // Optional. When true, use the BigQuery table's schema as the columns to
1141*d5c09012SAndroid Build Coastguard Worker  // write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
1142*d5c09012SAndroid Build Coastguard Worker  // enabled at the same time.
1143*d5c09012SAndroid Build Coastguard Worker  bool use_table_schema = 6 [(google.api.field_behavior) = OPTIONAL];
1144*d5c09012SAndroid Build Coastguard Worker}
1145*d5c09012SAndroid Build Coastguard Worker
1146*d5c09012SAndroid Build Coastguard Worker// Configuration for a Cloud Storage subscription.
1147*d5c09012SAndroid Build Coastguard Workermessage CloudStorageConfig {
1148*d5c09012SAndroid Build Coastguard Worker  // Configuration for writing message data in text format.
1149*d5c09012SAndroid Build Coastguard Worker  // Message payloads will be written to files as raw text, separated by a
1150*d5c09012SAndroid Build Coastguard Worker  // newline.
1151*d5c09012SAndroid Build Coastguard Worker  message TextConfig {}
1152*d5c09012SAndroid Build Coastguard Worker
1153*d5c09012SAndroid Build Coastguard Worker  // Configuration for writing message data in Avro format.
1154*d5c09012SAndroid Build Coastguard Worker  // Message payloads and metadata will be written to files as an Avro binary.
1155*d5c09012SAndroid Build Coastguard Worker  message AvroConfig {
1156*d5c09012SAndroid Build Coastguard Worker    // Optional. When true, write the subscription name, message_id,
1157*d5c09012SAndroid Build Coastguard Worker    // publish_time, attributes, and ordering_key as additional fields in the
1158*d5c09012SAndroid Build Coastguard Worker    // output. The subscription name, message_id, and publish_time fields are
1159*d5c09012SAndroid Build Coastguard Worker    // put in their own fields while all other message properties other than
1160*d5c09012SAndroid Build Coastguard Worker    // data (for example, an ordering_key, if present) are added as entries in
1161*d5c09012SAndroid Build Coastguard Worker    // the attributes map.
1162*d5c09012SAndroid Build Coastguard Worker    bool write_metadata = 1 [(google.api.field_behavior) = OPTIONAL];
1163*d5c09012SAndroid Build Coastguard Worker  }
1164*d5c09012SAndroid Build Coastguard Worker
1165*d5c09012SAndroid Build Coastguard Worker  // Possible states for a Cloud Storage subscription.
1166*d5c09012SAndroid Build Coastguard Worker  enum State {
1167*d5c09012SAndroid Build Coastguard Worker    // Default value. This value is unused.
1168*d5c09012SAndroid Build Coastguard Worker    STATE_UNSPECIFIED = 0;
1169*d5c09012SAndroid Build Coastguard Worker
1170*d5c09012SAndroid Build Coastguard Worker    // The subscription can actively send messages to Cloud Storage.
1171*d5c09012SAndroid Build Coastguard Worker    ACTIVE = 1;
1172*d5c09012SAndroid Build Coastguard Worker
1173*d5c09012SAndroid Build Coastguard Worker    // Cannot write to the Cloud Storage bucket because of permission denied
1174*d5c09012SAndroid Build Coastguard Worker    // errors.
1175*d5c09012SAndroid Build Coastguard Worker    PERMISSION_DENIED = 2;
1176*d5c09012SAndroid Build Coastguard Worker
1177*d5c09012SAndroid Build Coastguard Worker    // Cannot write to the Cloud Storage bucket because it does not exist.
1178*d5c09012SAndroid Build Coastguard Worker    NOT_FOUND = 3;
1179*d5c09012SAndroid Build Coastguard Worker
1180*d5c09012SAndroid Build Coastguard Worker    // Cannot write to the destination because enforce_in_transit is set to true
1181*d5c09012SAndroid Build Coastguard Worker    // and the destination locations are not in the allowed regions.
1182*d5c09012SAndroid Build Coastguard Worker    IN_TRANSIT_LOCATION_RESTRICTION = 4;
1183*d5c09012SAndroid Build Coastguard Worker  }
1184*d5c09012SAndroid Build Coastguard Worker
1185*d5c09012SAndroid Build Coastguard Worker  // Required. User-provided name for the Cloud Storage bucket.
1186*d5c09012SAndroid Build Coastguard Worker  // The bucket must be created by the user. The bucket name must be without
1187*d5c09012SAndroid Build Coastguard Worker  // any prefix like "gs://". See the [bucket naming
1188*d5c09012SAndroid Build Coastguard Worker  // requirements] (https://cloud.google.com/storage/docs/buckets#naming).
1189*d5c09012SAndroid Build Coastguard Worker  string bucket = 1 [(google.api.field_behavior) = REQUIRED];
1190*d5c09012SAndroid Build Coastguard Worker
1191*d5c09012SAndroid Build Coastguard Worker  // Optional. User-provided prefix for Cloud Storage filename. See the [object
1192*d5c09012SAndroid Build Coastguard Worker  // naming requirements](https://cloud.google.com/storage/docs/objects#naming).
1193*d5c09012SAndroid Build Coastguard Worker  string filename_prefix = 2 [(google.api.field_behavior) = OPTIONAL];
1194*d5c09012SAndroid Build Coastguard Worker
1195*d5c09012SAndroid Build Coastguard Worker  // Optional. User-provided suffix for Cloud Storage filename. See the [object
1196*d5c09012SAndroid Build Coastguard Worker  // naming requirements](https://cloud.google.com/storage/docs/objects#naming).
1197*d5c09012SAndroid Build Coastguard Worker  // Must not end in "/".
1198*d5c09012SAndroid Build Coastguard Worker  string filename_suffix = 3 [(google.api.field_behavior) = OPTIONAL];
1199*d5c09012SAndroid Build Coastguard Worker
1200*d5c09012SAndroid Build Coastguard Worker  // Optional. User-provided format string specifying how to represent datetimes
1201*d5c09012SAndroid Build Coastguard Worker  // in Cloud Storage filenames. See the [datetime format
1202*d5c09012SAndroid Build Coastguard Worker  // guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names).
1203*d5c09012SAndroid Build Coastguard Worker  string filename_datetime_format = 10 [(google.api.field_behavior) = OPTIONAL];
1204*d5c09012SAndroid Build Coastguard Worker
1205*d5c09012SAndroid Build Coastguard Worker  // Defaults to text format.
1206*d5c09012SAndroid Build Coastguard Worker  oneof output_format {
1207*d5c09012SAndroid Build Coastguard Worker    // Optional. If set, message data will be written to Cloud Storage in text
1208*d5c09012SAndroid Build Coastguard Worker    // format.
1209*d5c09012SAndroid Build Coastguard Worker    TextConfig text_config = 4 [(google.api.field_behavior) = OPTIONAL];
1210*d5c09012SAndroid Build Coastguard Worker
1211*d5c09012SAndroid Build Coastguard Worker    // Optional. If set, message data will be written to Cloud Storage in Avro
1212*d5c09012SAndroid Build Coastguard Worker    // format.
1213*d5c09012SAndroid Build Coastguard Worker    AvroConfig avro_config = 5 [(google.api.field_behavior) = OPTIONAL];
1214*d5c09012SAndroid Build Coastguard Worker  }
1215*d5c09012SAndroid Build Coastguard Worker
1216*d5c09012SAndroid Build Coastguard Worker  // Optional. The maximum duration that can elapse before a new Cloud Storage
1217*d5c09012SAndroid Build Coastguard Worker  // file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not
1218*d5c09012SAndroid Build Coastguard Worker  // exceed the subscription's acknowledgement deadline.
1219*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Duration max_duration = 6
1220*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
1221*d5c09012SAndroid Build Coastguard Worker
1222*d5c09012SAndroid Build Coastguard Worker  // Optional. The maximum bytes that can be written to a Cloud Storage file
1223*d5c09012SAndroid Build Coastguard Worker  // before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may
1224*d5c09012SAndroid Build Coastguard Worker  // be exceeded in cases where messages are larger than the limit.
1225*d5c09012SAndroid Build Coastguard Worker  int64 max_bytes = 7 [(google.api.field_behavior) = OPTIONAL];
1226*d5c09012SAndroid Build Coastguard Worker
1227*d5c09012SAndroid Build Coastguard Worker  // Output only. An output-only field that indicates whether or not the
1228*d5c09012SAndroid Build Coastguard Worker  // subscription can receive messages.
1229*d5c09012SAndroid Build Coastguard Worker  State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
1230*d5c09012SAndroid Build Coastguard Worker}
1231*d5c09012SAndroid Build Coastguard Worker
1232*d5c09012SAndroid Build Coastguard Worker// A message and its corresponding acknowledgment ID.
1233*d5c09012SAndroid Build Coastguard Workermessage ReceivedMessage {
1234*d5c09012SAndroid Build Coastguard Worker  // Optional. This ID can be used to acknowledge the received message.
1235*d5c09012SAndroid Build Coastguard Worker  string ack_id = 1 [(google.api.field_behavior) = OPTIONAL];
1236*d5c09012SAndroid Build Coastguard Worker
1237*d5c09012SAndroid Build Coastguard Worker  // Optional. The message.
1238*d5c09012SAndroid Build Coastguard Worker  PubsubMessage message = 2 [(google.api.field_behavior) = OPTIONAL];
1239*d5c09012SAndroid Build Coastguard Worker
1240*d5c09012SAndroid Build Coastguard Worker  // Optional. The approximate number of times that Pub/Sub has attempted to
1241*d5c09012SAndroid Build Coastguard Worker  // deliver the associated message to a subscriber.
1242*d5c09012SAndroid Build Coastguard Worker  //
1243*d5c09012SAndroid Build Coastguard Worker  // More precisely, this is 1 + (number of NACKs) +
1244*d5c09012SAndroid Build Coastguard Worker  // (number of ack_deadline exceeds) for this message.
1245*d5c09012SAndroid Build Coastguard Worker  //
1246*d5c09012SAndroid Build Coastguard Worker  // A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline
1247*d5c09012SAndroid Build Coastguard Worker  // exceeds event is whenever a message is not acknowledged within
1248*d5c09012SAndroid Build Coastguard Worker  // ack_deadline. Note that ack_deadline is initially
1249*d5c09012SAndroid Build Coastguard Worker  // Subscription.ackDeadlineSeconds, but may get extended automatically by
1250*d5c09012SAndroid Build Coastguard Worker  // the client library.
1251*d5c09012SAndroid Build Coastguard Worker  //
1252*d5c09012SAndroid Build Coastguard Worker  // Upon the first delivery of a given message, `delivery_attempt` will have a
1253*d5c09012SAndroid Build Coastguard Worker  // value of 1. The value is calculated at best effort and is approximate.
1254*d5c09012SAndroid Build Coastguard Worker  //
1255*d5c09012SAndroid Build Coastguard Worker  // If a DeadLetterPolicy is not set on the subscription, this will be 0.
1256*d5c09012SAndroid Build Coastguard Worker  int32 delivery_attempt = 3 [(google.api.field_behavior) = OPTIONAL];
1257*d5c09012SAndroid Build Coastguard Worker}
1258*d5c09012SAndroid Build Coastguard Worker
1259*d5c09012SAndroid Build Coastguard Worker// Request for the GetSubscription method.
1260*d5c09012SAndroid Build Coastguard Workermessage GetSubscriptionRequest {
1261*d5c09012SAndroid Build Coastguard Worker  // Required. The name of the subscription to get.
1262*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project}/subscriptions/{sub}`.
1263*d5c09012SAndroid Build Coastguard Worker  string subscription = 1 [
1264*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
1265*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
1266*d5c09012SAndroid Build Coastguard Worker      type: "pubsub.googleapis.com/Subscription"
1267*d5c09012SAndroid Build Coastguard Worker    }
1268*d5c09012SAndroid Build Coastguard Worker  ];
1269*d5c09012SAndroid Build Coastguard Worker}
1270*d5c09012SAndroid Build Coastguard Worker
1271*d5c09012SAndroid Build Coastguard Worker// Request for the UpdateSubscription method.
1272*d5c09012SAndroid Build Coastguard Workermessage UpdateSubscriptionRequest {
1273*d5c09012SAndroid Build Coastguard Worker  // Required. The updated subscription object.
1274*d5c09012SAndroid Build Coastguard Worker  Subscription subscription = 1 [(google.api.field_behavior) = REQUIRED];
1275*d5c09012SAndroid Build Coastguard Worker
1276*d5c09012SAndroid Build Coastguard Worker  // Required. Indicates which fields in the provided subscription to update.
1277*d5c09012SAndroid Build Coastguard Worker  // Must be specified and non-empty.
1278*d5c09012SAndroid Build Coastguard Worker  google.protobuf.FieldMask update_mask = 2
1279*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = REQUIRED];
1280*d5c09012SAndroid Build Coastguard Worker}
1281*d5c09012SAndroid Build Coastguard Worker
1282*d5c09012SAndroid Build Coastguard Worker// Request for the `ListSubscriptions` method.
1283*d5c09012SAndroid Build Coastguard Workermessage ListSubscriptionsRequest {
1284*d5c09012SAndroid Build Coastguard Worker  // Required. The name of the project in which to list subscriptions.
1285*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project-id}`.
1286*d5c09012SAndroid Build Coastguard Worker  string project = 1 [
1287*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
1288*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
1289*d5c09012SAndroid Build Coastguard Worker      type: "cloudresourcemanager.googleapis.com/Project"
1290*d5c09012SAndroid Build Coastguard Worker    }
1291*d5c09012SAndroid Build Coastguard Worker  ];
1292*d5c09012SAndroid Build Coastguard Worker
1293*d5c09012SAndroid Build Coastguard Worker  // Optional. Maximum number of subscriptions to return.
1294*d5c09012SAndroid Build Coastguard Worker  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
1295*d5c09012SAndroid Build Coastguard Worker
1296*d5c09012SAndroid Build Coastguard Worker  // Optional. The value returned by the last `ListSubscriptionsResponse`;
1297*d5c09012SAndroid Build Coastguard Worker  // indicates that this is a continuation of a prior `ListSubscriptions` call,
1298*d5c09012SAndroid Build Coastguard Worker  // and that the system should return the next page of data.
1299*d5c09012SAndroid Build Coastguard Worker  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
1300*d5c09012SAndroid Build Coastguard Worker}
1301*d5c09012SAndroid Build Coastguard Worker
1302*d5c09012SAndroid Build Coastguard Worker// Response for the `ListSubscriptions` method.
1303*d5c09012SAndroid Build Coastguard Workermessage ListSubscriptionsResponse {
1304*d5c09012SAndroid Build Coastguard Worker  // Optional. The subscriptions that match the request.
1305*d5c09012SAndroid Build Coastguard Worker  repeated Subscription subscriptions = 1
1306*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
1307*d5c09012SAndroid Build Coastguard Worker
1308*d5c09012SAndroid Build Coastguard Worker  // Optional. If not empty, indicates that there may be more subscriptions that
1309*d5c09012SAndroid Build Coastguard Worker  // match the request; this value should be passed in a new
1310*d5c09012SAndroid Build Coastguard Worker  // `ListSubscriptionsRequest` to get more subscriptions.
1311*d5c09012SAndroid Build Coastguard Worker  string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL];
1312*d5c09012SAndroid Build Coastguard Worker}
1313*d5c09012SAndroid Build Coastguard Worker
1314*d5c09012SAndroid Build Coastguard Worker// Request for the DeleteSubscription method.
1315*d5c09012SAndroid Build Coastguard Workermessage DeleteSubscriptionRequest {
1316*d5c09012SAndroid Build Coastguard Worker  // Required. The subscription to delete.
1317*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project}/subscriptions/{sub}`.
1318*d5c09012SAndroid Build Coastguard Worker  string subscription = 1 [
1319*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
1320*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
1321*d5c09012SAndroid Build Coastguard Worker      type: "pubsub.googleapis.com/Subscription"
1322*d5c09012SAndroid Build Coastguard Worker    }
1323*d5c09012SAndroid Build Coastguard Worker  ];
1324*d5c09012SAndroid Build Coastguard Worker}
1325*d5c09012SAndroid Build Coastguard Worker
1326*d5c09012SAndroid Build Coastguard Worker// Request for the ModifyPushConfig method.
1327*d5c09012SAndroid Build Coastguard Workermessage ModifyPushConfigRequest {
1328*d5c09012SAndroid Build Coastguard Worker  // Required. The name of the subscription.
1329*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project}/subscriptions/{sub}`.
1330*d5c09012SAndroid Build Coastguard Worker  string subscription = 1 [
1331*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
1332*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
1333*d5c09012SAndroid Build Coastguard Worker      type: "pubsub.googleapis.com/Subscription"
1334*d5c09012SAndroid Build Coastguard Worker    }
1335*d5c09012SAndroid Build Coastguard Worker  ];
1336*d5c09012SAndroid Build Coastguard Worker
1337*d5c09012SAndroid Build Coastguard Worker  // Required. The push configuration for future deliveries.
1338*d5c09012SAndroid Build Coastguard Worker  //
1339*d5c09012SAndroid Build Coastguard Worker  // An empty `pushConfig` indicates that the Pub/Sub system should
1340*d5c09012SAndroid Build Coastguard Worker  // stop pushing messages from the given subscription and allow
1341*d5c09012SAndroid Build Coastguard Worker  // messages to be pulled and acknowledged - effectively pausing
1342*d5c09012SAndroid Build Coastguard Worker  // the subscription if `Pull` or `StreamingPull` is not called.
1343*d5c09012SAndroid Build Coastguard Worker  PushConfig push_config = 2 [(google.api.field_behavior) = REQUIRED];
1344*d5c09012SAndroid Build Coastguard Worker}
1345*d5c09012SAndroid Build Coastguard Worker
1346*d5c09012SAndroid Build Coastguard Worker// Request for the `Pull` method.
1347*d5c09012SAndroid Build Coastguard Workermessage PullRequest {
1348*d5c09012SAndroid Build Coastguard Worker  // Required. The subscription from which messages should be pulled.
1349*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project}/subscriptions/{sub}`.
1350*d5c09012SAndroid Build Coastguard Worker  string subscription = 1 [
1351*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
1352*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
1353*d5c09012SAndroid Build Coastguard Worker      type: "pubsub.googleapis.com/Subscription"
1354*d5c09012SAndroid Build Coastguard Worker    }
1355*d5c09012SAndroid Build Coastguard Worker  ];
1356*d5c09012SAndroid Build Coastguard Worker
1357*d5c09012SAndroid Build Coastguard Worker  // Optional. If this field set to true, the system will respond immediately
1358*d5c09012SAndroid Build Coastguard Worker  // even if it there are no messages available to return in the `Pull`
1359*d5c09012SAndroid Build Coastguard Worker  // response. Otherwise, the system may wait (for a bounded amount of time)
1360*d5c09012SAndroid Build Coastguard Worker  // until at least one message is available, rather than returning no messages.
1361*d5c09012SAndroid Build Coastguard Worker  // Warning: setting this field to `true` is discouraged because it adversely
1362*d5c09012SAndroid Build Coastguard Worker  // impacts the performance of `Pull` operations. We recommend that users do
1363*d5c09012SAndroid Build Coastguard Worker  // not set this field.
1364*d5c09012SAndroid Build Coastguard Worker  bool return_immediately = 2
1365*d5c09012SAndroid Build Coastguard Worker      [deprecated = true, (google.api.field_behavior) = OPTIONAL];
1366*d5c09012SAndroid Build Coastguard Worker
1367*d5c09012SAndroid Build Coastguard Worker  // Required. The maximum number of messages to return for this request. Must
1368*d5c09012SAndroid Build Coastguard Worker  // be a positive integer. The Pub/Sub system may return fewer than the number
1369*d5c09012SAndroid Build Coastguard Worker  // specified.
1370*d5c09012SAndroid Build Coastguard Worker  int32 max_messages = 3 [(google.api.field_behavior) = REQUIRED];
1371*d5c09012SAndroid Build Coastguard Worker}
1372*d5c09012SAndroid Build Coastguard Worker
1373*d5c09012SAndroid Build Coastguard Worker// Response for the `Pull` method.
1374*d5c09012SAndroid Build Coastguard Workermessage PullResponse {
1375*d5c09012SAndroid Build Coastguard Worker  // Optional. Received Pub/Sub messages. The list will be empty if there are no
1376*d5c09012SAndroid Build Coastguard Worker  // more messages available in the backlog, or if no messages could be returned
1377*d5c09012SAndroid Build Coastguard Worker  // before the request timeout. For JSON, the response can be entirely
1378*d5c09012SAndroid Build Coastguard Worker  // empty. The Pub/Sub system may return fewer than the `maxMessages` requested
1379*d5c09012SAndroid Build Coastguard Worker  // even if there are more messages available in the backlog.
1380*d5c09012SAndroid Build Coastguard Worker  repeated ReceivedMessage received_messages = 1
1381*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
1382*d5c09012SAndroid Build Coastguard Worker}
1383*d5c09012SAndroid Build Coastguard Worker
1384*d5c09012SAndroid Build Coastguard Worker// Request for the ModifyAckDeadline method.
1385*d5c09012SAndroid Build Coastguard Workermessage ModifyAckDeadlineRequest {
1386*d5c09012SAndroid Build Coastguard Worker  // Required. The name of the subscription.
1387*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project}/subscriptions/{sub}`.
1388*d5c09012SAndroid Build Coastguard Worker  string subscription = 1 [
1389*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
1390*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
1391*d5c09012SAndroid Build Coastguard Worker      type: "pubsub.googleapis.com/Subscription"
1392*d5c09012SAndroid Build Coastguard Worker    }
1393*d5c09012SAndroid Build Coastguard Worker  ];
1394*d5c09012SAndroid Build Coastguard Worker
1395*d5c09012SAndroid Build Coastguard Worker  // Required. List of acknowledgment IDs.
1396*d5c09012SAndroid Build Coastguard Worker  repeated string ack_ids = 4 [(google.api.field_behavior) = REQUIRED];
1397*d5c09012SAndroid Build Coastguard Worker
1398*d5c09012SAndroid Build Coastguard Worker  // Required. The new ack deadline with respect to the time this request was
1399*d5c09012SAndroid Build Coastguard Worker  // sent to the Pub/Sub system. For example, if the value is 10, the new ack
1400*d5c09012SAndroid Build Coastguard Worker  // deadline will expire 10 seconds after the `ModifyAckDeadline` call was
1401*d5c09012SAndroid Build Coastguard Worker  // made. Specifying zero might immediately make the message available for
1402*d5c09012SAndroid Build Coastguard Worker  // delivery to another subscriber client. This typically results in an
1403*d5c09012SAndroid Build Coastguard Worker  // increase in the rate of message redeliveries (that is, duplicates).
1404*d5c09012SAndroid Build Coastguard Worker  // The minimum deadline you can specify is 0 seconds.
1405*d5c09012SAndroid Build Coastguard Worker  // The maximum deadline you can specify in a single request is 600 seconds
1406*d5c09012SAndroid Build Coastguard Worker  // (10 minutes).
1407*d5c09012SAndroid Build Coastguard Worker  int32 ack_deadline_seconds = 3 [(google.api.field_behavior) = REQUIRED];
1408*d5c09012SAndroid Build Coastguard Worker}
1409*d5c09012SAndroid Build Coastguard Worker
1410*d5c09012SAndroid Build Coastguard Worker// Request for the Acknowledge method.
1411*d5c09012SAndroid Build Coastguard Workermessage AcknowledgeRequest {
1412*d5c09012SAndroid Build Coastguard Worker  // Required. The subscription whose message is being acknowledged.
1413*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project}/subscriptions/{sub}`.
1414*d5c09012SAndroid Build Coastguard Worker  string subscription = 1 [
1415*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
1416*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
1417*d5c09012SAndroid Build Coastguard Worker      type: "pubsub.googleapis.com/Subscription"
1418*d5c09012SAndroid Build Coastguard Worker    }
1419*d5c09012SAndroid Build Coastguard Worker  ];
1420*d5c09012SAndroid Build Coastguard Worker
1421*d5c09012SAndroid Build Coastguard Worker  // Required. The acknowledgment ID for the messages being acknowledged that
1422*d5c09012SAndroid Build Coastguard Worker  // was returned by the Pub/Sub system in the `Pull` response. Must not be
1423*d5c09012SAndroid Build Coastguard Worker  // empty.
1424*d5c09012SAndroid Build Coastguard Worker  repeated string ack_ids = 2 [(google.api.field_behavior) = REQUIRED];
1425*d5c09012SAndroid Build Coastguard Worker}
1426*d5c09012SAndroid Build Coastguard Worker
1427*d5c09012SAndroid Build Coastguard Worker// Request for the `StreamingPull` streaming RPC method. This request is used to
1428*d5c09012SAndroid Build Coastguard Worker// establish the initial stream as well as to stream acknowledgements and ack
1429*d5c09012SAndroid Build Coastguard Worker// deadline modifications from the client to the server.
1430*d5c09012SAndroid Build Coastguard Workermessage StreamingPullRequest {
1431*d5c09012SAndroid Build Coastguard Worker  // Required. The subscription for which to initialize the new stream. This
1432*d5c09012SAndroid Build Coastguard Worker  // must be provided in the first request on the stream, and must not be set in
1433*d5c09012SAndroid Build Coastguard Worker  // subsequent requests from client to server.
1434*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project}/subscriptions/{sub}`.
1435*d5c09012SAndroid Build Coastguard Worker  string subscription = 1 [
1436*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
1437*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
1438*d5c09012SAndroid Build Coastguard Worker      type: "pubsub.googleapis.com/Subscription"
1439*d5c09012SAndroid Build Coastguard Worker    }
1440*d5c09012SAndroid Build Coastguard Worker  ];
1441*d5c09012SAndroid Build Coastguard Worker
1442*d5c09012SAndroid Build Coastguard Worker  // Optional. List of acknowledgement IDs for acknowledging previously received
1443*d5c09012SAndroid Build Coastguard Worker  // messages (received on this stream or a different stream). If an ack ID has
1444*d5c09012SAndroid Build Coastguard Worker  // expired, the corresponding message may be redelivered later. Acknowledging
1445*d5c09012SAndroid Build Coastguard Worker  // a message more than once will not result in an error. If the
1446*d5c09012SAndroid Build Coastguard Worker  // acknowledgement ID is malformed, the stream will be aborted with status
1447*d5c09012SAndroid Build Coastguard Worker  // `INVALID_ARGUMENT`.
1448*d5c09012SAndroid Build Coastguard Worker  repeated string ack_ids = 2 [(google.api.field_behavior) = OPTIONAL];
1449*d5c09012SAndroid Build Coastguard Worker
1450*d5c09012SAndroid Build Coastguard Worker  // Optional. The list of new ack deadlines for the IDs listed in
1451*d5c09012SAndroid Build Coastguard Worker  // `modify_deadline_ack_ids`. The size of this list must be the same as the
1452*d5c09012SAndroid Build Coastguard Worker  // size of `modify_deadline_ack_ids`. If it differs the stream will be aborted
1453*d5c09012SAndroid Build Coastguard Worker  // with `INVALID_ARGUMENT`. Each element in this list is applied to the
1454*d5c09012SAndroid Build Coastguard Worker  // element in the same position in `modify_deadline_ack_ids`. The new ack
1455*d5c09012SAndroid Build Coastguard Worker  // deadline is with respect to the time this request was sent to the Pub/Sub
1456*d5c09012SAndroid Build Coastguard Worker  // system. Must be >= 0. For example, if the value is 10, the new ack deadline
1457*d5c09012SAndroid Build Coastguard Worker  // will expire 10 seconds after this request is received. If the value is 0,
1458*d5c09012SAndroid Build Coastguard Worker  // the message is immediately made available for another streaming or
1459*d5c09012SAndroid Build Coastguard Worker  // non-streaming pull request. If the value is < 0 (an error), the stream will
1460*d5c09012SAndroid Build Coastguard Worker  // be aborted with status `INVALID_ARGUMENT`.
1461*d5c09012SAndroid Build Coastguard Worker  repeated int32 modify_deadline_seconds = 3
1462*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
1463*d5c09012SAndroid Build Coastguard Worker
1464*d5c09012SAndroid Build Coastguard Worker  // Optional. List of acknowledgement IDs whose deadline will be modified based
1465*d5c09012SAndroid Build Coastguard Worker  // on the corresponding element in `modify_deadline_seconds`. This field can
1466*d5c09012SAndroid Build Coastguard Worker  // be used to indicate that more time is needed to process a message by the
1467*d5c09012SAndroid Build Coastguard Worker  // subscriber, or to make the message available for redelivery if the
1468*d5c09012SAndroid Build Coastguard Worker  // processing was interrupted.
1469*d5c09012SAndroid Build Coastguard Worker  repeated string modify_deadline_ack_ids = 4
1470*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
1471*d5c09012SAndroid Build Coastguard Worker
1472*d5c09012SAndroid Build Coastguard Worker  // Required. The ack deadline to use for the stream. This must be provided in
1473*d5c09012SAndroid Build Coastguard Worker  // the first request on the stream, but it can also be updated on subsequent
1474*d5c09012SAndroid Build Coastguard Worker  // requests from client to server. The minimum deadline you can specify is 10
1475*d5c09012SAndroid Build Coastguard Worker  // seconds. The maximum deadline you can specify is 600 seconds (10 minutes).
1476*d5c09012SAndroid Build Coastguard Worker  int32 stream_ack_deadline_seconds = 5
1477*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = REQUIRED];
1478*d5c09012SAndroid Build Coastguard Worker
1479*d5c09012SAndroid Build Coastguard Worker  // Optional. A unique identifier that is used to distinguish client instances
1480*d5c09012SAndroid Build Coastguard Worker  // from each other. Only needs to be provided on the initial request. When a
1481*d5c09012SAndroid Build Coastguard Worker  // stream disconnects and reconnects for the same stream, the client_id should
1482*d5c09012SAndroid Build Coastguard Worker  // be set to the same value so that state associated with the old stream can
1483*d5c09012SAndroid Build Coastguard Worker  // be transferred to the new stream. The same client_id should not be used for
1484*d5c09012SAndroid Build Coastguard Worker  // different client instances.
1485*d5c09012SAndroid Build Coastguard Worker  string client_id = 6 [(google.api.field_behavior) = OPTIONAL];
1486*d5c09012SAndroid Build Coastguard Worker
1487*d5c09012SAndroid Build Coastguard Worker  // Optional. Flow control settings for the maximum number of outstanding
1488*d5c09012SAndroid Build Coastguard Worker  // messages. When there are `max_outstanding_messages` currently sent to the
1489*d5c09012SAndroid Build Coastguard Worker  // streaming pull client that have not yet been acked or nacked, the server
1490*d5c09012SAndroid Build Coastguard Worker  // stops sending more messages. The sending of messages resumes once the
1491*d5c09012SAndroid Build Coastguard Worker  // number of outstanding messages is less than this value. If the value is
1492*d5c09012SAndroid Build Coastguard Worker  // <= 0, there is no limit to the number of outstanding messages. This
1493*d5c09012SAndroid Build Coastguard Worker  // property can only be set on the initial StreamingPullRequest. If it is set
1494*d5c09012SAndroid Build Coastguard Worker  // on a subsequent request, the stream will be aborted with status
1495*d5c09012SAndroid Build Coastguard Worker  // `INVALID_ARGUMENT`.
1496*d5c09012SAndroid Build Coastguard Worker  int64 max_outstanding_messages = 7 [(google.api.field_behavior) = OPTIONAL];
1497*d5c09012SAndroid Build Coastguard Worker
1498*d5c09012SAndroid Build Coastguard Worker  // Optional. Flow control settings for the maximum number of outstanding
1499*d5c09012SAndroid Build Coastguard Worker  // bytes. When there are `max_outstanding_bytes` or more worth of messages
1500*d5c09012SAndroid Build Coastguard Worker  // currently sent to the streaming pull client that have not yet been acked or
1501*d5c09012SAndroid Build Coastguard Worker  // nacked, the server will stop sending more messages. The sending of messages
1502*d5c09012SAndroid Build Coastguard Worker  // resumes once the number of outstanding bytes is less than this value. If
1503*d5c09012SAndroid Build Coastguard Worker  // the value is <= 0, there is no limit to the number of outstanding bytes.
1504*d5c09012SAndroid Build Coastguard Worker  // This property can only be set on the initial StreamingPullRequest. If it is
1505*d5c09012SAndroid Build Coastguard Worker  // set on a subsequent request, the stream will be aborted with status
1506*d5c09012SAndroid Build Coastguard Worker  // `INVALID_ARGUMENT`.
1507*d5c09012SAndroid Build Coastguard Worker  int64 max_outstanding_bytes = 8 [(google.api.field_behavior) = OPTIONAL];
1508*d5c09012SAndroid Build Coastguard Worker}
1509*d5c09012SAndroid Build Coastguard Worker
1510*d5c09012SAndroid Build Coastguard Worker// Response for the `StreamingPull` method. This response is used to stream
1511*d5c09012SAndroid Build Coastguard Worker// messages from the server to the client.
1512*d5c09012SAndroid Build Coastguard Workermessage StreamingPullResponse {
1513*d5c09012SAndroid Build Coastguard Worker  // Acknowledgement IDs sent in one or more previous requests to acknowledge a
1514*d5c09012SAndroid Build Coastguard Worker  // previously received message.
1515*d5c09012SAndroid Build Coastguard Worker  message AcknowledgeConfirmation {
1516*d5c09012SAndroid Build Coastguard Worker    // Optional. Successfully processed acknowledgement IDs.
1517*d5c09012SAndroid Build Coastguard Worker    repeated string ack_ids = 1 [(google.api.field_behavior) = OPTIONAL];
1518*d5c09012SAndroid Build Coastguard Worker
1519*d5c09012SAndroid Build Coastguard Worker    // Optional. List of acknowledgement IDs that were malformed or whose
1520*d5c09012SAndroid Build Coastguard Worker    // acknowledgement deadline has expired.
1521*d5c09012SAndroid Build Coastguard Worker    repeated string invalid_ack_ids = 2
1522*d5c09012SAndroid Build Coastguard Worker        [(google.api.field_behavior) = OPTIONAL];
1523*d5c09012SAndroid Build Coastguard Worker
1524*d5c09012SAndroid Build Coastguard Worker    // Optional. List of acknowledgement IDs that were out of order.
1525*d5c09012SAndroid Build Coastguard Worker    repeated string unordered_ack_ids = 3
1526*d5c09012SAndroid Build Coastguard Worker        [(google.api.field_behavior) = OPTIONAL];
1527*d5c09012SAndroid Build Coastguard Worker
1528*d5c09012SAndroid Build Coastguard Worker    // Optional. List of acknowledgement IDs that failed processing with
1529*d5c09012SAndroid Build Coastguard Worker    // temporary issues.
1530*d5c09012SAndroid Build Coastguard Worker    repeated string temporary_failed_ack_ids = 4
1531*d5c09012SAndroid Build Coastguard Worker        [(google.api.field_behavior) = OPTIONAL];
1532*d5c09012SAndroid Build Coastguard Worker  }
1533*d5c09012SAndroid Build Coastguard Worker
1534*d5c09012SAndroid Build Coastguard Worker  // Acknowledgement IDs sent in one or more previous requests to modify the
1535*d5c09012SAndroid Build Coastguard Worker  // deadline for a specific message.
1536*d5c09012SAndroid Build Coastguard Worker  message ModifyAckDeadlineConfirmation {
1537*d5c09012SAndroid Build Coastguard Worker    // Optional. Successfully processed acknowledgement IDs.
1538*d5c09012SAndroid Build Coastguard Worker    repeated string ack_ids = 1 [(google.api.field_behavior) = OPTIONAL];
1539*d5c09012SAndroid Build Coastguard Worker
1540*d5c09012SAndroid Build Coastguard Worker    // Optional. List of acknowledgement IDs that were malformed or whose
1541*d5c09012SAndroid Build Coastguard Worker    // acknowledgement deadline has expired.
1542*d5c09012SAndroid Build Coastguard Worker    repeated string invalid_ack_ids = 2
1543*d5c09012SAndroid Build Coastguard Worker        [(google.api.field_behavior) = OPTIONAL];
1544*d5c09012SAndroid Build Coastguard Worker
1545*d5c09012SAndroid Build Coastguard Worker    // Optional. List of acknowledgement IDs that failed processing with
1546*d5c09012SAndroid Build Coastguard Worker    // temporary issues.
1547*d5c09012SAndroid Build Coastguard Worker    repeated string temporary_failed_ack_ids = 3
1548*d5c09012SAndroid Build Coastguard Worker        [(google.api.field_behavior) = OPTIONAL];
1549*d5c09012SAndroid Build Coastguard Worker  }
1550*d5c09012SAndroid Build Coastguard Worker
1551*d5c09012SAndroid Build Coastguard Worker  // Subscription properties sent as part of the response.
1552*d5c09012SAndroid Build Coastguard Worker  message SubscriptionProperties {
1553*d5c09012SAndroid Build Coastguard Worker    // Optional. True iff exactly once delivery is enabled for this
1554*d5c09012SAndroid Build Coastguard Worker    // subscription.
1555*d5c09012SAndroid Build Coastguard Worker    bool exactly_once_delivery_enabled = 1
1556*d5c09012SAndroid Build Coastguard Worker        [(google.api.field_behavior) = OPTIONAL];
1557*d5c09012SAndroid Build Coastguard Worker
1558*d5c09012SAndroid Build Coastguard Worker    // Optional. True iff message ordering is enabled for this subscription.
1559*d5c09012SAndroid Build Coastguard Worker    bool message_ordering_enabled = 2 [(google.api.field_behavior) = OPTIONAL];
1560*d5c09012SAndroid Build Coastguard Worker  }
1561*d5c09012SAndroid Build Coastguard Worker
1562*d5c09012SAndroid Build Coastguard Worker  // Optional. Received Pub/Sub messages. This will not be empty.
1563*d5c09012SAndroid Build Coastguard Worker  repeated ReceivedMessage received_messages = 1
1564*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
1565*d5c09012SAndroid Build Coastguard Worker
1566*d5c09012SAndroid Build Coastguard Worker  // Optional. This field will only be set if `enable_exactly_once_delivery` is
1567*d5c09012SAndroid Build Coastguard Worker  // set to `true`.
1568*d5c09012SAndroid Build Coastguard Worker  AcknowledgeConfirmation acknowledge_confirmation = 5
1569*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
1570*d5c09012SAndroid Build Coastguard Worker
1571*d5c09012SAndroid Build Coastguard Worker  // Optional. This field will only be set if `enable_exactly_once_delivery` is
1572*d5c09012SAndroid Build Coastguard Worker  // set to `true`.
1573*d5c09012SAndroid Build Coastguard Worker  ModifyAckDeadlineConfirmation modify_ack_deadline_confirmation = 3
1574*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
1575*d5c09012SAndroid Build Coastguard Worker
1576*d5c09012SAndroid Build Coastguard Worker  // Optional. Properties associated with this subscription.
1577*d5c09012SAndroid Build Coastguard Worker  SubscriptionProperties subscription_properties = 4
1578*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
1579*d5c09012SAndroid Build Coastguard Worker}
1580*d5c09012SAndroid Build Coastguard Worker
1581*d5c09012SAndroid Build Coastguard Worker// Request for the `CreateSnapshot` method.
1582*d5c09012SAndroid Build Coastguard Workermessage CreateSnapshotRequest {
1583*d5c09012SAndroid Build Coastguard Worker  // Required. User-provided name for this snapshot. If the name is not provided
1584*d5c09012SAndroid Build Coastguard Worker  // in the request, the server will assign a random name for this snapshot on
1585*d5c09012SAndroid Build Coastguard Worker  // the same project as the subscription. Note that for REST API requests, you
1586*d5c09012SAndroid Build Coastguard Worker  // must specify a name.  See the [resource name
1587*d5c09012SAndroid Build Coastguard Worker  // rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
1588*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project}/snapshots/{snap}`.
1589*d5c09012SAndroid Build Coastguard Worker  string name = 1 [
1590*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
1591*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" }
1592*d5c09012SAndroid Build Coastguard Worker  ];
1593*d5c09012SAndroid Build Coastguard Worker
1594*d5c09012SAndroid Build Coastguard Worker  // Required. The subscription whose backlog the snapshot retains.
1595*d5c09012SAndroid Build Coastguard Worker  // Specifically, the created snapshot is guaranteed to retain:
1596*d5c09012SAndroid Build Coastguard Worker  //  (a) The existing backlog on the subscription. More precisely, this is
1597*d5c09012SAndroid Build Coastguard Worker  //      defined as the messages in the subscription's backlog that are
1598*d5c09012SAndroid Build Coastguard Worker  //      unacknowledged upon the successful completion of the
1599*d5c09012SAndroid Build Coastguard Worker  //      `CreateSnapshot` request; as well as:
1600*d5c09012SAndroid Build Coastguard Worker  //  (b) Any messages published to the subscription's topic following the
1601*d5c09012SAndroid Build Coastguard Worker  //      successful completion of the CreateSnapshot request.
1602*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project}/subscriptions/{sub}`.
1603*d5c09012SAndroid Build Coastguard Worker  string subscription = 2 [
1604*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
1605*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
1606*d5c09012SAndroid Build Coastguard Worker      type: "pubsub.googleapis.com/Subscription"
1607*d5c09012SAndroid Build Coastguard Worker    }
1608*d5c09012SAndroid Build Coastguard Worker  ];
1609*d5c09012SAndroid Build Coastguard Worker
1610*d5c09012SAndroid Build Coastguard Worker  // Optional. See [Creating and managing
1611*d5c09012SAndroid Build Coastguard Worker  // labels](https://cloud.google.com/pubsub/docs/labels).
1612*d5c09012SAndroid Build Coastguard Worker  map<string, string> labels = 3 [(google.api.field_behavior) = OPTIONAL];
1613*d5c09012SAndroid Build Coastguard Worker}
1614*d5c09012SAndroid Build Coastguard Worker
1615*d5c09012SAndroid Build Coastguard Worker// Request for the UpdateSnapshot method.
1616*d5c09012SAndroid Build Coastguard Workermessage UpdateSnapshotRequest {
1617*d5c09012SAndroid Build Coastguard Worker  // Required. The updated snapshot object.
1618*d5c09012SAndroid Build Coastguard Worker  Snapshot snapshot = 1 [(google.api.field_behavior) = REQUIRED];
1619*d5c09012SAndroid Build Coastguard Worker
1620*d5c09012SAndroid Build Coastguard Worker  // Required. Indicates which fields in the provided snapshot to update.
1621*d5c09012SAndroid Build Coastguard Worker  // Must be specified and non-empty.
1622*d5c09012SAndroid Build Coastguard Worker  google.protobuf.FieldMask update_mask = 2
1623*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = REQUIRED];
1624*d5c09012SAndroid Build Coastguard Worker}
1625*d5c09012SAndroid Build Coastguard Worker
1626*d5c09012SAndroid Build Coastguard Worker// A snapshot resource. Snapshots are used in
1627*d5c09012SAndroid Build Coastguard Worker// [Seek](https://cloud.google.com/pubsub/docs/replay-overview)
1628*d5c09012SAndroid Build Coastguard Worker// operations, which allow you to manage message acknowledgments in bulk. That
1629*d5c09012SAndroid Build Coastguard Worker// is, you can set the acknowledgment state of messages in an existing
1630*d5c09012SAndroid Build Coastguard Worker// subscription to the state captured by a snapshot.
1631*d5c09012SAndroid Build Coastguard Workermessage Snapshot {
1632*d5c09012SAndroid Build Coastguard Worker  option (google.api.resource) = {
1633*d5c09012SAndroid Build Coastguard Worker    type: "pubsub.googleapis.com/Snapshot"
1634*d5c09012SAndroid Build Coastguard Worker    pattern: "projects/{project}/snapshots/{snapshot}"
1635*d5c09012SAndroid Build Coastguard Worker  };
1636*d5c09012SAndroid Build Coastguard Worker
1637*d5c09012SAndroid Build Coastguard Worker  // Optional. The name of the snapshot.
1638*d5c09012SAndroid Build Coastguard Worker  string name = 1 [(google.api.field_behavior) = OPTIONAL];
1639*d5c09012SAndroid Build Coastguard Worker
1640*d5c09012SAndroid Build Coastguard Worker  // Optional. The name of the topic from which this snapshot is retaining
1641*d5c09012SAndroid Build Coastguard Worker  // messages.
1642*d5c09012SAndroid Build Coastguard Worker  string topic = 2 [
1643*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = OPTIONAL,
1644*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
1645*d5c09012SAndroid Build Coastguard Worker  ];
1646*d5c09012SAndroid Build Coastguard Worker
1647*d5c09012SAndroid Build Coastguard Worker  // Optional. The snapshot is guaranteed to exist up until this time.
1648*d5c09012SAndroid Build Coastguard Worker  // A newly-created snapshot expires no later than 7 days from the time of its
1649*d5c09012SAndroid Build Coastguard Worker  // creation. Its exact lifetime is determined at creation by the existing
1650*d5c09012SAndroid Build Coastguard Worker  // backlog in the source subscription. Specifically, the lifetime of the
1651*d5c09012SAndroid Build Coastguard Worker  // snapshot is `7 days - (age of oldest unacked message in the subscription)`.
1652*d5c09012SAndroid Build Coastguard Worker  // For example, consider a subscription whose oldest unacked message is 3 days
1653*d5c09012SAndroid Build Coastguard Worker  // old. If a snapshot is created from this subscription, the snapshot -- which
1654*d5c09012SAndroid Build Coastguard Worker  // will always capture this 3-day-old backlog as long as the snapshot
1655*d5c09012SAndroid Build Coastguard Worker  // exists -- will expire in 4 days. The service will refuse to create a
1656*d5c09012SAndroid Build Coastguard Worker  // snapshot that would expire in less than 1 hour after creation.
1657*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Timestamp expire_time = 3
1658*d5c09012SAndroid Build Coastguard Worker      [(google.api.field_behavior) = OPTIONAL];
1659*d5c09012SAndroid Build Coastguard Worker
1660*d5c09012SAndroid Build Coastguard Worker  // Optional. See [Creating and managing labels]
1661*d5c09012SAndroid Build Coastguard Worker  // (https://cloud.google.com/pubsub/docs/labels).
1662*d5c09012SAndroid Build Coastguard Worker  map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];
1663*d5c09012SAndroid Build Coastguard Worker}
1664*d5c09012SAndroid Build Coastguard Worker
1665*d5c09012SAndroid Build Coastguard Worker// Request for the GetSnapshot method.
1666*d5c09012SAndroid Build Coastguard Workermessage GetSnapshotRequest {
1667*d5c09012SAndroid Build Coastguard Worker  // Required. The name of the snapshot to get.
1668*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project}/snapshots/{snap}`.
1669*d5c09012SAndroid Build Coastguard Worker  string snapshot = 1 [
1670*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
1671*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" }
1672*d5c09012SAndroid Build Coastguard Worker  ];
1673*d5c09012SAndroid Build Coastguard Worker}
1674*d5c09012SAndroid Build Coastguard Worker
1675*d5c09012SAndroid Build Coastguard Worker// Request for the `ListSnapshots` method.
1676*d5c09012SAndroid Build Coastguard Workermessage ListSnapshotsRequest {
1677*d5c09012SAndroid Build Coastguard Worker  // Required. The name of the project in which to list snapshots.
1678*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project-id}`.
1679*d5c09012SAndroid Build Coastguard Worker  string project = 1 [
1680*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
1681*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
1682*d5c09012SAndroid Build Coastguard Worker      type: "cloudresourcemanager.googleapis.com/Project"
1683*d5c09012SAndroid Build Coastguard Worker    }
1684*d5c09012SAndroid Build Coastguard Worker  ];
1685*d5c09012SAndroid Build Coastguard Worker
1686*d5c09012SAndroid Build Coastguard Worker  // Optional. Maximum number of snapshots to return.
1687*d5c09012SAndroid Build Coastguard Worker  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
1688*d5c09012SAndroid Build Coastguard Worker
1689*d5c09012SAndroid Build Coastguard Worker  // Optional. The value returned by the last `ListSnapshotsResponse`; indicates
1690*d5c09012SAndroid Build Coastguard Worker  // that this is a continuation of a prior `ListSnapshots` call, and that the
1691*d5c09012SAndroid Build Coastguard Worker  // system should return the next page of data.
1692*d5c09012SAndroid Build Coastguard Worker  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
1693*d5c09012SAndroid Build Coastguard Worker}
1694*d5c09012SAndroid Build Coastguard Worker
1695*d5c09012SAndroid Build Coastguard Worker// Response for the `ListSnapshots` method.
1696*d5c09012SAndroid Build Coastguard Workermessage ListSnapshotsResponse {
1697*d5c09012SAndroid Build Coastguard Worker  // Optional. The resulting snapshots.
1698*d5c09012SAndroid Build Coastguard Worker  repeated Snapshot snapshots = 1 [(google.api.field_behavior) = OPTIONAL];
1699*d5c09012SAndroid Build Coastguard Worker
1700*d5c09012SAndroid Build Coastguard Worker  // Optional. If not empty, indicates that there may be more snapshot that
1701*d5c09012SAndroid Build Coastguard Worker  // match the request; this value should be passed in a new
1702*d5c09012SAndroid Build Coastguard Worker  // `ListSnapshotsRequest`.
1703*d5c09012SAndroid Build Coastguard Worker  string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL];
1704*d5c09012SAndroid Build Coastguard Worker}
1705*d5c09012SAndroid Build Coastguard Worker
1706*d5c09012SAndroid Build Coastguard Worker// Request for the `DeleteSnapshot` method.
1707*d5c09012SAndroid Build Coastguard Workermessage DeleteSnapshotRequest {
1708*d5c09012SAndroid Build Coastguard Worker  // Required. The name of the snapshot to delete.
1709*d5c09012SAndroid Build Coastguard Worker  // Format is `projects/{project}/snapshots/{snap}`.
1710*d5c09012SAndroid Build Coastguard Worker  string snapshot = 1 [
1711*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
1712*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" }
1713*d5c09012SAndroid Build Coastguard Worker  ];
1714*d5c09012SAndroid Build Coastguard Worker}
1715*d5c09012SAndroid Build Coastguard Worker
1716*d5c09012SAndroid Build Coastguard Worker// Request for the `Seek` method.
1717*d5c09012SAndroid Build Coastguard Workermessage SeekRequest {
1718*d5c09012SAndroid Build Coastguard Worker  // Required. The subscription to affect.
1719*d5c09012SAndroid Build Coastguard Worker  string subscription = 1 [
1720*d5c09012SAndroid Build Coastguard Worker    (google.api.field_behavior) = REQUIRED,
1721*d5c09012SAndroid Build Coastguard Worker    (google.api.resource_reference) = {
1722*d5c09012SAndroid Build Coastguard Worker      type: "pubsub.googleapis.com/Subscription"
1723*d5c09012SAndroid Build Coastguard Worker    }
1724*d5c09012SAndroid Build Coastguard Worker  ];
1725*d5c09012SAndroid Build Coastguard Worker
1726*d5c09012SAndroid Build Coastguard Worker  oneof target {
1727*d5c09012SAndroid Build Coastguard Worker    // Optional. The time to seek to.
1728*d5c09012SAndroid Build Coastguard Worker    // Messages retained in the subscription that were published before this
1729*d5c09012SAndroid Build Coastguard Worker    // time are marked as acknowledged, and messages retained in the
1730*d5c09012SAndroid Build Coastguard Worker    // subscription that were published after this time are marked as
1731*d5c09012SAndroid Build Coastguard Worker    // unacknowledged. Note that this operation affects only those messages
1732*d5c09012SAndroid Build Coastguard Worker    // retained in the subscription (configured by the combination of
1733*d5c09012SAndroid Build Coastguard Worker    // `message_retention_duration` and `retain_acked_messages`). For example,
1734*d5c09012SAndroid Build Coastguard Worker    // if `time` corresponds to a point before the message retention
1735*d5c09012SAndroid Build Coastguard Worker    // window (or to a point before the system's notion of the subscription
1736*d5c09012SAndroid Build Coastguard Worker    // creation time), only retained messages will be marked as unacknowledged,
1737*d5c09012SAndroid Build Coastguard Worker    // and already-expunged messages will not be restored.
1738*d5c09012SAndroid Build Coastguard Worker    google.protobuf.Timestamp time = 2 [(google.api.field_behavior) = OPTIONAL];
1739*d5c09012SAndroid Build Coastguard Worker
1740*d5c09012SAndroid Build Coastguard Worker    // Optional. The snapshot to seek to. The snapshot's topic must be the same
1741*d5c09012SAndroid Build Coastguard Worker    // as that of the provided subscription. Format is
1742*d5c09012SAndroid Build Coastguard Worker    // `projects/{project}/snapshots/{snap}`.
1743*d5c09012SAndroid Build Coastguard Worker    string snapshot = 3 [
1744*d5c09012SAndroid Build Coastguard Worker      (google.api.field_behavior) = OPTIONAL,
1745*d5c09012SAndroid Build Coastguard Worker      (google.api.resource_reference) = {
1746*d5c09012SAndroid Build Coastguard Worker        type: "pubsub.googleapis.com/Snapshot"
1747*d5c09012SAndroid Build Coastguard Worker      }
1748*d5c09012SAndroid Build Coastguard Worker    ];
1749*d5c09012SAndroid Build Coastguard Worker  }
1750*d5c09012SAndroid Build Coastguard Worker}
1751*d5c09012SAndroid Build Coastguard Worker
1752*d5c09012SAndroid Build Coastguard Worker// Response for the `Seek` method (this response is empty).
1753*d5c09012SAndroid Build Coastguard Workermessage SeekResponse {}
1754