blob: a3fb4c83a2fdfb27def2e768ebdb3f5458e5fec4 [file] [log] [blame]
Takashi Matsuo06694102015-09-11 13:55:40 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070075<h1><a href="pubsub_v1.html">Cloud Pub/Sub API</a> . <a href="pubsub_v1.projects.html">projects</a> . <a href="pubsub_v1.projects.subscriptions.html">subscriptions</a></h1>
Takashi Matsuo06694102015-09-11 13:55:40 -070076<h2>Instance Methods</h2>
77<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#acknowledge">acknowledge(subscription, body=None, x__xgafv=None)</a></code></p>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -080079<p class="firstline">Acknowledges the messages associated with the `ack_ids` in the</p>
Takashi Matsuo06694102015-09-11 13:55:40 -070080<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070081 <code><a href="#create">create(name, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070082<p class="firstline">Creates a subscription to a given topic. See the</p>
Takashi Matsuo06694102015-09-11 13:55:40 -070083<p class="toc_element">
Thomas Coffee2f245372017-03-27 10:39:26 -070084 <code><a href="#delete">delete(subscription, x__xgafv=None)</a></code></p>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -080085<p class="firstline">Deletes an existing subscription. All messages retained in the subscription</p>
Takashi Matsuo06694102015-09-11 13:55:40 -070086<p class="toc_element">
Thomas Coffee2f245372017-03-27 10:39:26 -070087 <code><a href="#get">get(subscription, x__xgafv=None)</a></code></p>
Takashi Matsuo06694102015-09-11 13:55:40 -070088<p class="firstline">Gets the configuration details of a subscription.</p>
89<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070090 <code><a href="#getIamPolicy">getIamPolicy(resource, options_requestedPolicyVersion=None, x__xgafv=None)</a></code></p>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -080091<p class="firstline">Gets the access control policy for a resource.</p>
Takashi Matsuo06694102015-09-11 13:55:40 -070092<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070093 <code><a href="#list">list(project, pageToken=None, pageSize=None, x__xgafv=None)</a></code></p>
Takashi Matsuo06694102015-09-11 13:55:40 -070094<p class="firstline">Lists matching subscriptions.</p>
95<p class="toc_element">
96 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
97<p class="firstline">Retrieves the next page of results.</p>
98<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070099 <code><a href="#modifyAckDeadline">modifyAckDeadline(subscription, body=None, x__xgafv=None)</a></code></p>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800100<p class="firstline">Modifies the ack deadline for a specific message. This method is useful</p>
Takashi Matsuo06694102015-09-11 13:55:40 -0700101<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700102 <code><a href="#modifyPushConfig">modifyPushConfig(subscription, body=None, x__xgafv=None)</a></code></p>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800103<p class="firstline">Modifies the `PushConfig` for a specified subscription.</p>
Takashi Matsuo06694102015-09-11 13:55:40 -0700104<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700105 <code><a href="#patch">patch(name, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700106<p class="firstline">Updates an existing subscription. Note that certain properties of a</p>
107<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700108 <code><a href="#pull">pull(subscription, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700109<p class="firstline">Pulls messages from the server. The server may return `UNAVAILABLE` if</p>
110<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700111 <code><a href="#seek">seek(subscription, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700112<p class="firstline">Seeks an existing subscription to a point in time or to a given snapshot,</p>
Takashi Matsuo06694102015-09-11 13:55:40 -0700113<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700114 <code><a href="#setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</a></code></p>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800115<p class="firstline">Sets the access control policy on the specified resource. Replaces any</p>
Takashi Matsuo06694102015-09-11 13:55:40 -0700116<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700117 <code><a href="#testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</a></code></p>
Takashi Matsuo06694102015-09-11 13:55:40 -0700118<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
119<h3>Method Details</h3>
120<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700121 <code class="details" id="acknowledge">acknowledge(subscription, body=None, x__xgafv=None)</code>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800122 <pre>Acknowledges the messages associated with the `ack_ids` in the
123`AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages
124from the subscription.
125
126Acknowledging a message whose ack deadline has expired may succeed,
127but such a message may be redelivered later. Acknowledging a message more
128than once will not result in an error.
Takashi Matsuo06694102015-09-11 13:55:40 -0700129
130Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700131 subscription: string, Required. The subscription whose message is being acknowledged.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800132Format is `projects/{project}/subscriptions/{sub}`. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700133 body: object, The request body.
Takashi Matsuo06694102015-09-11 13:55:40 -0700134 The object takes the form of:
135
136{ # Request for the Acknowledge method.
Bu Sun Kim65020912020-05-20 12:08:20 -0700137 &quot;ackIds&quot;: [ # Required. The acknowledgment ID for the messages being acknowledged that was returned
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800138 # by the Pub/Sub system in the `Pull` response. Must not be empty.
Bu Sun Kim65020912020-05-20 12:08:20 -0700139 &quot;A String&quot;,
Takashi Matsuo06694102015-09-11 13:55:40 -0700140 ],
141 }
142
143 x__xgafv: string, V1 error format.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800144 Allowed values
145 1 - v1 error format
146 2 - v2 error format
Takashi Matsuo06694102015-09-11 13:55:40 -0700147
148Returns:
149 An object of the form:
150
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800151 { # A generic empty message that you can re-use to avoid defining duplicated
152 # empty messages in your APIs. A typical example is to use it as the request
153 # or the response type of an API method. For instance:
154 #
155 # service Foo {
156 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
157 # }
158 #
159 # The JSON representation for `Empty` is empty JSON object `{}`.
Takashi Matsuo06694102015-09-11 13:55:40 -0700160 }</pre>
161</div>
162
163<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700164 <code class="details" id="create">create(name, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700165 <pre>Creates a subscription to a given topic. See the
Bu Sun Kim65020912020-05-20 12:08:20 -0700166&lt;a href=&quot;https://cloud.google.com/pubsub/docs/admin#resource_names&quot;&gt;
Dan O'Mearadd494642020-05-01 07:42:23 -0700167resource name rules&lt;/a&gt;.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800168If the subscription already exists, returns `ALREADY_EXISTS`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700169If the corresponding topic doesn&#x27;t exist, returns `NOT_FOUND`.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800170
171If the name is not provided in the request, the server will assign a random
172name for this subscription on the same project as the topic, conforming
173to the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700174[resource name
175format](https://cloud.google.com/pubsub/docs/admin#resource_names). The
176generated name is populated in the returned Subscription object. Note that
177for REST API requests, you must specify a name in the request.
Takashi Matsuo06694102015-09-11 13:55:40 -0700178
179Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700180 name: string, Required. The name of the subscription. It must have the format
Bu Sun Kim65020912020-05-20 12:08:20 -0700181`&quot;projects/{project}/subscriptions/{subscription}&quot;`. `{subscription}` must
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800182start with a letter, and contain only letters (`[A-Za-z]`), numbers
183(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
184plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
Bu Sun Kim65020912020-05-20 12:08:20 -0700185in length, and it must not start with `&quot;goog&quot;`. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700186 body: object, The request body.
Takashi Matsuo06694102015-09-11 13:55:40 -0700187 The object takes the form of:
188
189{ # A subscription resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700190 &quot;retainAckedMessages&quot;: True or False, # Indicates whether to retain acknowledged messages. If true, then
191 # messages are not expunged from the subscription&#x27;s backlog, even if they are
192 # acknowledged, until they fall out of the `message_retention_duration`
193 # window. This must be true if you would like to
194 # &lt;a
195 # href=&quot;https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time&quot;&gt;
196 # Seek to a timestamp&lt;/a&gt;.
197 &quot;labels&quot;: { # See &lt;a href=&quot;https://cloud.google.com/pubsub/docs/labels&quot;&gt; Creating and
198 # managing labels&lt;/a&gt;.
199 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700200 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700201 &quot;expirationPolicy&quot;: { # A policy that specifies the conditions for resource expiration (i.e., # A policy that specifies the conditions for this subscription&#x27;s expiration.
202 # A subscription is considered active as long as any connected subscriber is
203 # successfully consuming messages from the subscription or is issuing
204 # operations on the subscription. If `expiration_policy` is not set, a
205 # *default policy* with `ttl` of 31 days will be used. The minimum allowed
206 # value for `expiration_policy.ttl` is 1 day.
207 # automatic resource deletion).
208 &quot;ttl&quot;: &quot;A String&quot;, # Specifies the &quot;time-to-live&quot; duration for an associated resource. The
209 # resource expires if it is not active for a period of `ttl`. The definition
210 # of &quot;activity&quot; depends on the type of the associated resource. The minimum
211 # and maximum allowed values for `ttl` depend on the type of the associated
212 # resource, as well. If `ttl` is not set, the associated resource never
213 # expires.
Dan O'Mearadd494642020-05-01 07:42:23 -0700214 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700215 &quot;deadLetterPolicy&quot;: { # Dead lettering is done on a best effort basis. The same message might be # A policy that specifies the conditions for dead lettering messages in
216 # this subscription. If dead_letter_policy is not set, dead lettering
217 # is disabled.
218 #
219 # The Cloud Pub/Sub service account associated with this subscriptions&#x27;s
220 # parent project (i.e.,
Dan O'Mearadd494642020-05-01 07:42:23 -0700221 # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
Bu Sun Kim65020912020-05-20 12:08:20 -0700222 # permission to Acknowledge() messages on this subscription.
223 # dead lettered multiple times.
Dan O'Mearadd494642020-05-01 07:42:23 -0700224 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700225 # If validation on any of the fields fails at subscription creation/updation,
226 # the create/update subscription request will fail.
227 &quot;deadLetterTopic&quot;: &quot;A String&quot;, # The name of the topic to which dead letter messages should be published.
228 # Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
229 # account associated with the enclosing subscription&#x27;s parent project (i.e.,
230 # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
231 # permission to Publish() to this topic.
232 #
233 # The operation will fail if the topic does not exist.
234 # Users should ensure that there is a subscription attached to this topic
235 # since messages published to a topic with no subscriptions are lost.
236 &quot;maxDeliveryAttempts&quot;: 42, # The maximum number of delivery attempts for any message. The value must be
237 # between 5 and 100.
238 #
239 # The number of delivery attempts is defined as 1 + (the sum of number of
240 # NACKs and number of times the acknowledgement deadline has been exceeded
241 # for the message).
242 #
243 # A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
244 # client libraries may automatically extend ack_deadlines.
245 #
246 # This field will be honored on a best effort basis.
247 #
248 # If this parameter is 0, a default value of 5 is used.
249 },
250 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the subscription. It must have the format
251 # `&quot;projects/{project}/subscriptions/{subscription}&quot;`. `{subscription}` must
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700252 # start with a letter, and contain only letters (`[A-Za-z]`), numbers
253 # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
254 # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
Bu Sun Kim65020912020-05-20 12:08:20 -0700255 # in length, and it must not start with `&quot;goog&quot;`.
256 &quot;topic&quot;: &quot;A String&quot;, # Required. The name of the topic from which this subscription is receiving messages.
257 # Format is `projects/{project}/topics/{topic}`.
258 # The value of this field will be `_deleted-topic_` if the topic has been
259 # deleted.
260 &quot;pushConfig&quot;: { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800261 # used to configure it. An empty `pushConfig` signifies that the subscriber
262 # will pull and ack messages using API methods.
Bu Sun Kim65020912020-05-20 12:08:20 -0700263 &quot;attributes&quot;: { # Endpoint configuration attributes that can be used to control different
Dan O'Mearadd494642020-05-01 07:42:23 -0700264 # aspects of the message delivery.
265 #
266 # The only currently supported attribute is `x-goog-version`, which you can
267 # use to change the format of the pushed message. This attribute
268 # indicates the version of the data expected by the endpoint. This
269 # controls the shape of the pushed message (i.e., its fields and metadata).
270 #
271 # If not present during the `CreateSubscription` call, it will default to
272 # the version of the Pub/Sub API used to make such call. If not present in a
273 # `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
274 # calls will always return a valid version, even if the subscription was
275 # created without this attribute.
276 #
277 # The only supported values for the `x-goog-version` attribute are:
278 #
279 # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
280 # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
281 #
282 # For example:
Bu Sun Kim65020912020-05-20 12:08:20 -0700283 # &lt;pre&gt;&lt;code&gt;attributes { &quot;x-goog-version&quot;: &quot;v1&quot; } &lt;/code&gt;&lt;/pre&gt;
284 &quot;a_key&quot;: &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -0700285 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700286 &quot;pushEndpoint&quot;: &quot;A String&quot;, # A URL locating the endpoint to which messages should be pushed.
287 # For example, a Webhook endpoint might use `https://example.com/push`.
288 &quot;oidcToken&quot;: { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an
289 # `Authorization` header in the HTTP request for every pushed message.
290 # [OpenID Connect
291 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
292 &quot;audience&quot;: &quot;A String&quot;, # Audience to be used when generating OIDC token. The audience claim
293 # identifies the recipients that the JWT is intended for. The audience
294 # value is a single case-sensitive string. Having multiple values (array)
295 # for the audience field is not supported. More info about the OIDC JWT
296 # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
297 # Note: if not specified, the Push endpoint URL will be used.
298 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account
299 # email](https://cloud.google.com/iam/docs/service-accounts)
300 # to be used for generating the OIDC token. The caller (for
301 # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must
302 # have the iam.serviceAccounts.actAs permission for the service account.
303 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700304 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700305 &quot;filter&quot;: &quot;A String&quot;, # An expression written in the Cloud Pub/Sub filter language. If non-empty,
306 # then only `PubsubMessage`s whose `attributes` field matches the filter are
307 # delivered on this subscription. If empty, then no messages are filtered
308 # out.
309 # &lt;b&gt;EXPERIMENTAL:&lt;/b&gt; This feature is part of a closed alpha release. This
310 # API might be changed in backward-incompatible ways and is not recommended
311 # for production use. It is not subject to any SLA or deprecation policy.
312 &quot;ackDeadlineSeconds&quot;: 42, # The approximate amount of time (on a best-effort basis) Pub/Sub waits for
313 # the subscriber to acknowledge receipt before resending the message. In the
314 # interval after the message is delivered and before it is acknowledged, it
315 # is considered to be &lt;i&gt;outstanding&lt;/i&gt;. During that time period, the
316 # message will not be redelivered (on a best-effort basis).
317 #
318 # For pull subscriptions, this value is used as the initial value for the ack
319 # deadline. To override this value for a given message, call
320 # `ModifyAckDeadline` with the corresponding `ack_id` if using
321 # non-streaming pull or send the `ack_id` in a
322 # `StreamingModifyAckDeadlineRequest` if using streaming pull.
323 # The minimum custom deadline you can specify is 10 seconds.
324 # The maximum custom deadline you can specify is 600 seconds (10 minutes).
325 # If this parameter is 0, a default value of 10 seconds is used.
326 #
327 # For push delivery, this value is also used to set the request timeout for
328 # the call to the push endpoint.
329 #
330 # If the subscriber never acknowledges the message, the Pub/Sub
331 # system will eventually redeliver the message.
332 &quot;messageRetentionDuration&quot;: &quot;A String&quot;, # How long to retain unacknowledged messages in the subscription&#x27;s backlog,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700333 # from the moment a message is published.
334 # If `retain_acked_messages` is true, then this also configures the retention
335 # of acknowledged messages, and thus configures how far back in time a `Seek`
336 # can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
337 # minutes.
Bu Sun Kim65020912020-05-20 12:08:20 -0700338 }
339
340 x__xgafv: string, V1 error format.
341 Allowed values
342 1 - v1 error format
343 2 - v2 error format
344
345Returns:
346 An object of the form:
347
348 { # A subscription resource.
349 &quot;retainAckedMessages&quot;: True or False, # Indicates whether to retain acknowledged messages. If true, then
350 # messages are not expunged from the subscription&#x27;s backlog, even if they are
351 # acknowledged, until they fall out of the `message_retention_duration`
352 # window. This must be true if you would like to
353 # &lt;a
354 # href=&quot;https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time&quot;&gt;
355 # Seek to a timestamp&lt;/a&gt;.
356 &quot;labels&quot;: { # See &lt;a href=&quot;https://cloud.google.com/pubsub/docs/labels&quot;&gt; Creating and
357 # managing labels&lt;/a&gt;.
358 &quot;a_key&quot;: &quot;A String&quot;,
359 },
360 &quot;expirationPolicy&quot;: { # A policy that specifies the conditions for resource expiration (i.e., # A policy that specifies the conditions for this subscription&#x27;s expiration.
361 # A subscription is considered active as long as any connected subscriber is
362 # successfully consuming messages from the subscription or is issuing
363 # operations on the subscription. If `expiration_policy` is not set, a
364 # *default policy* with `ttl` of 31 days will be used. The minimum allowed
365 # value for `expiration_policy.ttl` is 1 day.
366 # automatic resource deletion).
367 &quot;ttl&quot;: &quot;A String&quot;, # Specifies the &quot;time-to-live&quot; duration for an associated resource. The
368 # resource expires if it is not active for a period of `ttl`. The definition
369 # of &quot;activity&quot; depends on the type of the associated resource. The minimum
370 # and maximum allowed values for `ttl` depend on the type of the associated
371 # resource, as well. If `ttl` is not set, the associated resource never
372 # expires.
373 },
374 &quot;deadLetterPolicy&quot;: { # Dead lettering is done on a best effort basis. The same message might be # A policy that specifies the conditions for dead lettering messages in
375 # this subscription. If dead_letter_policy is not set, dead lettering
376 # is disabled.
377 #
378 # The Cloud Pub/Sub service account associated with this subscriptions&#x27;s
379 # parent project (i.e.,
Dan O'Mearadd494642020-05-01 07:42:23 -0700380 # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
Bu Sun Kim65020912020-05-20 12:08:20 -0700381 # permission to Acknowledge() messages on this subscription.
382 # dead lettered multiple times.
Dan O'Mearadd494642020-05-01 07:42:23 -0700383 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700384 # If validation on any of the fields fails at subscription creation/updation,
385 # the create/update subscription request will fail.
386 &quot;deadLetterTopic&quot;: &quot;A String&quot;, # The name of the topic to which dead letter messages should be published.
387 # Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
388 # account associated with the enclosing subscription&#x27;s parent project (i.e.,
389 # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
390 # permission to Publish() to this topic.
391 #
392 # The operation will fail if the topic does not exist.
393 # Users should ensure that there is a subscription attached to this topic
394 # since messages published to a topic with no subscriptions are lost.
395 &quot;maxDeliveryAttempts&quot;: 42, # The maximum number of delivery attempts for any message. The value must be
396 # between 5 and 100.
397 #
398 # The number of delivery attempts is defined as 1 + (the sum of number of
399 # NACKs and number of times the acknowledgement deadline has been exceeded
400 # for the message).
401 #
402 # A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
403 # client libraries may automatically extend ack_deadlines.
404 #
405 # This field will be honored on a best effort basis.
406 #
407 # If this parameter is 0, a default value of 5 is used.
408 },
409 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the subscription. It must have the format
410 # `&quot;projects/{project}/subscriptions/{subscription}&quot;`. `{subscription}` must
411 # start with a letter, and contain only letters (`[A-Za-z]`), numbers
412 # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
413 # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
414 # in length, and it must not start with `&quot;goog&quot;`.
415 &quot;topic&quot;: &quot;A String&quot;, # Required. The name of the topic from which this subscription is receiving messages.
416 # Format is `projects/{project}/topics/{topic}`.
417 # The value of this field will be `_deleted-topic_` if the topic has been
418 # deleted.
419 &quot;pushConfig&quot;: { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is
420 # used to configure it. An empty `pushConfig` signifies that the subscriber
421 # will pull and ack messages using API methods.
422 &quot;attributes&quot;: { # Endpoint configuration attributes that can be used to control different
423 # aspects of the message delivery.
424 #
425 # The only currently supported attribute is `x-goog-version`, which you can
426 # use to change the format of the pushed message. This attribute
427 # indicates the version of the data expected by the endpoint. This
428 # controls the shape of the pushed message (i.e., its fields and metadata).
429 #
430 # If not present during the `CreateSubscription` call, it will default to
431 # the version of the Pub/Sub API used to make such call. If not present in a
432 # `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
433 # calls will always return a valid version, even if the subscription was
434 # created without this attribute.
435 #
436 # The only supported values for the `x-goog-version` attribute are:
437 #
438 # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
439 # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
440 #
441 # For example:
442 # &lt;pre&gt;&lt;code&gt;attributes { &quot;x-goog-version&quot;: &quot;v1&quot; } &lt;/code&gt;&lt;/pre&gt;
443 &quot;a_key&quot;: &quot;A String&quot;,
444 },
445 &quot;pushEndpoint&quot;: &quot;A String&quot;, # A URL locating the endpoint to which messages should be pushed.
446 # For example, a Webhook endpoint might use `https://example.com/push`.
447 &quot;oidcToken&quot;: { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an
448 # `Authorization` header in the HTTP request for every pushed message.
449 # [OpenID Connect
450 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
451 &quot;audience&quot;: &quot;A String&quot;, # Audience to be used when generating OIDC token. The audience claim
452 # identifies the recipients that the JWT is intended for. The audience
453 # value is a single case-sensitive string. Having multiple values (array)
454 # for the audience field is not supported. More info about the OIDC JWT
455 # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
456 # Note: if not specified, the Push endpoint URL will be used.
457 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account
458 # email](https://cloud.google.com/iam/docs/service-accounts)
459 # to be used for generating the OIDC token. The caller (for
460 # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must
461 # have the iam.serviceAccounts.actAs permission for the service account.
462 },
463 },
464 &quot;filter&quot;: &quot;A String&quot;, # An expression written in the Cloud Pub/Sub filter language. If non-empty,
465 # then only `PubsubMessage`s whose `attributes` field matches the filter are
466 # delivered on this subscription. If empty, then no messages are filtered
467 # out.
468 # &lt;b&gt;EXPERIMENTAL:&lt;/b&gt; This feature is part of a closed alpha release. This
469 # API might be changed in backward-incompatible ways and is not recommended
470 # for production use. It is not subject to any SLA or deprecation policy.
471 &quot;ackDeadlineSeconds&quot;: 42, # The approximate amount of time (on a best-effort basis) Pub/Sub waits for
472 # the subscriber to acknowledge receipt before resending the message. In the
473 # interval after the message is delivered and before it is acknowledged, it
474 # is considered to be &lt;i&gt;outstanding&lt;/i&gt;. During that time period, the
475 # message will not be redelivered (on a best-effort basis).
Dan O'Mearadd494642020-05-01 07:42:23 -0700476 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700477 # For pull subscriptions, this value is used as the initial value for the ack
478 # deadline. To override this value for a given message, call
479 # `ModifyAckDeadline` with the corresponding `ack_id` if using
480 # non-streaming pull or send the `ack_id` in a
481 # `StreamingModifyAckDeadlineRequest` if using streaming pull.
482 # The minimum custom deadline you can specify is 10 seconds.
483 # The maximum custom deadline you can specify is 600 seconds (10 minutes).
484 # If this parameter is 0, a default value of 10 seconds is used.
Dan O'Mearadd494642020-05-01 07:42:23 -0700485 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700486 # For push delivery, this value is also used to set the request timeout for
487 # the call to the push endpoint.
Dan O'Mearadd494642020-05-01 07:42:23 -0700488 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700489 # If the subscriber never acknowledges the message, the Pub/Sub
490 # system will eventually redeliver the message.
491 &quot;messageRetentionDuration&quot;: &quot;A String&quot;, # How long to retain unacknowledged messages in the subscription&#x27;s backlog,
492 # from the moment a message is published.
493 # If `retain_acked_messages` is true, then this also configures the retention
494 # of acknowledged messages, and thus configures how far back in time a `Seek`
495 # can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
496 # minutes.
497 }</pre>
Takashi Matsuo06694102015-09-11 13:55:40 -0700498</div>
499
500<div class="method">
Thomas Coffee2f245372017-03-27 10:39:26 -0700501 <code class="details" id="delete">delete(subscription, x__xgafv=None)</code>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800502 <pre>Deletes an existing subscription. All messages retained in the subscription
503are immediately dropped. Calls to `Pull` after deletion will return
504`NOT_FOUND`. After a subscription is deleted, a new one may be created with
505the same name, but the new one has no association with the old
506subscription or its topic unless the same topic is specified.
Takashi Matsuo06694102015-09-11 13:55:40 -0700507
508Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700509 subscription: string, Required. The subscription to delete.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800510Format is `projects/{project}/subscriptions/{sub}`. (required)
Takashi Matsuo06694102015-09-11 13:55:40 -0700511 x__xgafv: string, V1 error format.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800512 Allowed values
513 1 - v1 error format
514 2 - v2 error format
Takashi Matsuo06694102015-09-11 13:55:40 -0700515
516Returns:
517 An object of the form:
518
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800519 { # A generic empty message that you can re-use to avoid defining duplicated
520 # empty messages in your APIs. A typical example is to use it as the request
521 # or the response type of an API method. For instance:
522 #
523 # service Foo {
524 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
525 # }
526 #
527 # The JSON representation for `Empty` is empty JSON object `{}`.
Takashi Matsuo06694102015-09-11 13:55:40 -0700528 }</pre>
529</div>
530
531<div class="method">
Thomas Coffee2f245372017-03-27 10:39:26 -0700532 <code class="details" id="get">get(subscription, x__xgafv=None)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -0700533 <pre>Gets the configuration details of a subscription.
534
535Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700536 subscription: string, Required. The name of the subscription to get.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800537Format is `projects/{project}/subscriptions/{sub}`. (required)
Takashi Matsuo06694102015-09-11 13:55:40 -0700538 x__xgafv: string, V1 error format.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800539 Allowed values
540 1 - v1 error format
541 2 - v2 error format
Takashi Matsuo06694102015-09-11 13:55:40 -0700542
543Returns:
544 An object of the form:
545
546 { # A subscription resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700547 &quot;retainAckedMessages&quot;: True or False, # Indicates whether to retain acknowledged messages. If true, then
548 # messages are not expunged from the subscription&#x27;s backlog, even if they are
549 # acknowledged, until they fall out of the `message_retention_duration`
550 # window. This must be true if you would like to
551 # &lt;a
552 # href=&quot;https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time&quot;&gt;
553 # Seek to a timestamp&lt;/a&gt;.
554 &quot;labels&quot;: { # See &lt;a href=&quot;https://cloud.google.com/pubsub/docs/labels&quot;&gt; Creating and
555 # managing labels&lt;/a&gt;.
556 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700557 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700558 &quot;expirationPolicy&quot;: { # A policy that specifies the conditions for resource expiration (i.e., # A policy that specifies the conditions for this subscription&#x27;s expiration.
559 # A subscription is considered active as long as any connected subscriber is
560 # successfully consuming messages from the subscription or is issuing
561 # operations on the subscription. If `expiration_policy` is not set, a
562 # *default policy* with `ttl` of 31 days will be used. The minimum allowed
563 # value for `expiration_policy.ttl` is 1 day.
564 # automatic resource deletion).
565 &quot;ttl&quot;: &quot;A String&quot;, # Specifies the &quot;time-to-live&quot; duration for an associated resource. The
566 # resource expires if it is not active for a period of `ttl`. The definition
567 # of &quot;activity&quot; depends on the type of the associated resource. The minimum
568 # and maximum allowed values for `ttl` depend on the type of the associated
569 # resource, as well. If `ttl` is not set, the associated resource never
570 # expires.
Dan O'Mearadd494642020-05-01 07:42:23 -0700571 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700572 &quot;deadLetterPolicy&quot;: { # Dead lettering is done on a best effort basis. The same message might be # A policy that specifies the conditions for dead lettering messages in
573 # this subscription. If dead_letter_policy is not set, dead lettering
574 # is disabled.
575 #
576 # The Cloud Pub/Sub service account associated with this subscriptions&#x27;s
577 # parent project (i.e.,
Dan O'Mearadd494642020-05-01 07:42:23 -0700578 # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
Bu Sun Kim65020912020-05-20 12:08:20 -0700579 # permission to Acknowledge() messages on this subscription.
580 # dead lettered multiple times.
Dan O'Mearadd494642020-05-01 07:42:23 -0700581 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700582 # If validation on any of the fields fails at subscription creation/updation,
583 # the create/update subscription request will fail.
584 &quot;deadLetterTopic&quot;: &quot;A String&quot;, # The name of the topic to which dead letter messages should be published.
585 # Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
586 # account associated with the enclosing subscription&#x27;s parent project (i.e.,
587 # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
588 # permission to Publish() to this topic.
589 #
590 # The operation will fail if the topic does not exist.
591 # Users should ensure that there is a subscription attached to this topic
592 # since messages published to a topic with no subscriptions are lost.
593 &quot;maxDeliveryAttempts&quot;: 42, # The maximum number of delivery attempts for any message. The value must be
594 # between 5 and 100.
595 #
596 # The number of delivery attempts is defined as 1 + (the sum of number of
597 # NACKs and number of times the acknowledgement deadline has been exceeded
598 # for the message).
599 #
600 # A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
601 # client libraries may automatically extend ack_deadlines.
602 #
603 # This field will be honored on a best effort basis.
604 #
605 # If this parameter is 0, a default value of 5 is used.
606 },
607 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the subscription. It must have the format
608 # `&quot;projects/{project}/subscriptions/{subscription}&quot;`. `{subscription}` must
609 # start with a letter, and contain only letters (`[A-Za-z]`), numbers
610 # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
611 # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
612 # in length, and it must not start with `&quot;goog&quot;`.
613 &quot;topic&quot;: &quot;A String&quot;, # Required. The name of the topic from which this subscription is receiving messages.
614 # Format is `projects/{project}/topics/{topic}`.
615 # The value of this field will be `_deleted-topic_` if the topic has been
616 # deleted.
617 &quot;pushConfig&quot;: { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is
618 # used to configure it. An empty `pushConfig` signifies that the subscriber
619 # will pull and ack messages using API methods.
620 &quot;attributes&quot;: { # Endpoint configuration attributes that can be used to control different
621 # aspects of the message delivery.
622 #
623 # The only currently supported attribute is `x-goog-version`, which you can
624 # use to change the format of the pushed message. This attribute
625 # indicates the version of the data expected by the endpoint. This
626 # controls the shape of the pushed message (i.e., its fields and metadata).
627 #
628 # If not present during the `CreateSubscription` call, it will default to
629 # the version of the Pub/Sub API used to make such call. If not present in a
630 # `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
631 # calls will always return a valid version, even if the subscription was
632 # created without this attribute.
633 #
634 # The only supported values for the `x-goog-version` attribute are:
635 #
636 # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
637 # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
638 #
639 # For example:
640 # &lt;pre&gt;&lt;code&gt;attributes { &quot;x-goog-version&quot;: &quot;v1&quot; } &lt;/code&gt;&lt;/pre&gt;
641 &quot;a_key&quot;: &quot;A String&quot;,
642 },
643 &quot;pushEndpoint&quot;: &quot;A String&quot;, # A URL locating the endpoint to which messages should be pushed.
644 # For example, a Webhook endpoint might use `https://example.com/push`.
645 &quot;oidcToken&quot;: { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an
646 # `Authorization` header in the HTTP request for every pushed message.
647 # [OpenID Connect
648 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
649 &quot;audience&quot;: &quot;A String&quot;, # Audience to be used when generating OIDC token. The audience claim
650 # identifies the recipients that the JWT is intended for. The audience
651 # value is a single case-sensitive string. Having multiple values (array)
652 # for the audience field is not supported. More info about the OIDC JWT
653 # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
654 # Note: if not specified, the Push endpoint URL will be used.
655 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account
656 # email](https://cloud.google.com/iam/docs/service-accounts)
657 # to be used for generating the OIDC token. The caller (for
658 # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must
659 # have the iam.serviceAccounts.actAs permission for the service account.
660 },
661 },
662 &quot;filter&quot;: &quot;A String&quot;, # An expression written in the Cloud Pub/Sub filter language. If non-empty,
663 # then only `PubsubMessage`s whose `attributes` field matches the filter are
664 # delivered on this subscription. If empty, then no messages are filtered
665 # out.
666 # &lt;b&gt;EXPERIMENTAL:&lt;/b&gt; This feature is part of a closed alpha release. This
667 # API might be changed in backward-incompatible ways and is not recommended
668 # for production use. It is not subject to any SLA or deprecation policy.
669 &quot;ackDeadlineSeconds&quot;: 42, # The approximate amount of time (on a best-effort basis) Pub/Sub waits for
670 # the subscriber to acknowledge receipt before resending the message. In the
671 # interval after the message is delivered and before it is acknowledged, it
672 # is considered to be &lt;i&gt;outstanding&lt;/i&gt;. During that time period, the
673 # message will not be redelivered (on a best-effort basis).
Dan O'Mearadd494642020-05-01 07:42:23 -0700674 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700675 # For pull subscriptions, this value is used as the initial value for the ack
676 # deadline. To override this value for a given message, call
677 # `ModifyAckDeadline` with the corresponding `ack_id` if using
678 # non-streaming pull or send the `ack_id` in a
679 # `StreamingModifyAckDeadlineRequest` if using streaming pull.
680 # The minimum custom deadline you can specify is 10 seconds.
681 # The maximum custom deadline you can specify is 600 seconds (10 minutes).
682 # If this parameter is 0, a default value of 10 seconds is used.
Dan O'Mearadd494642020-05-01 07:42:23 -0700683 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700684 # For push delivery, this value is also used to set the request timeout for
685 # the call to the push endpoint.
Dan O'Mearadd494642020-05-01 07:42:23 -0700686 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700687 # If the subscriber never acknowledges the message, the Pub/Sub
688 # system will eventually redeliver the message.
689 &quot;messageRetentionDuration&quot;: &quot;A String&quot;, # How long to retain unacknowledged messages in the subscription&#x27;s backlog,
690 # from the moment a message is published.
691 # If `retain_acked_messages` is true, then this also configures the retention
692 # of acknowledged messages, and thus configures how far back in time a `Seek`
693 # can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
694 # minutes.
695 }</pre>
Takashi Matsuo06694102015-09-11 13:55:40 -0700696</div>
697
698<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700699 <code class="details" id="getIamPolicy">getIamPolicy(resource, options_requestedPolicyVersion=None, x__xgafv=None)</code>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800700 <pre>Gets the access control policy for a resource.
701Returns an empty policy if the resource exists and does not have a policy
702set.
Takashi Matsuo06694102015-09-11 13:55:40 -0700703
704Args:
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800705 resource: string, REQUIRED: The resource for which the policy is being requested.
Sai Cheemalapatie833b792017-03-24 15:06:46 -0700706See the operation documentation for the appropriate value for this field. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700707 options_requestedPolicyVersion: integer, Optional. The policy format version to be returned.
708
709Valid values are 0, 1, and 3. Requests specifying an invalid value will be
710rejected.
711
712Requests for policies with any conditional bindings must specify version 3.
713Policies without any conditional bindings may specify any valid value or
714leave the field unset.
Bu Sun Kim65020912020-05-20 12:08:20 -0700715
716To learn which resources support conditions in their IAM policies, see the
717[IAM
718documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Takashi Matsuo06694102015-09-11 13:55:40 -0700719 x__xgafv: string, V1 error format.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800720 Allowed values
721 1 - v1 error format
722 2 - v2 error format
Takashi Matsuo06694102015-09-11 13:55:40 -0700723
724Returns:
725 An object of the form:
726
Dan O'Mearadd494642020-05-01 07:42:23 -0700727 { # An Identity and Access Management (IAM) policy, which specifies access
728 # controls for Google Cloud resources.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800729 #
730 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700731 # A `Policy` is a collection of `bindings`. A `binding` binds one or more
732 # `members` to a single `role`. Members can be user accounts, service accounts,
733 # Google groups, and domains (such as G Suite). A `role` is a named list of
734 # permissions; each `role` can be an IAM predefined role or a user-created
735 # custom role.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800736 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700737 # For some types of Google Cloud resources, a `binding` can also specify a
738 # `condition`, which is a logical expression that allows access to a resource
739 # only if the expression evaluates to `true`. A condition can add constraints
740 # based on attributes of the request, the resource, or both. To learn which
741 # resources support conditions in their IAM policies, see the
742 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Dan O'Mearadd494642020-05-01 07:42:23 -0700743 #
744 # **JSON example:**
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800745 #
746 # {
Bu Sun Kim65020912020-05-20 12:08:20 -0700747 # &quot;bindings&quot;: [
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800748 # {
Bu Sun Kim65020912020-05-20 12:08:20 -0700749 # &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;,
750 # &quot;members&quot;: [
751 # &quot;user:mike@example.com&quot;,
752 # &quot;group:admins@example.com&quot;,
753 # &quot;domain:google.com&quot;,
754 # &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot;
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800755 # ]
756 # },
757 # {
Bu Sun Kim65020912020-05-20 12:08:20 -0700758 # &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;,
759 # &quot;members&quot;: [
760 # &quot;user:eve@example.com&quot;
761 # ],
762 # &quot;condition&quot;: {
763 # &quot;title&quot;: &quot;expirable access&quot;,
764 # &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;,
765 # &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -0700766 # }
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800767 # }
Dan O'Mearadd494642020-05-01 07:42:23 -0700768 # ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700769 # &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;,
770 # &quot;version&quot;: 3
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800771 # }
772 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700773 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700774 #
775 # bindings:
776 # - members:
777 # - user:mike@example.com
778 # - group:admins@example.com
779 # - domain:google.com
Dan O'Mearadd494642020-05-01 07:42:23 -0700780 # - serviceAccount:my-project-id@appspot.gserviceaccount.com
781 # role: roles/resourcemanager.organizationAdmin
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700782 # - members:
Dan O'Mearadd494642020-05-01 07:42:23 -0700783 # - user:eve@example.com
784 # role: roles/resourcemanager.organizationViewer
785 # condition:
786 # title: expirable access
787 # description: Does not grant access after Sep 2020
Bu Sun Kim65020912020-05-20 12:08:20 -0700788 # expression: request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)
Dan O'Mearadd494642020-05-01 07:42:23 -0700789 # - etag: BwWWja0YfJA=
790 # - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700791 #
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800792 # For a description of IAM and its features, see the
Dan O'Mearadd494642020-05-01 07:42:23 -0700793 # [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim65020912020-05-20 12:08:20 -0700794 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
795 # prevent simultaneous updates of a policy from overwriting each other.
796 # It is strongly suggested that systems make use of the `etag` in the
797 # read-modify-write cycle to perform policy updates in order to avoid race
798 # conditions: An `etag` is returned in the response to `getIamPolicy`, and
799 # systems are expected to put that etag in the request to `setIamPolicy` to
800 # ensure that their change will be applied to the same version of the policy.
801 #
802 # **Important:** If you use IAM Conditions, you must include the `etag` field
803 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
804 # you to overwrite a version `3` policy with a version `1` policy, and all of
805 # the conditions in the version `3` policy are lost.
806 &quot;version&quot;: 42, # Specifies the format of the policy.
807 #
808 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
809 # are rejected.
810 #
811 # Any operation that affects conditional role bindings must specify version
812 # `3`. This requirement applies to the following operations:
813 #
814 # * Getting a policy that includes a conditional role binding
815 # * Adding a conditional role binding to a policy
816 # * Changing a conditional role binding in a policy
817 # * Removing any role binding, with or without a condition, from a policy
818 # that includes conditions
819 #
820 # **Important:** If you use IAM Conditions, you must include the `etag` field
821 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
822 # you to overwrite a version `3` policy with a version `1` policy, and all of
823 # the conditions in the version `3` policy are lost.
824 #
825 # If a policy does not include any conditions, operations on that policy may
826 # specify any valid version or leave the field unset.
827 #
828 # To learn which resources support conditions in their IAM policies, see the
829 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
830 &quot;bindings&quot;: [ # Associates a list of `members` to a `role`. Optionally, may specify a
Dan O'Mearadd494642020-05-01 07:42:23 -0700831 # `condition` that determines how and when the `bindings` are applied. Each
832 # of the `bindings` must contain at least one member.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800833 { # Associates `members` with a `role`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700834 &quot;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding.
835 #
836 # If the condition evaluates to `true`, then this binding applies to the
837 # current request.
838 #
839 # If the condition evaluates to `false`, then this binding does not apply to
840 # the current request. However, a different role binding might grant the same
841 # role to one or more of the members in this binding.
842 #
843 # To learn which resources support conditions in their IAM policies, see the
844 # [IAM
845 # documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
846 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
847 # are documented at https://github.com/google/cel-spec.
848 #
849 # Example (Comparison):
850 #
851 # title: &quot;Summary size limit&quot;
852 # description: &quot;Determines if a summary is less than 100 chars&quot;
853 # expression: &quot;document.summary.size() &lt; 100&quot;
854 #
855 # Example (Equality):
856 #
857 # title: &quot;Requestor is owner&quot;
858 # description: &quot;Determines if requestor is the document owner&quot;
859 # expression: &quot;document.owner == request.auth.claims.email&quot;
860 #
861 # Example (Logic):
862 #
863 # title: &quot;Public documents&quot;
864 # description: &quot;Determine whether the document should be publicly visible&quot;
865 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
866 #
867 # Example (Data Manipulation):
868 #
869 # title: &quot;Notification string&quot;
870 # description: &quot;Create a notification string with a timestamp.&quot;
871 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
872 #
873 # The exact variables and functions that may be referenced within an expression
874 # are determined by the service that evaluates it. See the service
875 # documentation for additional information.
876 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
877 # reporting, e.g. a file name and a position in the file.
878 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
879 # its purpose. This can be used e.g. in UIs which allow to enter the
880 # expression.
881 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
882 # describes the expression, e.g. when hovered over it in a UI.
883 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
884 # syntax.
885 },
886 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800887 # `members` can have the following values:
888 #
889 # * `allUsers`: A special identifier that represents anyone who is
890 # on the internet; with or without a Google account.
891 #
892 # * `allAuthenticatedUsers`: A special identifier that represents anyone
893 # who is authenticated with a Google account or a service account.
894 #
895 # * `user:{emailid}`: An email address that represents a specific Google
Dan O'Mearadd494642020-05-01 07:42:23 -0700896 # account. For example, `alice@example.com` .
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800897 #
898 #
899 # * `serviceAccount:{emailid}`: An email address that represents a service
900 # account. For example, `my-other-app@appspot.gserviceaccount.com`.
901 #
902 # * `group:{emailid}`: An email address that represents a Google group.
903 # For example, `admins@example.com`.
904 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700905 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
906 # identifier) representing a user that has been recently deleted. For
907 # example, `alice@example.com?uid=123456789012345678901`. If the user is
908 # recovered, this value reverts to `user:{emailid}` and the recovered user
909 # retains the role in the binding.
910 #
911 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
912 # unique identifier) representing a service account that has been recently
913 # deleted. For example,
914 # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
915 # If the service account is undeleted, this value reverts to
916 # `serviceAccount:{emailid}` and the undeleted service account retains the
917 # role in the binding.
918 #
919 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
920 # identifier) representing a Google group that has been recently
921 # deleted. For example, `admins@example.com?uid=123456789012345678901`. If
922 # the group is recovered, this value reverts to `group:{emailid}` and the
923 # recovered group retains the role in the binding.
924 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700925 #
926 # * `domain:{domain}`: The G Suite domain (primary) that represents all the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800927 # users of that domain. For example, `google.com` or `example.com`.
928 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700929 &quot;A String&quot;,
Takashi Matsuo06694102015-09-11 13:55:40 -0700930 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700931 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`.
932 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Takashi Matsuo06694102015-09-11 13:55:40 -0700933 },
934 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700935 }</pre>
936</div>
937
938<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700939 <code class="details" id="list">list(project, pageToken=None, pageSize=None, x__xgafv=None)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -0700940 <pre>Lists matching subscriptions.
941
942Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700943 project: string, Required. The name of the project in which to list subscriptions.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700944Format is `projects/{project-id}`. (required)
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800945 pageToken: string, The value returned by the last `ListSubscriptionsResponse`; indicates that
946this is a continuation of a prior `ListSubscriptions` call, and that the
947system should return the next page of data.
Bu Sun Kim65020912020-05-20 12:08:20 -0700948 pageSize: integer, Maximum number of subscriptions to return.
Takashi Matsuo06694102015-09-11 13:55:40 -0700949 x__xgafv: string, V1 error format.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800950 Allowed values
951 1 - v1 error format
952 2 - v2 error format
Takashi Matsuo06694102015-09-11 13:55:40 -0700953
954Returns:
955 An object of the form:
956
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800957 { # Response for the `ListSubscriptions` method.
Bu Sun Kim65020912020-05-20 12:08:20 -0700958 &quot;nextPageToken&quot;: &quot;A String&quot;, # If not empty, indicates that there may be more subscriptions that match
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800959 # the request; this value should be passed in a new
960 # `ListSubscriptionsRequest` to get more subscriptions.
Bu Sun Kim65020912020-05-20 12:08:20 -0700961 &quot;subscriptions&quot;: [ # The subscriptions that match the request.
Takashi Matsuo06694102015-09-11 13:55:40 -0700962 { # A subscription resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700963 &quot;retainAckedMessages&quot;: True or False, # Indicates whether to retain acknowledged messages. If true, then
964 # messages are not expunged from the subscription&#x27;s backlog, even if they are
965 # acknowledged, until they fall out of the `message_retention_duration`
966 # window. This must be true if you would like to
967 # &lt;a
968 # href=&quot;https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time&quot;&gt;
969 # Seek to a timestamp&lt;/a&gt;.
970 &quot;labels&quot;: { # See &lt;a href=&quot;https://cloud.google.com/pubsub/docs/labels&quot;&gt; Creating and
971 # managing labels&lt;/a&gt;.
972 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700973 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700974 &quot;expirationPolicy&quot;: { # A policy that specifies the conditions for resource expiration (i.e., # A policy that specifies the conditions for this subscription&#x27;s expiration.
975 # A subscription is considered active as long as any connected subscriber is
976 # successfully consuming messages from the subscription or is issuing
977 # operations on the subscription. If `expiration_policy` is not set, a
978 # *default policy* with `ttl` of 31 days will be used. The minimum allowed
979 # value for `expiration_policy.ttl` is 1 day.
980 # automatic resource deletion).
981 &quot;ttl&quot;: &quot;A String&quot;, # Specifies the &quot;time-to-live&quot; duration for an associated resource. The
982 # resource expires if it is not active for a period of `ttl`. The definition
983 # of &quot;activity&quot; depends on the type of the associated resource. The minimum
984 # and maximum allowed values for `ttl` depend on the type of the associated
985 # resource, as well. If `ttl` is not set, the associated resource never
986 # expires.
Dan O'Mearadd494642020-05-01 07:42:23 -0700987 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700988 &quot;deadLetterPolicy&quot;: { # Dead lettering is done on a best effort basis. The same message might be # A policy that specifies the conditions for dead lettering messages in
989 # this subscription. If dead_letter_policy is not set, dead lettering
990 # is disabled.
991 #
992 # The Cloud Pub/Sub service account associated with this subscriptions&#x27;s
993 # parent project (i.e.,
Dan O'Mearadd494642020-05-01 07:42:23 -0700994 # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
Bu Sun Kim65020912020-05-20 12:08:20 -0700995 # permission to Acknowledge() messages on this subscription.
996 # dead lettered multiple times.
Dan O'Mearadd494642020-05-01 07:42:23 -0700997 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700998 # If validation on any of the fields fails at subscription creation/updation,
999 # the create/update subscription request will fail.
1000 &quot;deadLetterTopic&quot;: &quot;A String&quot;, # The name of the topic to which dead letter messages should be published.
1001 # Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
1002 # account associated with the enclosing subscription&#x27;s parent project (i.e.,
1003 # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
1004 # permission to Publish() to this topic.
1005 #
1006 # The operation will fail if the topic does not exist.
1007 # Users should ensure that there is a subscription attached to this topic
1008 # since messages published to a topic with no subscriptions are lost.
1009 &quot;maxDeliveryAttempts&quot;: 42, # The maximum number of delivery attempts for any message. The value must be
1010 # between 5 and 100.
1011 #
1012 # The number of delivery attempts is defined as 1 + (the sum of number of
1013 # NACKs and number of times the acknowledgement deadline has been exceeded
1014 # for the message).
1015 #
1016 # A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
1017 # client libraries may automatically extend ack_deadlines.
1018 #
1019 # This field will be honored on a best effort basis.
1020 #
1021 # If this parameter is 0, a default value of 5 is used.
1022 },
1023 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the subscription. It must have the format
1024 # `&quot;projects/{project}/subscriptions/{subscription}&quot;`. `{subscription}` must
1025 # start with a letter, and contain only letters (`[A-Za-z]`), numbers
1026 # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
1027 # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
1028 # in length, and it must not start with `&quot;goog&quot;`.
1029 &quot;topic&quot;: &quot;A String&quot;, # Required. The name of the topic from which this subscription is receiving messages.
1030 # Format is `projects/{project}/topics/{topic}`.
1031 # The value of this field will be `_deleted-topic_` if the topic has been
1032 # deleted.
1033 &quot;pushConfig&quot;: { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is
1034 # used to configure it. An empty `pushConfig` signifies that the subscriber
1035 # will pull and ack messages using API methods.
1036 &quot;attributes&quot;: { # Endpoint configuration attributes that can be used to control different
1037 # aspects of the message delivery.
1038 #
1039 # The only currently supported attribute is `x-goog-version`, which you can
1040 # use to change the format of the pushed message. This attribute
1041 # indicates the version of the data expected by the endpoint. This
1042 # controls the shape of the pushed message (i.e., its fields and metadata).
1043 #
1044 # If not present during the `CreateSubscription` call, it will default to
1045 # the version of the Pub/Sub API used to make such call. If not present in a
1046 # `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
1047 # calls will always return a valid version, even if the subscription was
1048 # created without this attribute.
1049 #
1050 # The only supported values for the `x-goog-version` attribute are:
1051 #
1052 # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
1053 # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
1054 #
1055 # For example:
1056 # &lt;pre&gt;&lt;code&gt;attributes { &quot;x-goog-version&quot;: &quot;v1&quot; } &lt;/code&gt;&lt;/pre&gt;
1057 &quot;a_key&quot;: &quot;A String&quot;,
1058 },
1059 &quot;pushEndpoint&quot;: &quot;A String&quot;, # A URL locating the endpoint to which messages should be pushed.
1060 # For example, a Webhook endpoint might use `https://example.com/push`.
1061 &quot;oidcToken&quot;: { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an
1062 # `Authorization` header in the HTTP request for every pushed message.
1063 # [OpenID Connect
1064 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
1065 &quot;audience&quot;: &quot;A String&quot;, # Audience to be used when generating OIDC token. The audience claim
1066 # identifies the recipients that the JWT is intended for. The audience
1067 # value is a single case-sensitive string. Having multiple values (array)
1068 # for the audience field is not supported. More info about the OIDC JWT
1069 # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
1070 # Note: if not specified, the Push endpoint URL will be used.
1071 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account
1072 # email](https://cloud.google.com/iam/docs/service-accounts)
1073 # to be used for generating the OIDC token. The caller (for
1074 # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must
1075 # have the iam.serviceAccounts.actAs permission for the service account.
1076 },
1077 },
1078 &quot;filter&quot;: &quot;A String&quot;, # An expression written in the Cloud Pub/Sub filter language. If non-empty,
1079 # then only `PubsubMessage`s whose `attributes` field matches the filter are
1080 # delivered on this subscription. If empty, then no messages are filtered
1081 # out.
1082 # &lt;b&gt;EXPERIMENTAL:&lt;/b&gt; This feature is part of a closed alpha release. This
1083 # API might be changed in backward-incompatible ways and is not recommended
1084 # for production use. It is not subject to any SLA or deprecation policy.
1085 &quot;ackDeadlineSeconds&quot;: 42, # The approximate amount of time (on a best-effort basis) Pub/Sub waits for
1086 # the subscriber to acknowledge receipt before resending the message. In the
1087 # interval after the message is delivered and before it is acknowledged, it
1088 # is considered to be &lt;i&gt;outstanding&lt;/i&gt;. During that time period, the
1089 # message will not be redelivered (on a best-effort basis).
Dan O'Mearadd494642020-05-01 07:42:23 -07001090 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001091 # For pull subscriptions, this value is used as the initial value for the ack
1092 # deadline. To override this value for a given message, call
1093 # `ModifyAckDeadline` with the corresponding `ack_id` if using
1094 # non-streaming pull or send the `ack_id` in a
1095 # `StreamingModifyAckDeadlineRequest` if using streaming pull.
1096 # The minimum custom deadline you can specify is 10 seconds.
1097 # The maximum custom deadline you can specify is 600 seconds (10 minutes).
1098 # If this parameter is 0, a default value of 10 seconds is used.
Dan O'Mearadd494642020-05-01 07:42:23 -07001099 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001100 # For push delivery, this value is also used to set the request timeout for
1101 # the call to the push endpoint.
Dan O'Mearadd494642020-05-01 07:42:23 -07001102 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001103 # If the subscriber never acknowledges the message, the Pub/Sub
1104 # system will eventually redeliver the message.
1105 &quot;messageRetentionDuration&quot;: &quot;A String&quot;, # How long to retain unacknowledged messages in the subscription&#x27;s backlog,
1106 # from the moment a message is published.
1107 # If `retain_acked_messages` is true, then this also configures the retention
1108 # of acknowledged messages, and thus configures how far back in time a `Seek`
1109 # can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
1110 # minutes.
Dan O'Mearadd494642020-05-01 07:42:23 -07001111 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001112 ],
1113 }</pre>
1114</div>
1115
1116<div class="method">
1117 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1118 <pre>Retrieves the next page of results.
1119
1120Args:
1121 previous_request: The request for the previous page. (required)
1122 previous_response: The response from the request for the previous page. (required)
1123
1124Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -07001125 A request object that you can call &#x27;execute()&#x27; on to request the next
Takashi Matsuo06694102015-09-11 13:55:40 -07001126 page. Returns None if there are no more items in the collection.
1127 </pre>
1128</div>
1129
1130<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001131 <code class="details" id="modifyAckDeadline">modifyAckDeadline(subscription, body=None, x__xgafv=None)</code>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001132 <pre>Modifies the ack deadline for a specific message. This method is useful
1133to indicate that more time is needed to process a message by the
1134subscriber, or to make the message available for redelivery if the
1135processing was interrupted. Note that this does not modify the
1136subscription-level `ackDeadlineSeconds` used for subsequent messages.
Takashi Matsuo06694102015-09-11 13:55:40 -07001137
1138Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001139 subscription: string, Required. The name of the subscription.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001140Format is `projects/{project}/subscriptions/{sub}`. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001141 body: object, The request body.
Takashi Matsuo06694102015-09-11 13:55:40 -07001142 The object takes the form of:
1143
1144{ # Request for the ModifyAckDeadline method.
Bu Sun Kim65020912020-05-20 12:08:20 -07001145 &quot;ackIds&quot;: [ # Required. List of acknowledgment IDs.
1146 &quot;A String&quot;,
1147 ],
1148 &quot;ackDeadlineSeconds&quot;: 42, # Required. The new ack deadline with respect to the time this request was sent to
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001149 # the Pub/Sub system. For example, if the value is 10, the new
1150 # ack deadline will expire 10 seconds after the `ModifyAckDeadline` call
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001151 # was made. Specifying zero might immediately make the message available for
1152 # delivery to another subscriber client. This typically results in an
1153 # increase in the rate of message redeliveries (that is, duplicates).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001154 # The minimum deadline you can specify is 0 seconds.
1155 # The maximum deadline you can specify is 600 seconds (10 minutes).
Takashi Matsuo06694102015-09-11 13:55:40 -07001156 }
1157
1158 x__xgafv: string, V1 error format.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001159 Allowed values
1160 1 - v1 error format
1161 2 - v2 error format
Takashi Matsuo06694102015-09-11 13:55:40 -07001162
1163Returns:
1164 An object of the form:
1165
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001166 { # A generic empty message that you can re-use to avoid defining duplicated
1167 # empty messages in your APIs. A typical example is to use it as the request
1168 # or the response type of an API method. For instance:
1169 #
1170 # service Foo {
1171 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
1172 # }
1173 #
1174 # The JSON representation for `Empty` is empty JSON object `{}`.
Takashi Matsuo06694102015-09-11 13:55:40 -07001175 }</pre>
1176</div>
1177
1178<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001179 <code class="details" id="modifyPushConfig">modifyPushConfig(subscription, body=None, x__xgafv=None)</code>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001180 <pre>Modifies the `PushConfig` for a specified subscription.
1181
1182This may be used to change a push subscription to a pull one (signified by
1183an empty `PushConfig`) or vice versa, or change the endpoint URL and other
1184attributes of a push subscription. Messages will accumulate for delivery
1185continuously through the call regardless of changes to the `PushConfig`.
Takashi Matsuo06694102015-09-11 13:55:40 -07001186
1187Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001188 subscription: string, Required. The name of the subscription.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001189Format is `projects/{project}/subscriptions/{sub}`. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001190 body: object, The request body.
Takashi Matsuo06694102015-09-11 13:55:40 -07001191 The object takes the form of:
1192
1193{ # Request for the ModifyPushConfig method.
Bu Sun Kim65020912020-05-20 12:08:20 -07001194 &quot;pushConfig&quot;: { # Configuration for a push delivery endpoint. # Required. The push configuration for future deliveries.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001195 #
1196 # An empty `pushConfig` indicates that the Pub/Sub system should
1197 # stop pushing messages from the given subscription and allow
1198 # messages to be pulled and acknowledged - effectively pausing
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001199 # the subscription if `Pull` or `StreamingPull` is not called.
Bu Sun Kim65020912020-05-20 12:08:20 -07001200 &quot;attributes&quot;: { # Endpoint configuration attributes that can be used to control different
Dan O'Mearadd494642020-05-01 07:42:23 -07001201 # aspects of the message delivery.
1202 #
1203 # The only currently supported attribute is `x-goog-version`, which you can
1204 # use to change the format of the pushed message. This attribute
1205 # indicates the version of the data expected by the endpoint. This
1206 # controls the shape of the pushed message (i.e., its fields and metadata).
1207 #
1208 # If not present during the `CreateSubscription` call, it will default to
1209 # the version of the Pub/Sub API used to make such call. If not present in a
1210 # `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
1211 # calls will always return a valid version, even if the subscription was
1212 # created without this attribute.
1213 #
1214 # The only supported values for the `x-goog-version` attribute are:
1215 #
1216 # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
1217 # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
1218 #
1219 # For example:
Bu Sun Kim65020912020-05-20 12:08:20 -07001220 # &lt;pre&gt;&lt;code&gt;attributes { &quot;x-goog-version&quot;: &quot;v1&quot; } &lt;/code&gt;&lt;/pre&gt;
1221 &quot;a_key&quot;: &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -07001222 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001223 &quot;pushEndpoint&quot;: &quot;A String&quot;, # A URL locating the endpoint to which messages should be pushed.
1224 # For example, a Webhook endpoint might use `https://example.com/push`.
1225 &quot;oidcToken&quot;: { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an
1226 # `Authorization` header in the HTTP request for every pushed message.
1227 # [OpenID Connect
1228 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
1229 &quot;audience&quot;: &quot;A String&quot;, # Audience to be used when generating OIDC token. The audience claim
1230 # identifies the recipients that the JWT is intended for. The audience
1231 # value is a single case-sensitive string. Having multiple values (array)
1232 # for the audience field is not supported. More info about the OIDC JWT
1233 # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
1234 # Note: if not specified, the Push endpoint URL will be used.
1235 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account
1236 # email](https://cloud.google.com/iam/docs/service-accounts)
1237 # to be used for generating the OIDC token. The caller (for
1238 # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must
1239 # have the iam.serviceAccounts.actAs permission for the service account.
1240 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001241 },
1242 }
1243
1244 x__xgafv: string, V1 error format.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001245 Allowed values
1246 1 - v1 error format
1247 2 - v2 error format
Takashi Matsuo06694102015-09-11 13:55:40 -07001248
1249Returns:
1250 An object of the form:
1251
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001252 { # A generic empty message that you can re-use to avoid defining duplicated
1253 # empty messages in your APIs. A typical example is to use it as the request
1254 # or the response type of an API method. For instance:
1255 #
1256 # service Foo {
1257 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
1258 # }
1259 #
1260 # The JSON representation for `Empty` is empty JSON object `{}`.
Takashi Matsuo06694102015-09-11 13:55:40 -07001261 }</pre>
1262</div>
1263
1264<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001265 <code class="details" id="patch">patch(name, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001266 <pre>Updates an existing subscription. Note that certain properties of a
1267subscription, such as its topic, are not modifiable.
1268
1269Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001270 name: string, Required. The name of the subscription. It must have the format
Bu Sun Kim65020912020-05-20 12:08:20 -07001271`&quot;projects/{project}/subscriptions/{subscription}&quot;`. `{subscription}` must
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001272start with a letter, and contain only letters (`[A-Za-z]`), numbers
1273(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
1274plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
Bu Sun Kim65020912020-05-20 12:08:20 -07001275in length, and it must not start with `&quot;goog&quot;`. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001276 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001277 The object takes the form of:
1278
1279{ # Request for the UpdateSubscription method.
Bu Sun Kim65020912020-05-20 12:08:20 -07001280 &quot;updateMask&quot;: &quot;A String&quot;, # Required. Indicates which fields in the provided subscription to update.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001281 # Must be specified and non-empty.
Bu Sun Kim65020912020-05-20 12:08:20 -07001282 &quot;subscription&quot;: { # A subscription resource. # Required. The updated subscription object.
1283 &quot;retainAckedMessages&quot;: True or False, # Indicates whether to retain acknowledged messages. If true, then
1284 # messages are not expunged from the subscription&#x27;s backlog, even if they are
1285 # acknowledged, until they fall out of the `message_retention_duration`
1286 # window. This must be true if you would like to
1287 # &lt;a
1288 # href=&quot;https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time&quot;&gt;
1289 # Seek to a timestamp&lt;/a&gt;.
1290 &quot;labels&quot;: { # See &lt;a href=&quot;https://cloud.google.com/pubsub/docs/labels&quot;&gt; Creating and
1291 # managing labels&lt;/a&gt;.
1292 &quot;a_key&quot;: &quot;A String&quot;,
1293 },
1294 &quot;expirationPolicy&quot;: { # A policy that specifies the conditions for resource expiration (i.e., # A policy that specifies the conditions for this subscription&#x27;s expiration.
1295 # A subscription is considered active as long as any connected subscriber is
1296 # successfully consuming messages from the subscription or is issuing
1297 # operations on the subscription. If `expiration_policy` is not set, a
1298 # *default policy* with `ttl` of 31 days will be used. The minimum allowed
1299 # value for `expiration_policy.ttl` is 1 day.
1300 # automatic resource deletion).
1301 &quot;ttl&quot;: &quot;A String&quot;, # Specifies the &quot;time-to-live&quot; duration for an associated resource. The
1302 # resource expires if it is not active for a period of `ttl`. The definition
1303 # of &quot;activity&quot; depends on the type of the associated resource. The minimum
1304 # and maximum allowed values for `ttl` depend on the type of the associated
1305 # resource, as well. If `ttl` is not set, the associated resource never
1306 # expires.
1307 },
1308 &quot;deadLetterPolicy&quot;: { # Dead lettering is done on a best effort basis. The same message might be # A policy that specifies the conditions for dead lettering messages in
1309 # this subscription. If dead_letter_policy is not set, dead lettering
1310 # is disabled.
1311 #
1312 # The Cloud Pub/Sub service account associated with this subscriptions&#x27;s
1313 # parent project (i.e.,
1314 # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
1315 # permission to Acknowledge() messages on this subscription.
1316 # dead lettered multiple times.
1317 #
1318 # If validation on any of the fields fails at subscription creation/updation,
1319 # the create/update subscription request will fail.
1320 &quot;deadLetterTopic&quot;: &quot;A String&quot;, # The name of the topic to which dead letter messages should be published.
1321 # Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
1322 # account associated with the enclosing subscription&#x27;s parent project (i.e.,
1323 # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
1324 # permission to Publish() to this topic.
1325 #
1326 # The operation will fail if the topic does not exist.
1327 # Users should ensure that there is a subscription attached to this topic
1328 # since messages published to a topic with no subscriptions are lost.
1329 &quot;maxDeliveryAttempts&quot;: 42, # The maximum number of delivery attempts for any message. The value must be
1330 # between 5 and 100.
1331 #
1332 # The number of delivery attempts is defined as 1 + (the sum of number of
1333 # NACKs and number of times the acknowledgement deadline has been exceeded
1334 # for the message).
1335 #
1336 # A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
1337 # client libraries may automatically extend ack_deadlines.
1338 #
1339 # This field will be honored on a best effort basis.
1340 #
1341 # If this parameter is 0, a default value of 5 is used.
1342 },
1343 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the subscription. It must have the format
1344 # `&quot;projects/{project}/subscriptions/{subscription}&quot;`. `{subscription}` must
1345 # start with a letter, and contain only letters (`[A-Za-z]`), numbers
1346 # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
1347 # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
1348 # in length, and it must not start with `&quot;goog&quot;`.
1349 &quot;topic&quot;: &quot;A String&quot;, # Required. The name of the topic from which this subscription is receiving messages.
1350 # Format is `projects/{project}/topics/{topic}`.
1351 # The value of this field will be `_deleted-topic_` if the topic has been
1352 # deleted.
1353 &quot;pushConfig&quot;: { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is
1354 # used to configure it. An empty `pushConfig` signifies that the subscriber
1355 # will pull and ack messages using API methods.
1356 &quot;attributes&quot;: { # Endpoint configuration attributes that can be used to control different
1357 # aspects of the message delivery.
1358 #
1359 # The only currently supported attribute is `x-goog-version`, which you can
1360 # use to change the format of the pushed message. This attribute
1361 # indicates the version of the data expected by the endpoint. This
1362 # controls the shape of the pushed message (i.e., its fields and metadata).
1363 #
1364 # If not present during the `CreateSubscription` call, it will default to
1365 # the version of the Pub/Sub API used to make such call. If not present in a
1366 # `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
1367 # calls will always return a valid version, even if the subscription was
1368 # created without this attribute.
1369 #
1370 # The only supported values for the `x-goog-version` attribute are:
1371 #
1372 # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
1373 # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
1374 #
1375 # For example:
1376 # &lt;pre&gt;&lt;code&gt;attributes { &quot;x-goog-version&quot;: &quot;v1&quot; } &lt;/code&gt;&lt;/pre&gt;
1377 &quot;a_key&quot;: &quot;A String&quot;,
1378 },
1379 &quot;pushEndpoint&quot;: &quot;A String&quot;, # A URL locating the endpoint to which messages should be pushed.
1380 # For example, a Webhook endpoint might use `https://example.com/push`.
1381 &quot;oidcToken&quot;: { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an
1382 # `Authorization` header in the HTTP request for every pushed message.
1383 # [OpenID Connect
1384 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
1385 &quot;audience&quot;: &quot;A String&quot;, # Audience to be used when generating OIDC token. The audience claim
1386 # identifies the recipients that the JWT is intended for. The audience
1387 # value is a single case-sensitive string. Having multiple values (array)
1388 # for the audience field is not supported. More info about the OIDC JWT
1389 # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
1390 # Note: if not specified, the Push endpoint URL will be used.
1391 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account
1392 # email](https://cloud.google.com/iam/docs/service-accounts)
1393 # to be used for generating the OIDC token. The caller (for
1394 # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must
1395 # have the iam.serviceAccounts.actAs permission for the service account.
1396 },
1397 },
1398 &quot;filter&quot;: &quot;A String&quot;, # An expression written in the Cloud Pub/Sub filter language. If non-empty,
1399 # then only `PubsubMessage`s whose `attributes` field matches the filter are
1400 # delivered on this subscription. If empty, then no messages are filtered
1401 # out.
1402 # &lt;b&gt;EXPERIMENTAL:&lt;/b&gt; This feature is part of a closed alpha release. This
1403 # API might be changed in backward-incompatible ways and is not recommended
1404 # for production use. It is not subject to any SLA or deprecation policy.
1405 &quot;ackDeadlineSeconds&quot;: 42, # The approximate amount of time (on a best-effort basis) Pub/Sub waits for
1406 # the subscriber to acknowledge receipt before resending the message. In the
1407 # interval after the message is delivered and before it is acknowledged, it
1408 # is considered to be &lt;i&gt;outstanding&lt;/i&gt;. During that time period, the
1409 # message will not be redelivered (on a best-effort basis).
1410 #
1411 # For pull subscriptions, this value is used as the initial value for the ack
1412 # deadline. To override this value for a given message, call
1413 # `ModifyAckDeadline` with the corresponding `ack_id` if using
1414 # non-streaming pull or send the `ack_id` in a
1415 # `StreamingModifyAckDeadlineRequest` if using streaming pull.
1416 # The minimum custom deadline you can specify is 10 seconds.
1417 # The maximum custom deadline you can specify is 600 seconds (10 minutes).
1418 # If this parameter is 0, a default value of 10 seconds is used.
1419 #
1420 # For push delivery, this value is also used to set the request timeout for
1421 # the call to the push endpoint.
1422 #
1423 # If the subscriber never acknowledges the message, the Pub/Sub
1424 # system will eventually redeliver the message.
1425 &quot;messageRetentionDuration&quot;: &quot;A String&quot;, # How long to retain unacknowledged messages in the subscription&#x27;s backlog,
1426 # from the moment a message is published.
1427 # If `retain_acked_messages` is true, then this also configures the retention
1428 # of acknowledged messages, and thus configures how far back in time a `Seek`
1429 # can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
1430 # minutes.
1431 },
1432 }
1433
1434 x__xgafv: string, V1 error format.
1435 Allowed values
1436 1 - v1 error format
1437 2 - v2 error format
1438
1439Returns:
1440 An object of the form:
1441
1442 { # A subscription resource.
1443 &quot;retainAckedMessages&quot;: True or False, # Indicates whether to retain acknowledged messages. If true, then
1444 # messages are not expunged from the subscription&#x27;s backlog, even if they are
1445 # acknowledged, until they fall out of the `message_retention_duration`
1446 # window. This must be true if you would like to
1447 # &lt;a
1448 # href=&quot;https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time&quot;&gt;
1449 # Seek to a timestamp&lt;/a&gt;.
1450 &quot;labels&quot;: { # See &lt;a href=&quot;https://cloud.google.com/pubsub/docs/labels&quot;&gt; Creating and
1451 # managing labels&lt;/a&gt;.
1452 &quot;a_key&quot;: &quot;A String&quot;,
1453 },
1454 &quot;expirationPolicy&quot;: { # A policy that specifies the conditions for resource expiration (i.e., # A policy that specifies the conditions for this subscription&#x27;s expiration.
1455 # A subscription is considered active as long as any connected subscriber is
1456 # successfully consuming messages from the subscription or is issuing
1457 # operations on the subscription. If `expiration_policy` is not set, a
1458 # *default policy* with `ttl` of 31 days will be used. The minimum allowed
1459 # value for `expiration_policy.ttl` is 1 day.
1460 # automatic resource deletion).
1461 &quot;ttl&quot;: &quot;A String&quot;, # Specifies the &quot;time-to-live&quot; duration for an associated resource. The
1462 # resource expires if it is not active for a period of `ttl`. The definition
1463 # of &quot;activity&quot; depends on the type of the associated resource. The minimum
1464 # and maximum allowed values for `ttl` depend on the type of the associated
1465 # resource, as well. If `ttl` is not set, the associated resource never
1466 # expires.
1467 },
1468 &quot;deadLetterPolicy&quot;: { # Dead lettering is done on a best effort basis. The same message might be # A policy that specifies the conditions for dead lettering messages in
1469 # this subscription. If dead_letter_policy is not set, dead lettering
1470 # is disabled.
1471 #
1472 # The Cloud Pub/Sub service account associated with this subscriptions&#x27;s
1473 # parent project (i.e.,
1474 # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
1475 # permission to Acknowledge() messages on this subscription.
1476 # dead lettered multiple times.
1477 #
1478 # If validation on any of the fields fails at subscription creation/updation,
1479 # the create/update subscription request will fail.
1480 &quot;deadLetterTopic&quot;: &quot;A String&quot;, # The name of the topic to which dead letter messages should be published.
1481 # Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
1482 # account associated with the enclosing subscription&#x27;s parent project (i.e.,
1483 # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
1484 # permission to Publish() to this topic.
1485 #
1486 # The operation will fail if the topic does not exist.
1487 # Users should ensure that there is a subscription attached to this topic
1488 # since messages published to a topic with no subscriptions are lost.
1489 &quot;maxDeliveryAttempts&quot;: 42, # The maximum number of delivery attempts for any message. The value must be
1490 # between 5 and 100.
1491 #
1492 # The number of delivery attempts is defined as 1 + (the sum of number of
1493 # NACKs and number of times the acknowledgement deadline has been exceeded
1494 # for the message).
1495 #
1496 # A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
1497 # client libraries may automatically extend ack_deadlines.
1498 #
1499 # This field will be honored on a best effort basis.
1500 #
1501 # If this parameter is 0, a default value of 5 is used.
1502 },
1503 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the subscription. It must have the format
1504 # `&quot;projects/{project}/subscriptions/{subscription}&quot;`. `{subscription}` must
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001505 # start with a letter, and contain only letters (`[A-Za-z]`), numbers
1506 # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
1507 # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
Bu Sun Kim65020912020-05-20 12:08:20 -07001508 # in length, and it must not start with `&quot;goog&quot;`.
1509 &quot;topic&quot;: &quot;A String&quot;, # Required. The name of the topic from which this subscription is receiving messages.
1510 # Format is `projects/{project}/topics/{topic}`.
1511 # The value of this field will be `_deleted-topic_` if the topic has been
1512 # deleted.
1513 &quot;pushConfig&quot;: { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001514 # used to configure it. An empty `pushConfig` signifies that the subscriber
1515 # will pull and ack messages using API methods.
Bu Sun Kim65020912020-05-20 12:08:20 -07001516 &quot;attributes&quot;: { # Endpoint configuration attributes that can be used to control different
Dan O'Mearadd494642020-05-01 07:42:23 -07001517 # aspects of the message delivery.
1518 #
1519 # The only currently supported attribute is `x-goog-version`, which you can
1520 # use to change the format of the pushed message. This attribute
1521 # indicates the version of the data expected by the endpoint. This
1522 # controls the shape of the pushed message (i.e., its fields and metadata).
1523 #
1524 # If not present during the `CreateSubscription` call, it will default to
1525 # the version of the Pub/Sub API used to make such call. If not present in a
1526 # `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
1527 # calls will always return a valid version, even if the subscription was
1528 # created without this attribute.
1529 #
1530 # The only supported values for the `x-goog-version` attribute are:
1531 #
1532 # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
1533 # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
1534 #
1535 # For example:
Bu Sun Kim65020912020-05-20 12:08:20 -07001536 # &lt;pre&gt;&lt;code&gt;attributes { &quot;x-goog-version&quot;: &quot;v1&quot; } &lt;/code&gt;&lt;/pre&gt;
1537 &quot;a_key&quot;: &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -07001538 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001539 &quot;pushEndpoint&quot;: &quot;A String&quot;, # A URL locating the endpoint to which messages should be pushed.
1540 # For example, a Webhook endpoint might use `https://example.com/push`.
1541 &quot;oidcToken&quot;: { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an
1542 # `Authorization` header in the HTTP request for every pushed message.
1543 # [OpenID Connect
1544 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
1545 &quot;audience&quot;: &quot;A String&quot;, # Audience to be used when generating OIDC token. The audience claim
1546 # identifies the recipients that the JWT is intended for. The audience
1547 # value is a single case-sensitive string. Having multiple values (array)
1548 # for the audience field is not supported. More info about the OIDC JWT
1549 # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3
1550 # Note: if not specified, the Push endpoint URL will be used.
1551 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account
1552 # email](https://cloud.google.com/iam/docs/service-accounts)
1553 # to be used for generating the OIDC token. The caller (for
1554 # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must
1555 # have the iam.serviceAccounts.actAs permission for the service account.
1556 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001557 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001558 &quot;filter&quot;: &quot;A String&quot;, # An expression written in the Cloud Pub/Sub filter language. If non-empty,
1559 # then only `PubsubMessage`s whose `attributes` field matches the filter are
1560 # delivered on this subscription. If empty, then no messages are filtered
1561 # out.
1562 # &lt;b&gt;EXPERIMENTAL:&lt;/b&gt; This feature is part of a closed alpha release. This
1563 # API might be changed in backward-incompatible ways and is not recommended
1564 # for production use. It is not subject to any SLA or deprecation policy.
1565 &quot;ackDeadlineSeconds&quot;: 42, # The approximate amount of time (on a best-effort basis) Pub/Sub waits for
1566 # the subscriber to acknowledge receipt before resending the message. In the
1567 # interval after the message is delivered and before it is acknowledged, it
1568 # is considered to be &lt;i&gt;outstanding&lt;/i&gt;. During that time period, the
1569 # message will not be redelivered (on a best-effort basis).
1570 #
1571 # For pull subscriptions, this value is used as the initial value for the ack
1572 # deadline. To override this value for a given message, call
1573 # `ModifyAckDeadline` with the corresponding `ack_id` if using
1574 # non-streaming pull or send the `ack_id` in a
1575 # `StreamingModifyAckDeadlineRequest` if using streaming pull.
1576 # The minimum custom deadline you can specify is 10 seconds.
1577 # The maximum custom deadline you can specify is 600 seconds (10 minutes).
1578 # If this parameter is 0, a default value of 10 seconds is used.
1579 #
1580 # For push delivery, this value is also used to set the request timeout for
1581 # the call to the push endpoint.
1582 #
1583 # If the subscriber never acknowledges the message, the Pub/Sub
1584 # system will eventually redeliver the message.
1585 &quot;messageRetentionDuration&quot;: &quot;A String&quot;, # How long to retain unacknowledged messages in the subscription&#x27;s backlog,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001586 # from the moment a message is published.
1587 # If `retain_acked_messages` is true, then this also configures the retention
1588 # of acknowledged messages, and thus configures how far back in time a `Seek`
1589 # can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10
1590 # minutes.
Bu Sun Kim65020912020-05-20 12:08:20 -07001591 }</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001592</div>
1593
1594<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001595 <code class="details" id="pull">pull(subscription, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001596 <pre>Pulls messages from the server. The server may return `UNAVAILABLE` if
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001597there are too many concurrent pull requests pending for the given
1598subscription.
Takashi Matsuo06694102015-09-11 13:55:40 -07001599
1600Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001601 subscription: string, Required. The subscription from which messages should be pulled.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001602Format is `projects/{project}/subscriptions/{sub}`. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001603 body: object, The request body.
Takashi Matsuo06694102015-09-11 13:55:40 -07001604 The object takes the form of:
1605
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001606{ # Request for the `Pull` method.
Bu Sun Kim65020912020-05-20 12:08:20 -07001607 &quot;returnImmediately&quot;: True or False, # Optional. If this field set to true, the system will respond immediately even if
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001608 # it there are no messages available to return in the `Pull` response.
1609 # Otherwise, the system may wait (for a bounded amount of time) until at
Dan O'Mearadd494642020-05-01 07:42:23 -07001610 # least one message is available, rather than returning no messages. Warning:
1611 # setting this field to `true` is discouraged because it adversely impacts
1612 # the performance of `Pull` operations. We recommend that users do not set
1613 # this field.
Bu Sun Kim65020912020-05-20 12:08:20 -07001614 &quot;maxMessages&quot;: 42, # Required. The maximum number of messages to return for this request. Must be a
Dan O'Mearadd494642020-05-01 07:42:23 -07001615 # positive integer. The Pub/Sub system may return fewer than the number
1616 # specified.
Takashi Matsuo06694102015-09-11 13:55:40 -07001617 }
1618
1619 x__xgafv: string, V1 error format.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001620 Allowed values
1621 1 - v1 error format
1622 2 - v2 error format
Takashi Matsuo06694102015-09-11 13:55:40 -07001623
1624Returns:
1625 An object of the form:
1626
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001627 { # Response for the `Pull` method.
Bu Sun Kim65020912020-05-20 12:08:20 -07001628 &quot;receivedMessages&quot;: [ # Received Pub/Sub messages. The list will be empty if there are no more
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001629 # messages available in the backlog. For JSON, the response can be entirely
1630 # empty. The Pub/Sub system may return fewer than the `maxMessages` requested
1631 # even if there are more messages available in the backlog.
Takashi Matsuo06694102015-09-11 13:55:40 -07001632 { # A message and its corresponding acknowledgment ID.
Bu Sun Kim65020912020-05-20 12:08:20 -07001633 &quot;deliveryAttempt&quot;: 42, # The approximate number of times that Cloud Pub/Sub has attempted to deliver
1634 # the associated message to a subscriber.
1635 #
1636 # More precisely, this is 1 + (number of NACKs) +
1637 # (number of ack_deadline exceeds) for this message.
Dan O'Mearadd494642020-05-01 07:42:23 -07001638 #
1639 # A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline
1640 # exceeds event is whenever a message is not acknowledged within
1641 # ack_deadline. Note that ack_deadline is initially
1642 # Subscription.ackDeadlineSeconds, but may get extended automatically by
1643 # the client library.
1644 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001645 # Upon the first delivery of a given message, `delivery_attempt` will have a
1646 # value of 1. The value is calculated at best effort and is approximate.
Dan O'Mearadd494642020-05-01 07:42:23 -07001647 #
1648 # If a DeadLetterPolicy is not set on the subscription, this will be 0.
Bu Sun Kim65020912020-05-20 12:08:20 -07001649 &quot;message&quot;: { # A message that is published by publishers and consumed by subscribers. The # The message.
1650 # message must contain either a non-empty data field or at least one attribute.
1651 # Note that client libraries represent this object differently
1652 # depending on the language. See the corresponding
1653 # &lt;a href=&quot;https://cloud.google.com/pubsub/docs/reference/libraries&quot;&gt;client
1654 # library documentation&lt;/a&gt; for more information. See
1655 # &lt;a href=&quot;https://cloud.google.com/pubsub/quotas&quot;&gt;Quotas and limits&lt;/a&gt;
1656 # for more information about message limits.
1657 &quot;messageId&quot;: &quot;A String&quot;, # ID of this message, assigned by the server when the message is published.
1658 # Guaranteed to be unique within the topic. This value may be read by a
1659 # subscriber that receives a `PubsubMessage` via a `Pull` call or a push
1660 # delivery. It must not be populated by the publisher in a `Publish` call.
1661 &quot;attributes&quot;: { # Attributes for this message. If this field is empty, the message must
1662 # contain non-empty data.
1663 &quot;a_key&quot;: &quot;A String&quot;,
1664 },
1665 &quot;publishTime&quot;: &quot;A String&quot;, # The time at which the message was published, populated by the server when
1666 # it receives the `Publish` call. It must not be populated by the
1667 # publisher in a `Publish` call.
1668 &quot;data&quot;: &quot;A String&quot;, # The message data field. If this field is empty, the message must contain
1669 # at least one attribute.
1670 },
1671 &quot;ackId&quot;: &quot;A String&quot;, # This ID can be used to acknowledge the received message.
Takashi Matsuo06694102015-09-11 13:55:40 -07001672 },
1673 ],
1674 }</pre>
1675</div>
1676
1677<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001678 <code class="details" id="seek">seek(subscription, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001679 <pre>Seeks an existing subscription to a point in time or to a given snapshot,
1680whichever is provided in the request. Snapshots are used in
Bu Sun Kim65020912020-05-20 12:08:20 -07001681&lt;a href=&quot;https://cloud.google.com/pubsub/docs/replay-overview&quot;&gt;Seek&lt;/a&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001682operations, which allow
1683you to manage message acknowledgments in bulk. That is, you can set the
1684acknowledgment state of messages in an existing subscription to the state
1685captured by a snapshot. Note that both the subscription and the snapshot
1686must be on the same topic.
1687
1688Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001689 subscription: string, Required. The subscription to affect. (required)
1690 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001691 The object takes the form of:
1692
1693{ # Request for the `Seek` method.
Bu Sun Kim65020912020-05-20 12:08:20 -07001694 &quot;time&quot;: &quot;A String&quot;, # The time to seek to.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001695 # Messages retained in the subscription that were published before this
1696 # time are marked as acknowledged, and messages retained in the
1697 # subscription that were published after this time are marked as
1698 # unacknowledged. Note that this operation affects only those messages
1699 # retained in the subscription (configured by the combination of
1700 # `message_retention_duration` and `retain_acked_messages`). For example,
1701 # if `time` corresponds to a point before the message retention
Bu Sun Kim65020912020-05-20 12:08:20 -07001702 # window (or to a point before the system&#x27;s notion of the subscription
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001703 # creation time), only retained messages will be marked as unacknowledged,
1704 # and already-expunged messages will not be restored.
Bu Sun Kim65020912020-05-20 12:08:20 -07001705 &quot;snapshot&quot;: &quot;A String&quot;, # The snapshot to seek to. The snapshot&#x27;s topic must be the same as that of
1706 # the provided subscription.
1707 # Format is `projects/{project}/snapshots/{snap}`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001708 }
1709
1710 x__xgafv: string, V1 error format.
1711 Allowed values
1712 1 - v1 error format
1713 2 - v2 error format
1714
1715Returns:
1716 An object of the form:
1717
1718 { # Response for the `Seek` method (this response is empty).
1719 }</pre>
1720</div>
1721
1722<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001723 <code class="details" id="setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</code>
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001724 <pre>Sets the access control policy on the specified resource. Replaces any
1725existing policy.
Takashi Matsuo06694102015-09-11 13:55:40 -07001726
Bu Sun Kim65020912020-05-20 12:08:20 -07001727Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
Dan O'Mearadd494642020-05-01 07:42:23 -07001728
Takashi Matsuo06694102015-09-11 13:55:40 -07001729Args:
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001730 resource: string, REQUIRED: The resource for which the policy is being specified.
Sai Cheemalapatie833b792017-03-24 15:06:46 -07001731See the operation documentation for the appropriate value for this field. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001732 body: object, The request body.
Takashi Matsuo06694102015-09-11 13:55:40 -07001733 The object takes the form of:
1734
1735{ # Request message for `SetIamPolicy` method.
Bu Sun Kim65020912020-05-20 12:08:20 -07001736 &quot;policy&quot;: { # An Identity and Access Management (IAM) policy, which specifies access # REQUIRED: The complete policy to be applied to the `resource`. The size of
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001737 # the policy is limited to a few 10s of KB. An empty policy is a
1738 # valid policy but certain Cloud Platform services (such as Projects)
1739 # might reject them.
Dan O'Mearadd494642020-05-01 07:42:23 -07001740 # controls for Google Cloud resources.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001741 #
1742 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001743 # A `Policy` is a collection of `bindings`. A `binding` binds one or more
1744 # `members` to a single `role`. Members can be user accounts, service accounts,
1745 # Google groups, and domains (such as G Suite). A `role` is a named list of
1746 # permissions; each `role` can be an IAM predefined role or a user-created
1747 # custom role.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001748 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001749 # For some types of Google Cloud resources, a `binding` can also specify a
1750 # `condition`, which is a logical expression that allows access to a resource
1751 # only if the expression evaluates to `true`. A condition can add constraints
1752 # based on attributes of the request, the resource, or both. To learn which
1753 # resources support conditions in their IAM policies, see the
1754 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Dan O'Mearadd494642020-05-01 07:42:23 -07001755 #
1756 # **JSON example:**
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001757 #
1758 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07001759 # &quot;bindings&quot;: [
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001760 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07001761 # &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;,
1762 # &quot;members&quot;: [
1763 # &quot;user:mike@example.com&quot;,
1764 # &quot;group:admins@example.com&quot;,
1765 # &quot;domain:google.com&quot;,
1766 # &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot;
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001767 # ]
1768 # },
1769 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07001770 # &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;,
1771 # &quot;members&quot;: [
1772 # &quot;user:eve@example.com&quot;
1773 # ],
1774 # &quot;condition&quot;: {
1775 # &quot;title&quot;: &quot;expirable access&quot;,
1776 # &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;,
1777 # &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -07001778 # }
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001779 # }
Dan O'Mearadd494642020-05-01 07:42:23 -07001780 # ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001781 # &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;,
1782 # &quot;version&quot;: 3
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001783 # }
1784 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001785 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001786 #
1787 # bindings:
1788 # - members:
1789 # - user:mike@example.com
1790 # - group:admins@example.com
1791 # - domain:google.com
Dan O'Mearadd494642020-05-01 07:42:23 -07001792 # - serviceAccount:my-project-id@appspot.gserviceaccount.com
1793 # role: roles/resourcemanager.organizationAdmin
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001794 # - members:
Dan O'Mearadd494642020-05-01 07:42:23 -07001795 # - user:eve@example.com
1796 # role: roles/resourcemanager.organizationViewer
1797 # condition:
1798 # title: expirable access
1799 # description: Does not grant access after Sep 2020
Bu Sun Kim65020912020-05-20 12:08:20 -07001800 # expression: request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)
Dan O'Mearadd494642020-05-01 07:42:23 -07001801 # - etag: BwWWja0YfJA=
1802 # - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001803 #
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001804 # For a description of IAM and its features, see the
Dan O'Mearadd494642020-05-01 07:42:23 -07001805 # [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim65020912020-05-20 12:08:20 -07001806 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
1807 # prevent simultaneous updates of a policy from overwriting each other.
1808 # It is strongly suggested that systems make use of the `etag` in the
1809 # read-modify-write cycle to perform policy updates in order to avoid race
1810 # conditions: An `etag` is returned in the response to `getIamPolicy`, and
1811 # systems are expected to put that etag in the request to `setIamPolicy` to
1812 # ensure that their change will be applied to the same version of the policy.
1813 #
1814 # **Important:** If you use IAM Conditions, you must include the `etag` field
1815 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
1816 # you to overwrite a version `3` policy with a version `1` policy, and all of
1817 # the conditions in the version `3` policy are lost.
1818 &quot;version&quot;: 42, # Specifies the format of the policy.
1819 #
1820 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
1821 # are rejected.
1822 #
1823 # Any operation that affects conditional role bindings must specify version
1824 # `3`. This requirement applies to the following operations:
1825 #
1826 # * Getting a policy that includes a conditional role binding
1827 # * Adding a conditional role binding to a policy
1828 # * Changing a conditional role binding in a policy
1829 # * Removing any role binding, with or without a condition, from a policy
1830 # that includes conditions
1831 #
1832 # **Important:** If you use IAM Conditions, you must include the `etag` field
1833 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
1834 # you to overwrite a version `3` policy with a version `1` policy, and all of
1835 # the conditions in the version `3` policy are lost.
1836 #
1837 # If a policy does not include any conditions, operations on that policy may
1838 # specify any valid version or leave the field unset.
1839 #
1840 # To learn which resources support conditions in their IAM policies, see the
1841 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1842 &quot;bindings&quot;: [ # Associates a list of `members` to a `role`. Optionally, may specify a
Dan O'Mearadd494642020-05-01 07:42:23 -07001843 # `condition` that determines how and when the `bindings` are applied. Each
1844 # of the `bindings` must contain at least one member.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001845 { # Associates `members` with a `role`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001846 &quot;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding.
1847 #
1848 # If the condition evaluates to `true`, then this binding applies to the
1849 # current request.
1850 #
1851 # If the condition evaluates to `false`, then this binding does not apply to
1852 # the current request. However, a different role binding might grant the same
1853 # role to one or more of the members in this binding.
1854 #
1855 # To learn which resources support conditions in their IAM policies, see the
1856 # [IAM
1857 # documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1858 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
1859 # are documented at https://github.com/google/cel-spec.
1860 #
1861 # Example (Comparison):
1862 #
1863 # title: &quot;Summary size limit&quot;
1864 # description: &quot;Determines if a summary is less than 100 chars&quot;
1865 # expression: &quot;document.summary.size() &lt; 100&quot;
1866 #
1867 # Example (Equality):
1868 #
1869 # title: &quot;Requestor is owner&quot;
1870 # description: &quot;Determines if requestor is the document owner&quot;
1871 # expression: &quot;document.owner == request.auth.claims.email&quot;
1872 #
1873 # Example (Logic):
1874 #
1875 # title: &quot;Public documents&quot;
1876 # description: &quot;Determine whether the document should be publicly visible&quot;
1877 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
1878 #
1879 # Example (Data Manipulation):
1880 #
1881 # title: &quot;Notification string&quot;
1882 # description: &quot;Create a notification string with a timestamp.&quot;
1883 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
1884 #
1885 # The exact variables and functions that may be referenced within an expression
1886 # are determined by the service that evaluates it. See the service
1887 # documentation for additional information.
1888 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
1889 # reporting, e.g. a file name and a position in the file.
1890 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
1891 # its purpose. This can be used e.g. in UIs which allow to enter the
1892 # expression.
1893 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
1894 # describes the expression, e.g. when hovered over it in a UI.
1895 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
1896 # syntax.
1897 },
1898 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001899 # `members` can have the following values:
1900 #
1901 # * `allUsers`: A special identifier that represents anyone who is
1902 # on the internet; with or without a Google account.
1903 #
1904 # * `allAuthenticatedUsers`: A special identifier that represents anyone
1905 # who is authenticated with a Google account or a service account.
1906 #
1907 # * `user:{emailid}`: An email address that represents a specific Google
Dan O'Mearadd494642020-05-01 07:42:23 -07001908 # account. For example, `alice@example.com` .
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001909 #
1910 #
1911 # * `serviceAccount:{emailid}`: An email address that represents a service
1912 # account. For example, `my-other-app@appspot.gserviceaccount.com`.
1913 #
1914 # * `group:{emailid}`: An email address that represents a Google group.
1915 # For example, `admins@example.com`.
1916 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001917 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
1918 # identifier) representing a user that has been recently deleted. For
1919 # example, `alice@example.com?uid=123456789012345678901`. If the user is
1920 # recovered, this value reverts to `user:{emailid}` and the recovered user
1921 # retains the role in the binding.
1922 #
1923 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
1924 # unique identifier) representing a service account that has been recently
1925 # deleted. For example,
1926 # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
1927 # If the service account is undeleted, this value reverts to
1928 # `serviceAccount:{emailid}` and the undeleted service account retains the
1929 # role in the binding.
1930 #
1931 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
1932 # identifier) representing a Google group that has been recently
1933 # deleted. For example, `admins@example.com?uid=123456789012345678901`. If
1934 # the group is recovered, this value reverts to `group:{emailid}` and the
1935 # recovered group retains the role in the binding.
1936 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001937 #
1938 # * `domain:{domain}`: The G Suite domain (primary) that represents all the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001939 # users of that domain. For example, `google.com` or `example.com`.
1940 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001941 &quot;A String&quot;,
Takashi Matsuo06694102015-09-11 13:55:40 -07001942 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001943 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`.
1944 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Takashi Matsuo06694102015-09-11 13:55:40 -07001945 },
1946 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001947 },
1948 }
1949
1950 x__xgafv: string, V1 error format.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001951 Allowed values
1952 1 - v1 error format
1953 2 - v2 error format
Takashi Matsuo06694102015-09-11 13:55:40 -07001954
1955Returns:
1956 An object of the form:
1957
Dan O'Mearadd494642020-05-01 07:42:23 -07001958 { # An Identity and Access Management (IAM) policy, which specifies access
1959 # controls for Google Cloud resources.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001960 #
1961 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001962 # A `Policy` is a collection of `bindings`. A `binding` binds one or more
1963 # `members` to a single `role`. Members can be user accounts, service accounts,
1964 # Google groups, and domains (such as G Suite). A `role` is a named list of
1965 # permissions; each `role` can be an IAM predefined role or a user-created
1966 # custom role.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001967 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001968 # For some types of Google Cloud resources, a `binding` can also specify a
1969 # `condition`, which is a logical expression that allows access to a resource
1970 # only if the expression evaluates to `true`. A condition can add constraints
1971 # based on attributes of the request, the resource, or both. To learn which
1972 # resources support conditions in their IAM policies, see the
1973 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Dan O'Mearadd494642020-05-01 07:42:23 -07001974 #
1975 # **JSON example:**
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001976 #
1977 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07001978 # &quot;bindings&quot;: [
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001979 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07001980 # &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;,
1981 # &quot;members&quot;: [
1982 # &quot;user:mike@example.com&quot;,
1983 # &quot;group:admins@example.com&quot;,
1984 # &quot;domain:google.com&quot;,
1985 # &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot;
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001986 # ]
1987 # },
1988 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07001989 # &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;,
1990 # &quot;members&quot;: [
1991 # &quot;user:eve@example.com&quot;
1992 # ],
1993 # &quot;condition&quot;: {
1994 # &quot;title&quot;: &quot;expirable access&quot;,
1995 # &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;,
1996 # &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -07001997 # }
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001998 # }
Dan O'Mearadd494642020-05-01 07:42:23 -07001999 # ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002000 # &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;,
2001 # &quot;version&quot;: 3
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002002 # }
2003 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002004 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002005 #
2006 # bindings:
2007 # - members:
2008 # - user:mike@example.com
2009 # - group:admins@example.com
2010 # - domain:google.com
Dan O'Mearadd494642020-05-01 07:42:23 -07002011 # - serviceAccount:my-project-id@appspot.gserviceaccount.com
2012 # role: roles/resourcemanager.organizationAdmin
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002013 # - members:
Dan O'Mearadd494642020-05-01 07:42:23 -07002014 # - user:eve@example.com
2015 # role: roles/resourcemanager.organizationViewer
2016 # condition:
2017 # title: expirable access
2018 # description: Does not grant access after Sep 2020
Bu Sun Kim65020912020-05-20 12:08:20 -07002019 # expression: request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)
Dan O'Mearadd494642020-05-01 07:42:23 -07002020 # - etag: BwWWja0YfJA=
2021 # - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002022 #
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002023 # For a description of IAM and its features, see the
Dan O'Mearadd494642020-05-01 07:42:23 -07002024 # [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim65020912020-05-20 12:08:20 -07002025 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
2026 # prevent simultaneous updates of a policy from overwriting each other.
2027 # It is strongly suggested that systems make use of the `etag` in the
2028 # read-modify-write cycle to perform policy updates in order to avoid race
2029 # conditions: An `etag` is returned in the response to `getIamPolicy`, and
2030 # systems are expected to put that etag in the request to `setIamPolicy` to
2031 # ensure that their change will be applied to the same version of the policy.
2032 #
2033 # **Important:** If you use IAM Conditions, you must include the `etag` field
2034 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
2035 # you to overwrite a version `3` policy with a version `1` policy, and all of
2036 # the conditions in the version `3` policy are lost.
2037 &quot;version&quot;: 42, # Specifies the format of the policy.
2038 #
2039 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
2040 # are rejected.
2041 #
2042 # Any operation that affects conditional role bindings must specify version
2043 # `3`. This requirement applies to the following operations:
2044 #
2045 # * Getting a policy that includes a conditional role binding
2046 # * Adding a conditional role binding to a policy
2047 # * Changing a conditional role binding in a policy
2048 # * Removing any role binding, with or without a condition, from a policy
2049 # that includes conditions
2050 #
2051 # **Important:** If you use IAM Conditions, you must include the `etag` field
2052 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
2053 # you to overwrite a version `3` policy with a version `1` policy, and all of
2054 # the conditions in the version `3` policy are lost.
2055 #
2056 # If a policy does not include any conditions, operations on that policy may
2057 # specify any valid version or leave the field unset.
2058 #
2059 # To learn which resources support conditions in their IAM policies, see the
2060 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
2061 &quot;bindings&quot;: [ # Associates a list of `members` to a `role`. Optionally, may specify a
Dan O'Mearadd494642020-05-01 07:42:23 -07002062 # `condition` that determines how and when the `bindings` are applied. Each
2063 # of the `bindings` must contain at least one member.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002064 { # Associates `members` with a `role`.
Bu Sun Kim65020912020-05-20 12:08:20 -07002065 &quot;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding.
2066 #
2067 # If the condition evaluates to `true`, then this binding applies to the
2068 # current request.
2069 #
2070 # If the condition evaluates to `false`, then this binding does not apply to
2071 # the current request. However, a different role binding might grant the same
2072 # role to one or more of the members in this binding.
2073 #
2074 # To learn which resources support conditions in their IAM policies, see the
2075 # [IAM
2076 # documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
2077 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
2078 # are documented at https://github.com/google/cel-spec.
2079 #
2080 # Example (Comparison):
2081 #
2082 # title: &quot;Summary size limit&quot;
2083 # description: &quot;Determines if a summary is less than 100 chars&quot;
2084 # expression: &quot;document.summary.size() &lt; 100&quot;
2085 #
2086 # Example (Equality):
2087 #
2088 # title: &quot;Requestor is owner&quot;
2089 # description: &quot;Determines if requestor is the document owner&quot;
2090 # expression: &quot;document.owner == request.auth.claims.email&quot;
2091 #
2092 # Example (Logic):
2093 #
2094 # title: &quot;Public documents&quot;
2095 # description: &quot;Determine whether the document should be publicly visible&quot;
2096 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
2097 #
2098 # Example (Data Manipulation):
2099 #
2100 # title: &quot;Notification string&quot;
2101 # description: &quot;Create a notification string with a timestamp.&quot;
2102 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
2103 #
2104 # The exact variables and functions that may be referenced within an expression
2105 # are determined by the service that evaluates it. See the service
2106 # documentation for additional information.
2107 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
2108 # reporting, e.g. a file name and a position in the file.
2109 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
2110 # its purpose. This can be used e.g. in UIs which allow to enter the
2111 # expression.
2112 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
2113 # describes the expression, e.g. when hovered over it in a UI.
2114 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
2115 # syntax.
2116 },
2117 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002118 # `members` can have the following values:
2119 #
2120 # * `allUsers`: A special identifier that represents anyone who is
2121 # on the internet; with or without a Google account.
2122 #
2123 # * `allAuthenticatedUsers`: A special identifier that represents anyone
2124 # who is authenticated with a Google account or a service account.
2125 #
2126 # * `user:{emailid}`: An email address that represents a specific Google
Dan O'Mearadd494642020-05-01 07:42:23 -07002127 # account. For example, `alice@example.com` .
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002128 #
2129 #
2130 # * `serviceAccount:{emailid}`: An email address that represents a service
2131 # account. For example, `my-other-app@appspot.gserviceaccount.com`.
2132 #
2133 # * `group:{emailid}`: An email address that represents a Google group.
2134 # For example, `admins@example.com`.
2135 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002136 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
2137 # identifier) representing a user that has been recently deleted. For
2138 # example, `alice@example.com?uid=123456789012345678901`. If the user is
2139 # recovered, this value reverts to `user:{emailid}` and the recovered user
2140 # retains the role in the binding.
2141 #
2142 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
2143 # unique identifier) representing a service account that has been recently
2144 # deleted. For example,
2145 # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
2146 # If the service account is undeleted, this value reverts to
2147 # `serviceAccount:{emailid}` and the undeleted service account retains the
2148 # role in the binding.
2149 #
2150 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
2151 # identifier) representing a Google group that has been recently
2152 # deleted. For example, `admins@example.com?uid=123456789012345678901`. If
2153 # the group is recovered, this value reverts to `group:{emailid}` and the
2154 # recovered group retains the role in the binding.
2155 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002156 #
2157 # * `domain:{domain}`: The G Suite domain (primary) that represents all the
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002158 # users of that domain. For example, `google.com` or `example.com`.
2159 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002160 &quot;A String&quot;,
Takashi Matsuo06694102015-09-11 13:55:40 -07002161 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002162 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`.
2163 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Takashi Matsuo06694102015-09-11 13:55:40 -07002164 },
2165 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002166 }</pre>
2167</div>
2168
2169<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002170 <code class="details" id="testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -07002171 <pre>Returns permissions that a caller has on the specified resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002172If the resource does not exist, this will return an empty set of
Bu Sun Kim65020912020-05-20 12:08:20 -07002173permissions, not a `NOT_FOUND` error.
Takashi Matsuo06694102015-09-11 13:55:40 -07002174
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002175Note: This operation is designed to be used for building permission-aware
2176UIs and command-line tools, not for authorization checking. This operation
Bu Sun Kim65020912020-05-20 12:08:20 -07002177may &quot;fail open&quot; without warning.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002178
Takashi Matsuo06694102015-09-11 13:55:40 -07002179Args:
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002180 resource: string, REQUIRED: The resource for which the policy detail is being requested.
Sai Cheemalapatie833b792017-03-24 15:06:46 -07002181See the operation documentation for the appropriate value for this field. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002182 body: object, The request body.
Takashi Matsuo06694102015-09-11 13:55:40 -07002183 The object takes the form of:
2184
2185{ # Request message for `TestIamPermissions` method.
Bu Sun Kim65020912020-05-20 12:08:20 -07002186 &quot;permissions&quot;: [ # The set of permissions to check for the `resource`. Permissions with
2187 # wildcards (such as &#x27;*&#x27; or &#x27;storage.*&#x27;) are not allowed. For more
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002188 # information see
2189 # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
Bu Sun Kim65020912020-05-20 12:08:20 -07002190 &quot;A String&quot;,
Takashi Matsuo06694102015-09-11 13:55:40 -07002191 ],
2192 }
2193
2194 x__xgafv: string, V1 error format.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002195 Allowed values
2196 1 - v1 error format
2197 2 - v2 error format
Takashi Matsuo06694102015-09-11 13:55:40 -07002198
2199Returns:
2200 An object of the form:
2201
2202 { # Response message for `TestIamPermissions` method.
Bu Sun Kim65020912020-05-20 12:08:20 -07002203 &quot;permissions&quot;: [ # A subset of `TestPermissionsRequest.permissions` that the caller is
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002204 # allowed.
Bu Sun Kim65020912020-05-20 12:08:20 -07002205 &quot;A String&quot;,
Takashi Matsuo06694102015-09-11 13:55:40 -07002206 ],
2207 }</pre>
2208</div>
2209
2210</body></html>