Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, 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 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, 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 Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 75 | <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 Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 78 | <code><a href="#acknowledge">acknowledge(subscription, body=None, x__xgafv=None)</a></code></p> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 79 | <p class="firstline">Acknowledges the messages associated with the `ack_ids` in the</p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 80 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 81 | <code><a href="#create">create(name, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 82 | <p class="firstline">Creates a subscription to a given topic. See the [resource name rules]</p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 83 | <p class="toc_element"> |
Thomas Coffee | 2f24537 | 2017-03-27 10:39:26 -0700 | [diff] [blame] | 84 | <code><a href="#delete">delete(subscription, x__xgafv=None)</a></code></p> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 85 | <p class="firstline">Deletes an existing subscription. All messages retained in the subscription</p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 86 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 87 | <code><a href="#detach">detach(subscription, x__xgafv=None)</a></code></p> |
| 88 | <p class="firstline">Detaches a subscription from this topic. All messages retained in the</p> |
| 89 | <p class="toc_element"> |
Thomas Coffee | 2f24537 | 2017-03-27 10:39:26 -0700 | [diff] [blame] | 90 | <code><a href="#get">get(subscription, x__xgafv=None)</a></code></p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 91 | <p class="firstline">Gets the configuration details of a subscription.</p> |
| 92 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 93 | <code><a href="#getIamPolicy">getIamPolicy(resource, options_requestedPolicyVersion=None, x__xgafv=None)</a></code></p> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 94 | <p class="firstline">Gets the access control policy for a resource.</p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 95 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 96 | <code><a href="#list">list(project, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 97 | <p class="firstline">Lists matching subscriptions.</p> |
| 98 | <p class="toc_element"> |
| 99 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 100 | <p class="firstline">Retrieves the next page of results.</p> |
| 101 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 102 | <code><a href="#modifyAckDeadline">modifyAckDeadline(subscription, body=None, x__xgafv=None)</a></code></p> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 103 | <p class="firstline">Modifies the ack deadline for a specific message. This method is useful</p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 104 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 105 | <code><a href="#modifyPushConfig">modifyPushConfig(subscription, body=None, x__xgafv=None)</a></code></p> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 106 | <p class="firstline">Modifies the `PushConfig` for a specified subscription.</p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 107 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 108 | <code><a href="#patch">patch(name, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 109 | <p class="firstline">Updates an existing subscription. Note that certain properties of a</p> |
| 110 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 111 | <code><a href="#pull">pull(subscription, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 112 | <p class="firstline">Pulls messages from the server. The server may return `UNAVAILABLE` if</p> |
| 113 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 114 | <code><a href="#seek">seek(subscription, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 115 | <p class="firstline">Seeks an existing subscription to a point in time or to a given snapshot,</p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 116 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 117 | <code><a href="#setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</a></code></p> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 118 | <p class="firstline">Sets the access control policy on the specified resource. Replaces any</p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 119 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 120 | <code><a href="#testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</a></code></p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 121 | <p class="firstline">Returns permissions that a caller has on the specified resource.</p> |
| 122 | <h3>Method Details</h3> |
| 123 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 124 | <code class="details" id="acknowledge">acknowledge(subscription, body=None, x__xgafv=None)</code> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 125 | <pre>Acknowledges the messages associated with the `ack_ids` in the |
| 126 | `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages |
| 127 | from the subscription. |
| 128 | |
| 129 | Acknowledging a message whose ack deadline has expired may succeed, |
| 130 | but such a message may be redelivered later. Acknowledging a message more |
| 131 | than once will not result in an error. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 132 | |
| 133 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 134 | subscription: string, Required. The subscription whose message is being acknowledged. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 135 | Format is `projects/{project}/subscriptions/{sub}`. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 136 | body: object, The request body. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 137 | The object takes the form of: |
| 138 | |
| 139 | { # Request for the Acknowledge method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 140 | "ackIds": [ # Required. The acknowledgment ID for the messages being acknowledged that was returned |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 141 | # by the Pub/Sub system in the `Pull` response. Must not be empty. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 142 | "A String", |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 143 | ], |
| 144 | } |
| 145 | |
| 146 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 147 | Allowed values |
| 148 | 1 - v1 error format |
| 149 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 150 | |
| 151 | Returns: |
| 152 | An object of the form: |
| 153 | |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 154 | { # A generic empty message that you can re-use to avoid defining duplicated |
| 155 | # empty messages in your APIs. A typical example is to use it as the request |
| 156 | # or the response type of an API method. For instance: |
| 157 | # |
| 158 | # service Foo { |
| 159 | # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 160 | # } |
| 161 | # |
| 162 | # The JSON representation for `Empty` is empty JSON object `{}`. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 163 | }</pre> |
| 164 | </div> |
| 165 | |
| 166 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 167 | <code class="details" id="create">create(name, body=None, x__xgafv=None)</code> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 168 | <pre>Creates a subscription to a given topic. See the [resource name rules] |
| 169 | (https://cloud.google.com/pubsub/docs/admin#resource_names). |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 170 | If the subscription already exists, returns `ALREADY_EXISTS`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 171 | If the corresponding topic doesn't exist, returns `NOT_FOUND`. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 172 | |
| 173 | If the name is not provided in the request, the server will assign a random |
| 174 | name for this subscription on the same project as the topic, conforming |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 175 | to the [resource name format] |
| 176 | (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated |
| 177 | name is populated in the returned Subscription object. Note that for REST |
| 178 | API requests, you must specify a name in the request. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 179 | |
| 180 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 181 | name: string, Required. The name of the subscription. It must have the format |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 182 | `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 183 | start with a letter, and contain only letters (`[A-Za-z]`), numbers |
| 184 | (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), |
| 185 | plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 186 | in length, and it must not start with `"goog"`. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 187 | body: object, The request body. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 188 | The object takes the form of: |
| 189 | |
| 190 | { # A subscription resource. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 191 | "topic": "A String", # Required. The name of the topic from which this subscription is receiving messages. |
| 192 | # Format is `projects/{project}/topics/{topic}`. |
| 193 | # The value of this field will be `_deleted-topic_` if the topic has been |
| 194 | # deleted. |
| 195 | "ackDeadlineSeconds": 42, # The approximate amount of time (on a best-effort basis) Pub/Sub waits for |
| 196 | # the subscriber to acknowledge receipt before resending the message. In the |
| 197 | # interval after the message is delivered and before it is acknowledged, it |
| 198 | # is considered to be <i>outstanding</i>. During that time period, the |
| 199 | # message will not be redelivered (on a best-effort basis). |
| 200 | # |
| 201 | # For pull subscriptions, this value is used as the initial value for the ack |
| 202 | # deadline. To override this value for a given message, call |
| 203 | # `ModifyAckDeadline` with the corresponding `ack_id` if using |
| 204 | # non-streaming pull or send the `ack_id` in a |
| 205 | # `StreamingModifyAckDeadlineRequest` if using streaming pull. |
| 206 | # The minimum custom deadline you can specify is 10 seconds. |
| 207 | # The maximum custom deadline you can specify is 600 seconds (10 minutes). |
| 208 | # If this parameter is 0, a default value of 10 seconds is used. |
| 209 | # |
| 210 | # For push delivery, this value is also used to set the request timeout for |
| 211 | # the call to the push endpoint. |
| 212 | # |
| 213 | # If the subscriber never acknowledges the message, the Pub/Sub |
| 214 | # system will eventually redeliver the message. |
| 215 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
| 216 | # managing labels</a>. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 217 | "a_key": "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 218 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 219 | "expirationPolicy": { # A policy that specifies the conditions for resource expiration (i.e., # A policy that specifies the conditions for this subscription's expiration. |
| 220 | # A subscription is considered active as long as any connected subscriber is |
| 221 | # successfully consuming messages from the subscription or is issuing |
| 222 | # operations on the subscription. If `expiration_policy` is not set, a |
| 223 | # *default policy* with `ttl` of 31 days will be used. The minimum allowed |
| 224 | # value for `expiration_policy.ttl` is 1 day. |
| 225 | # automatic resource deletion). |
| 226 | "ttl": "A String", # Specifies the "time-to-live" duration for an associated resource. The |
| 227 | # resource expires if it is not active for a period of `ttl`. The definition |
| 228 | # of "activity" depends on the type of the associated resource. The minimum |
| 229 | # and maximum allowed values for `ttl` depend on the type of the associated |
| 230 | # resource, as well. If `ttl` is not set, the associated resource never |
| 231 | # expires. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 232 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 233 | "retryPolicy": { # A policy that specifies how Cloud Pub/Sub retries message delivery. # A policy that specifies how Pub/Sub retries message delivery for this |
| 234 | # subscription. |
| 235 | # |
| 236 | # If not set, the default retry policy is applied. This generally implies |
| 237 | # that messages will be retried as soon as possible for healthy subscribers. |
| 238 | # RetryPolicy will be triggered on NACKs or acknowledgement deadline |
| 239 | # exceeded events for a given message. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 240 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 241 | # Retry delay will be exponential based on provided minimum and maximum |
| 242 | # backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 243 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 244 | # RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded |
| 245 | # events for a given message. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 246 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 247 | # Retry Policy is implemented on a best effort basis. At times, the delay |
| 248 | # between consecutive deliveries may not match the configuration. That is, |
| 249 | # delay can be more or less than configured backoff. |
| 250 | "minimumBackoff": "A String", # The minimum delay between consecutive deliveries of a given message. |
| 251 | # Value should be between 0 and 600 seconds. Defaults to 10 seconds. |
| 252 | "maximumBackoff": "A String", # The maximum delay between consecutive deliveries of a given message. |
| 253 | # Value should be between 0 and 600 seconds. Defaults to 600 seconds. |
| 254 | }, |
| 255 | "messageRetentionDuration": "A String", # How long to retain unacknowledged messages in the subscription's backlog, |
| 256 | # from the moment a message is published. |
| 257 | # If `retain_acked_messages` is true, then this also configures the retention |
| 258 | # of acknowledged messages, and thus configures how far back in time a `Seek` |
| 259 | # can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10 |
| 260 | # minutes. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 261 | "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 262 | # used to configure it. An empty `pushConfig` signifies that the subscriber |
| 263 | # will pull and ack messages using API methods. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 264 | "oidcToken": { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an |
| 265 | # `Authorization` header in the HTTP request for every pushed message. |
| 266 | # [OpenID Connect |
| 267 | # token](https://developers.google.com/identity/protocols/OpenIDConnect). |
| 268 | "audience": "A String", # Audience to be used when generating OIDC token. The audience claim |
| 269 | # identifies the recipients that the JWT is intended for. The audience |
| 270 | # value is a single case-sensitive string. Having multiple values (array) |
| 271 | # for the audience field is not supported. More info about the OIDC JWT |
| 272 | # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 |
| 273 | # Note: if not specified, the Push endpoint URL will be used. |
| 274 | "serviceAccountEmail": "A String", # [Service account |
| 275 | # email](https://cloud.google.com/iam/docs/service-accounts) |
| 276 | # to be used for generating the OIDC token. The caller (for |
| 277 | # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must |
| 278 | # have the iam.serviceAccounts.actAs permission for the service account. |
| 279 | }, |
| 280 | "pushEndpoint": "A String", # A URL locating the endpoint to which messages should be pushed. |
| 281 | # For example, a Webhook endpoint might use `https://example.com/push`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 282 | "attributes": { # Endpoint configuration attributes that can be used to control different |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 283 | # aspects of the message delivery. |
| 284 | # |
| 285 | # The only currently supported attribute is `x-goog-version`, which you can |
| 286 | # use to change the format of the pushed message. This attribute |
| 287 | # indicates the version of the data expected by the endpoint. This |
| 288 | # controls the shape of the pushed message (i.e., its fields and metadata). |
| 289 | # |
| 290 | # If not present during the `CreateSubscription` call, it will default to |
| 291 | # the version of the Pub/Sub API used to make such call. If not present in a |
| 292 | # `ModifyPushConfig` call, its value will not be changed. `GetSubscription` |
| 293 | # calls will always return a valid version, even if the subscription was |
| 294 | # created without this attribute. |
| 295 | # |
| 296 | # The only supported values for the `x-goog-version` attribute are: |
| 297 | # |
| 298 | # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. |
| 299 | # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. |
| 300 | # |
| 301 | # For example: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 302 | # <pre><code>attributes { "x-goog-version": "v1" } </code></pre> |
| 303 | "a_key": "A String", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 304 | }, |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 305 | }, |
| 306 | "deadLetterPolicy": { # 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 |
| 307 | # this subscription. If dead_letter_policy is not set, dead lettering |
| 308 | # is disabled. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 309 | # |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 310 | # The Cloud Pub/Sub service account associated with this subscriptions's |
| 311 | # parent project (i.e., |
| 312 | # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have |
| 313 | # permission to Acknowledge() messages on this subscription. |
| 314 | # dead lettered multiple times. |
| 315 | # |
| 316 | # If validation on any of the fields fails at subscription creation/updation, |
| 317 | # the create/update subscription request will fail. |
| 318 | "deadLetterTopic": "A String", # The name of the topic to which dead letter messages should be published. |
| 319 | # Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service |
| 320 | # account associated with the enclosing subscription's parent project (i.e., |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 321 | # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 322 | # permission to Publish() to this topic. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 323 | # |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 324 | # The operation will fail if the topic does not exist. |
| 325 | # Users should ensure that there is a subscription attached to this topic |
| 326 | # since messages published to a topic with no subscriptions are lost. |
| 327 | "maxDeliveryAttempts": 42, # The maximum number of delivery attempts for any message. The value must be |
| 328 | # between 5 and 100. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 329 | # |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 330 | # The number of delivery attempts is defined as 1 + (the sum of number of |
| 331 | # NACKs and number of times the acknowledgement deadline has been exceeded |
| 332 | # for the message). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 333 | # |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 334 | # A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that |
| 335 | # client libraries may automatically extend ack_deadlines. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 336 | # |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 337 | # This field will be honored on a best effort basis. |
| 338 | # |
| 339 | # If this parameter is 0, a default value of 5 is used. |
| 340 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 341 | "filter": "A String", # An expression written in the Pub/Sub [filter |
| 342 | # language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, |
| 343 | # then only `PubsubMessage`s whose `attributes` field matches the filter are |
| 344 | # delivered on this subscription. If empty, then no messages are filtered |
| 345 | # out. |
| 346 | "retainAckedMessages": True or False, # Indicates whether to retain acknowledged messages. If true, then |
| 347 | # messages are not expunged from the subscription's backlog, even if they are |
| 348 | # acknowledged, until they fall out of the `message_retention_duration` |
| 349 | # window. This must be true if you would like to [Seek to a timestamp] |
| 350 | # (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time). |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 351 | "name": "A String", # Required. The name of the subscription. It must have the format |
| 352 | # `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must |
| 353 | # start with a letter, and contain only letters (`[A-Za-z]`), numbers |
| 354 | # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), |
| 355 | # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters |
| 356 | # in length, and it must not start with `"goog"`. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 357 | } |
| 358 | |
| 359 | x__xgafv: string, V1 error format. |
| 360 | Allowed values |
| 361 | 1 - v1 error format |
| 362 | 2 - v2 error format |
| 363 | |
| 364 | Returns: |
| 365 | An object of the form: |
| 366 | |
| 367 | { # A subscription resource. |
| 368 | "topic": "A String", # Required. The name of the topic from which this subscription is receiving messages. |
| 369 | # Format is `projects/{project}/topics/{topic}`. |
| 370 | # The value of this field will be `_deleted-topic_` if the topic has been |
| 371 | # deleted. |
| 372 | "ackDeadlineSeconds": 42, # The approximate amount of time (on a best-effort basis) Pub/Sub waits for |
| 373 | # the subscriber to acknowledge receipt before resending the message. In the |
| 374 | # interval after the message is delivered and before it is acknowledged, it |
| 375 | # is considered to be <i>outstanding</i>. During that time period, the |
| 376 | # message will not be redelivered (on a best-effort basis). |
| 377 | # |
| 378 | # For pull subscriptions, this value is used as the initial value for the ack |
| 379 | # deadline. To override this value for a given message, call |
| 380 | # `ModifyAckDeadline` with the corresponding `ack_id` if using |
| 381 | # non-streaming pull or send the `ack_id` in a |
| 382 | # `StreamingModifyAckDeadlineRequest` if using streaming pull. |
| 383 | # The minimum custom deadline you can specify is 10 seconds. |
| 384 | # The maximum custom deadline you can specify is 600 seconds (10 minutes). |
| 385 | # If this parameter is 0, a default value of 10 seconds is used. |
| 386 | # |
| 387 | # For push delivery, this value is also used to set the request timeout for |
| 388 | # the call to the push endpoint. |
| 389 | # |
| 390 | # If the subscriber never acknowledges the message, the Pub/Sub |
| 391 | # system will eventually redeliver the message. |
| 392 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
| 393 | # managing labels</a>. |
| 394 | "a_key": "A String", |
| 395 | }, |
| 396 | "expirationPolicy": { # A policy that specifies the conditions for resource expiration (i.e., # A policy that specifies the conditions for this subscription's expiration. |
| 397 | # A subscription is considered active as long as any connected subscriber is |
| 398 | # successfully consuming messages from the subscription or is issuing |
| 399 | # operations on the subscription. If `expiration_policy` is not set, a |
| 400 | # *default policy* with `ttl` of 31 days will be used. The minimum allowed |
| 401 | # value for `expiration_policy.ttl` is 1 day. |
| 402 | # automatic resource deletion). |
| 403 | "ttl": "A String", # Specifies the "time-to-live" duration for an associated resource. The |
| 404 | # resource expires if it is not active for a period of `ttl`. The definition |
| 405 | # of "activity" depends on the type of the associated resource. The minimum |
| 406 | # and maximum allowed values for `ttl` depend on the type of the associated |
| 407 | # resource, as well. If `ttl` is not set, the associated resource never |
| 408 | # expires. |
| 409 | }, |
| 410 | "retryPolicy": { # A policy that specifies how Cloud Pub/Sub retries message delivery. # A policy that specifies how Pub/Sub retries message delivery for this |
| 411 | # subscription. |
| 412 | # |
| 413 | # If not set, the default retry policy is applied. This generally implies |
| 414 | # that messages will be retried as soon as possible for healthy subscribers. |
| 415 | # RetryPolicy will be triggered on NACKs or acknowledgement deadline |
| 416 | # exceeded events for a given message. |
| 417 | # |
| 418 | # Retry delay will be exponential based on provided minimum and maximum |
| 419 | # backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. |
| 420 | # |
| 421 | # RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded |
| 422 | # events for a given message. |
| 423 | # |
| 424 | # Retry Policy is implemented on a best effort basis. At times, the delay |
| 425 | # between consecutive deliveries may not match the configuration. That is, |
| 426 | # delay can be more or less than configured backoff. |
| 427 | "minimumBackoff": "A String", # The minimum delay between consecutive deliveries of a given message. |
| 428 | # Value should be between 0 and 600 seconds. Defaults to 10 seconds. |
| 429 | "maximumBackoff": "A String", # The maximum delay between consecutive deliveries of a given message. |
| 430 | # Value should be between 0 and 600 seconds. Defaults to 600 seconds. |
| 431 | }, |
| 432 | "messageRetentionDuration": "A String", # How long to retain unacknowledged messages in the subscription's backlog, |
| 433 | # from the moment a message is published. |
| 434 | # If `retain_acked_messages` is true, then this also configures the retention |
| 435 | # of acknowledged messages, and thus configures how far back in time a `Seek` |
| 436 | # can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10 |
| 437 | # minutes. |
| 438 | "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is |
| 439 | # used to configure it. An empty `pushConfig` signifies that the subscriber |
| 440 | # will pull and ack messages using API methods. |
| 441 | "oidcToken": { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an |
| 442 | # `Authorization` header in the HTTP request for every pushed message. |
| 443 | # [OpenID Connect |
| 444 | # token](https://developers.google.com/identity/protocols/OpenIDConnect). |
| 445 | "audience": "A String", # Audience to be used when generating OIDC token. The audience claim |
| 446 | # identifies the recipients that the JWT is intended for. The audience |
| 447 | # value is a single case-sensitive string. Having multiple values (array) |
| 448 | # for the audience field is not supported. More info about the OIDC JWT |
| 449 | # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 |
| 450 | # Note: if not specified, the Push endpoint URL will be used. |
| 451 | "serviceAccountEmail": "A String", # [Service account |
| 452 | # email](https://cloud.google.com/iam/docs/service-accounts) |
| 453 | # to be used for generating the OIDC token. The caller (for |
| 454 | # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must |
| 455 | # have the iam.serviceAccounts.actAs permission for the service account. |
| 456 | }, |
| 457 | "pushEndpoint": "A String", # A URL locating the endpoint to which messages should be pushed. |
| 458 | # For example, a Webhook endpoint might use `https://example.com/push`. |
| 459 | "attributes": { # Endpoint configuration attributes that can be used to control different |
| 460 | # aspects of the message delivery. |
| 461 | # |
| 462 | # The only currently supported attribute is `x-goog-version`, which you can |
| 463 | # use to change the format of the pushed message. This attribute |
| 464 | # indicates the version of the data expected by the endpoint. This |
| 465 | # controls the shape of the pushed message (i.e., its fields and metadata). |
| 466 | # |
| 467 | # If not present during the `CreateSubscription` call, it will default to |
| 468 | # the version of the Pub/Sub API used to make such call. If not present in a |
| 469 | # `ModifyPushConfig` call, its value will not be changed. `GetSubscription` |
| 470 | # calls will always return a valid version, even if the subscription was |
| 471 | # created without this attribute. |
| 472 | # |
| 473 | # The only supported values for the `x-goog-version` attribute are: |
| 474 | # |
| 475 | # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. |
| 476 | # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. |
| 477 | # |
| 478 | # For example: |
| 479 | # <pre><code>attributes { "x-goog-version": "v1" } </code></pre> |
| 480 | "a_key": "A String", |
| 481 | }, |
| 482 | }, |
| 483 | "deadLetterPolicy": { # 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 |
| 484 | # this subscription. If dead_letter_policy is not set, dead lettering |
| 485 | # is disabled. |
| 486 | # |
| 487 | # The Cloud Pub/Sub service account associated with this subscriptions's |
| 488 | # parent project (i.e., |
| 489 | # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have |
| 490 | # permission to Acknowledge() messages on this subscription. |
| 491 | # dead lettered multiple times. |
| 492 | # |
| 493 | # If validation on any of the fields fails at subscription creation/updation, |
| 494 | # the create/update subscription request will fail. |
| 495 | "deadLetterTopic": "A String", # The name of the topic to which dead letter messages should be published. |
| 496 | # Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service |
| 497 | # account associated with the enclosing subscription's parent project (i.e., |
| 498 | # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have |
| 499 | # permission to Publish() to this topic. |
| 500 | # |
| 501 | # The operation will fail if the topic does not exist. |
| 502 | # Users should ensure that there is a subscription attached to this topic |
| 503 | # since messages published to a topic with no subscriptions are lost. |
| 504 | "maxDeliveryAttempts": 42, # The maximum number of delivery attempts for any message. The value must be |
| 505 | # between 5 and 100. |
| 506 | # |
| 507 | # The number of delivery attempts is defined as 1 + (the sum of number of |
| 508 | # NACKs and number of times the acknowledgement deadline has been exceeded |
| 509 | # for the message). |
| 510 | # |
| 511 | # A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that |
| 512 | # client libraries may automatically extend ack_deadlines. |
| 513 | # |
| 514 | # This field will be honored on a best effort basis. |
| 515 | # |
| 516 | # If this parameter is 0, a default value of 5 is used. |
| 517 | }, |
| 518 | "filter": "A String", # An expression written in the Pub/Sub [filter |
| 519 | # language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, |
| 520 | # then only `PubsubMessage`s whose `attributes` field matches the filter are |
| 521 | # delivered on this subscription. If empty, then no messages are filtered |
| 522 | # out. |
| 523 | "retainAckedMessages": True or False, # Indicates whether to retain acknowledged messages. If true, then |
| 524 | # messages are not expunged from the subscription's backlog, even if they are |
| 525 | # acknowledged, until they fall out of the `message_retention_duration` |
| 526 | # window. This must be true if you would like to [Seek to a timestamp] |
| 527 | # (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time). |
| 528 | "name": "A String", # Required. The name of the subscription. It must have the format |
| 529 | # `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must |
| 530 | # start with a letter, and contain only letters (`[A-Za-z]`), numbers |
| 531 | # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), |
| 532 | # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters |
| 533 | # in length, and it must not start with `"goog"`. |
| 534 | }</pre> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 535 | </div> |
| 536 | |
| 537 | <div class="method"> |
Thomas Coffee | 2f24537 | 2017-03-27 10:39:26 -0700 | [diff] [blame] | 538 | <code class="details" id="delete">delete(subscription, x__xgafv=None)</code> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 539 | <pre>Deletes an existing subscription. All messages retained in the subscription |
| 540 | are immediately dropped. Calls to `Pull` after deletion will return |
| 541 | `NOT_FOUND`. After a subscription is deleted, a new one may be created with |
| 542 | the same name, but the new one has no association with the old |
| 543 | subscription or its topic unless the same topic is specified. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 544 | |
| 545 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 546 | subscription: string, Required. The subscription to delete. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 547 | Format is `projects/{project}/subscriptions/{sub}`. (required) |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 548 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 549 | Allowed values |
| 550 | 1 - v1 error format |
| 551 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 552 | |
| 553 | Returns: |
| 554 | An object of the form: |
| 555 | |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 556 | { # A generic empty message that you can re-use to avoid defining duplicated |
| 557 | # empty messages in your APIs. A typical example is to use it as the request |
| 558 | # or the response type of an API method. For instance: |
| 559 | # |
| 560 | # service Foo { |
| 561 | # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 562 | # } |
| 563 | # |
| 564 | # The JSON representation for `Empty` is empty JSON object `{}`. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 565 | }</pre> |
| 566 | </div> |
| 567 | |
| 568 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 569 | <code class="details" id="detach">detach(subscription, x__xgafv=None)</code> |
| 570 | <pre>Detaches a subscription from this topic. All messages retained in the |
| 571 | subscription are dropped. Subsequent `Pull` and `StreamingPull` requests |
| 572 | will return FAILED_PRECONDITION. If the subscription is a push |
| 573 | subscription, pushes to the endpoint will stop. |
| 574 | |
| 575 | Args: |
| 576 | subscription: string, Required. The subscription to detach. |
| 577 | Format is `projects/{project}/subscriptions/{subscription}`. (required) |
| 578 | x__xgafv: string, V1 error format. |
| 579 | Allowed values |
| 580 | 1 - v1 error format |
| 581 | 2 - v2 error format |
| 582 | |
| 583 | Returns: |
| 584 | An object of the form: |
| 585 | |
| 586 | { # Response for the DetachSubscription method. |
| 587 | # Reserved for future use. |
| 588 | }</pre> |
| 589 | </div> |
| 590 | |
| 591 | <div class="method"> |
Thomas Coffee | 2f24537 | 2017-03-27 10:39:26 -0700 | [diff] [blame] | 592 | <code class="details" id="get">get(subscription, x__xgafv=None)</code> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 593 | <pre>Gets the configuration details of a subscription. |
| 594 | |
| 595 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 596 | subscription: string, Required. The name of the subscription to get. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 597 | Format is `projects/{project}/subscriptions/{sub}`. (required) |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 598 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 599 | Allowed values |
| 600 | 1 - v1 error format |
| 601 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 602 | |
| 603 | Returns: |
| 604 | An object of the form: |
| 605 | |
| 606 | { # A subscription resource. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 607 | "topic": "A String", # Required. The name of the topic from which this subscription is receiving messages. |
| 608 | # Format is `projects/{project}/topics/{topic}`. |
| 609 | # The value of this field will be `_deleted-topic_` if the topic has been |
| 610 | # deleted. |
| 611 | "ackDeadlineSeconds": 42, # The approximate amount of time (on a best-effort basis) Pub/Sub waits for |
| 612 | # the subscriber to acknowledge receipt before resending the message. In the |
| 613 | # interval after the message is delivered and before it is acknowledged, it |
| 614 | # is considered to be <i>outstanding</i>. During that time period, the |
| 615 | # message will not be redelivered (on a best-effort basis). |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 616 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 617 | # For pull subscriptions, this value is used as the initial value for the ack |
| 618 | # deadline. To override this value for a given message, call |
| 619 | # `ModifyAckDeadline` with the corresponding `ack_id` if using |
| 620 | # non-streaming pull or send the `ack_id` in a |
| 621 | # `StreamingModifyAckDeadlineRequest` if using streaming pull. |
| 622 | # The minimum custom deadline you can specify is 10 seconds. |
| 623 | # The maximum custom deadline you can specify is 600 seconds (10 minutes). |
| 624 | # If this parameter is 0, a default value of 10 seconds is used. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 625 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 626 | # For push delivery, this value is also used to set the request timeout for |
| 627 | # the call to the push endpoint. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 628 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 629 | # If the subscriber never acknowledges the message, the Pub/Sub |
| 630 | # system will eventually redeliver the message. |
| 631 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
| 632 | # managing labels</a>. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 633 | "a_key": "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 634 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 635 | "expirationPolicy": { # A policy that specifies the conditions for resource expiration (i.e., # A policy that specifies the conditions for this subscription's expiration. |
| 636 | # A subscription is considered active as long as any connected subscriber is |
| 637 | # successfully consuming messages from the subscription or is issuing |
| 638 | # operations on the subscription. If `expiration_policy` is not set, a |
| 639 | # *default policy* with `ttl` of 31 days will be used. The minimum allowed |
| 640 | # value for `expiration_policy.ttl` is 1 day. |
| 641 | # automatic resource deletion). |
| 642 | "ttl": "A String", # Specifies the "time-to-live" duration for an associated resource. The |
| 643 | # resource expires if it is not active for a period of `ttl`. The definition |
| 644 | # of "activity" depends on the type of the associated resource. The minimum |
| 645 | # and maximum allowed values for `ttl` depend on the type of the associated |
| 646 | # resource, as well. If `ttl` is not set, the associated resource never |
| 647 | # expires. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 648 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 649 | "retryPolicy": { # A policy that specifies how Cloud Pub/Sub retries message delivery. # A policy that specifies how Pub/Sub retries message delivery for this |
| 650 | # subscription. |
| 651 | # |
| 652 | # If not set, the default retry policy is applied. This generally implies |
| 653 | # that messages will be retried as soon as possible for healthy subscribers. |
| 654 | # RetryPolicy will be triggered on NACKs or acknowledgement deadline |
| 655 | # exceeded events for a given message. |
| 656 | # |
| 657 | # Retry delay will be exponential based on provided minimum and maximum |
| 658 | # backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. |
| 659 | # |
| 660 | # RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded |
| 661 | # events for a given message. |
| 662 | # |
| 663 | # Retry Policy is implemented on a best effort basis. At times, the delay |
| 664 | # between consecutive deliveries may not match the configuration. That is, |
| 665 | # delay can be more or less than configured backoff. |
| 666 | "minimumBackoff": "A String", # The minimum delay between consecutive deliveries of a given message. |
| 667 | # Value should be between 0 and 600 seconds. Defaults to 10 seconds. |
| 668 | "maximumBackoff": "A String", # The maximum delay between consecutive deliveries of a given message. |
| 669 | # Value should be between 0 and 600 seconds. Defaults to 600 seconds. |
| 670 | }, |
| 671 | "messageRetentionDuration": "A String", # How long to retain unacknowledged messages in the subscription's backlog, |
| 672 | # from the moment a message is published. |
| 673 | # If `retain_acked_messages` is true, then this also configures the retention |
| 674 | # of acknowledged messages, and thus configures how far back in time a `Seek` |
| 675 | # can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10 |
| 676 | # minutes. |
| 677 | "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is |
| 678 | # used to configure it. An empty `pushConfig` signifies that the subscriber |
| 679 | # will pull and ack messages using API methods. |
| 680 | "oidcToken": { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an |
| 681 | # `Authorization` header in the HTTP request for every pushed message. |
| 682 | # [OpenID Connect |
| 683 | # token](https://developers.google.com/identity/protocols/OpenIDConnect). |
| 684 | "audience": "A String", # Audience to be used when generating OIDC token. The audience claim |
| 685 | # identifies the recipients that the JWT is intended for. The audience |
| 686 | # value is a single case-sensitive string. Having multiple values (array) |
| 687 | # for the audience field is not supported. More info about the OIDC JWT |
| 688 | # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 |
| 689 | # Note: if not specified, the Push endpoint URL will be used. |
| 690 | "serviceAccountEmail": "A String", # [Service account |
| 691 | # email](https://cloud.google.com/iam/docs/service-accounts) |
| 692 | # to be used for generating the OIDC token. The caller (for |
| 693 | # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must |
| 694 | # have the iam.serviceAccounts.actAs permission for the service account. |
| 695 | }, |
| 696 | "pushEndpoint": "A String", # A URL locating the endpoint to which messages should be pushed. |
| 697 | # For example, a Webhook endpoint might use `https://example.com/push`. |
| 698 | "attributes": { # Endpoint configuration attributes that can be used to control different |
| 699 | # aspects of the message delivery. |
| 700 | # |
| 701 | # The only currently supported attribute is `x-goog-version`, which you can |
| 702 | # use to change the format of the pushed message. This attribute |
| 703 | # indicates the version of the data expected by the endpoint. This |
| 704 | # controls the shape of the pushed message (i.e., its fields and metadata). |
| 705 | # |
| 706 | # If not present during the `CreateSubscription` call, it will default to |
| 707 | # the version of the Pub/Sub API used to make such call. If not present in a |
| 708 | # `ModifyPushConfig` call, its value will not be changed. `GetSubscription` |
| 709 | # calls will always return a valid version, even if the subscription was |
| 710 | # created without this attribute. |
| 711 | # |
| 712 | # The only supported values for the `x-goog-version` attribute are: |
| 713 | # |
| 714 | # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. |
| 715 | # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. |
| 716 | # |
| 717 | # For example: |
| 718 | # <pre><code>attributes { "x-goog-version": "v1" } </code></pre> |
| 719 | "a_key": "A String", |
| 720 | }, |
| 721 | }, |
| 722 | "deadLetterPolicy": { # 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 |
| 723 | # this subscription. If dead_letter_policy is not set, dead lettering |
| 724 | # is disabled. |
| 725 | # |
| 726 | # The Cloud Pub/Sub service account associated with this subscriptions's |
| 727 | # parent project (i.e., |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 728 | # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 729 | # permission to Acknowledge() messages on this subscription. |
| 730 | # dead lettered multiple times. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 731 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 732 | # If validation on any of the fields fails at subscription creation/updation, |
| 733 | # the create/update subscription request will fail. |
| 734 | "deadLetterTopic": "A String", # The name of the topic to which dead letter messages should be published. |
| 735 | # Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service |
| 736 | # account associated with the enclosing subscription's parent project (i.e., |
| 737 | # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have |
| 738 | # permission to Publish() to this topic. |
| 739 | # |
| 740 | # The operation will fail if the topic does not exist. |
| 741 | # Users should ensure that there is a subscription attached to this topic |
| 742 | # since messages published to a topic with no subscriptions are lost. |
| 743 | "maxDeliveryAttempts": 42, # The maximum number of delivery attempts for any message. The value must be |
| 744 | # between 5 and 100. |
| 745 | # |
| 746 | # The number of delivery attempts is defined as 1 + (the sum of number of |
| 747 | # NACKs and number of times the acknowledgement deadline has been exceeded |
| 748 | # for the message). |
| 749 | # |
| 750 | # A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that |
| 751 | # client libraries may automatically extend ack_deadlines. |
| 752 | # |
| 753 | # This field will be honored on a best effort basis. |
| 754 | # |
| 755 | # If this parameter is 0, a default value of 5 is used. |
| 756 | }, |
| 757 | "filter": "A String", # An expression written in the Pub/Sub [filter |
| 758 | # language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, |
| 759 | # then only `PubsubMessage`s whose `attributes` field matches the filter are |
| 760 | # delivered on this subscription. If empty, then no messages are filtered |
| 761 | # out. |
| 762 | "retainAckedMessages": True or False, # Indicates whether to retain acknowledged messages. If true, then |
| 763 | # messages are not expunged from the subscription's backlog, even if they are |
| 764 | # acknowledged, until they fall out of the `message_retention_duration` |
| 765 | # window. This must be true if you would like to [Seek to a timestamp] |
| 766 | # (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time). |
| 767 | "name": "A String", # Required. The name of the subscription. It must have the format |
| 768 | # `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must |
| 769 | # start with a letter, and contain only letters (`[A-Za-z]`), numbers |
| 770 | # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), |
| 771 | # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters |
| 772 | # in length, and it must not start with `"goog"`. |
| 773 | }</pre> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 774 | </div> |
| 775 | |
| 776 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 777 | <code class="details" id="getIamPolicy">getIamPolicy(resource, options_requestedPolicyVersion=None, x__xgafv=None)</code> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 778 | <pre>Gets the access control policy for a resource. |
| 779 | Returns an empty policy if the resource exists and does not have a policy |
| 780 | set. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 781 | |
| 782 | Args: |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 783 | resource: string, REQUIRED: The resource for which the policy is being requested. |
Sai Cheemalapati | e833b79 | 2017-03-24 15:06:46 -0700 | [diff] [blame] | 784 | See the operation documentation for the appropriate value for this field. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 785 | options_requestedPolicyVersion: integer, Optional. The policy format version to be returned. |
| 786 | |
| 787 | Valid values are 0, 1, and 3. Requests specifying an invalid value will be |
| 788 | rejected. |
| 789 | |
| 790 | Requests for policies with any conditional bindings must specify version 3. |
| 791 | Policies without any conditional bindings may specify any valid value or |
| 792 | leave the field unset. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 793 | |
| 794 | To learn which resources support conditions in their IAM policies, see the |
| 795 | [IAM |
| 796 | documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 797 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 798 | Allowed values |
| 799 | 1 - v1 error format |
| 800 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 801 | |
| 802 | Returns: |
| 803 | An object of the form: |
| 804 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 805 | { # An Identity and Access Management (IAM) policy, which specifies access |
| 806 | # controls for Google Cloud resources. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 807 | # |
| 808 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 809 | # A `Policy` is a collection of `bindings`. A `binding` binds one or more |
| 810 | # `members` to a single `role`. Members can be user accounts, service accounts, |
| 811 | # Google groups, and domains (such as G Suite). A `role` is a named list of |
| 812 | # permissions; each `role` can be an IAM predefined role or a user-created |
| 813 | # custom role. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 814 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 815 | # For some types of Google Cloud resources, a `binding` can also specify a |
| 816 | # `condition`, which is a logical expression that allows access to a resource |
| 817 | # only if the expression evaluates to `true`. A condition can add constraints |
| 818 | # based on attributes of the request, the resource, or both. To learn which |
| 819 | # resources support conditions in their IAM policies, see the |
| 820 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 821 | # |
| 822 | # **JSON example:** |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 823 | # |
| 824 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 825 | # "bindings": [ |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 826 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 827 | # "role": "roles/resourcemanager.organizationAdmin", |
| 828 | # "members": [ |
| 829 | # "user:mike@example.com", |
| 830 | # "group:admins@example.com", |
| 831 | # "domain:google.com", |
| 832 | # "serviceAccount:my-project-id@appspot.gserviceaccount.com" |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 833 | # ] |
| 834 | # }, |
| 835 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 836 | # "role": "roles/resourcemanager.organizationViewer", |
| 837 | # "members": [ |
| 838 | # "user:eve@example.com" |
| 839 | # ], |
| 840 | # "condition": { |
| 841 | # "title": "expirable access", |
| 842 | # "description": "Does not grant access after Sep 2020", |
| 843 | # "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 844 | # } |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 845 | # } |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 846 | # ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 847 | # "etag": "BwWWja0YfJA=", |
| 848 | # "version": 3 |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 849 | # } |
| 850 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 851 | # **YAML example:** |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 852 | # |
| 853 | # bindings: |
| 854 | # - members: |
| 855 | # - user:mike@example.com |
| 856 | # - group:admins@example.com |
| 857 | # - domain:google.com |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 858 | # - serviceAccount:my-project-id@appspot.gserviceaccount.com |
| 859 | # role: roles/resourcemanager.organizationAdmin |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 860 | # - members: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 861 | # - user:eve@example.com |
| 862 | # role: roles/resourcemanager.organizationViewer |
| 863 | # condition: |
| 864 | # title: expirable access |
| 865 | # description: Does not grant access after Sep 2020 |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 866 | # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 867 | # - etag: BwWWja0YfJA= |
| 868 | # - version: 3 |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 869 | # |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 870 | # For a description of IAM and its features, see the |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 871 | # [IAM documentation](https://cloud.google.com/iam/docs/). |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 872 | "version": 42, # Specifies the format of the policy. |
| 873 | # |
| 874 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 875 | # are rejected. |
| 876 | # |
| 877 | # Any operation that affects conditional role bindings must specify version |
| 878 | # `3`. This requirement applies to the following operations: |
| 879 | # |
| 880 | # * Getting a policy that includes a conditional role binding |
| 881 | # * Adding a conditional role binding to a policy |
| 882 | # * Changing a conditional role binding in a policy |
| 883 | # * Removing any role binding, with or without a condition, from a policy |
| 884 | # that includes conditions |
| 885 | # |
| 886 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 887 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 888 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 889 | # the conditions in the version `3` policy are lost. |
| 890 | # |
| 891 | # If a policy does not include any conditions, operations on that policy may |
| 892 | # specify any valid version or leave the field unset. |
| 893 | # |
| 894 | # To learn which resources support conditions in their IAM policies, see the |
| 895 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
| 896 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 897 | # prevent simultaneous updates of a policy from overwriting each other. |
| 898 | # It is strongly suggested that systems make use of the `etag` in the |
| 899 | # read-modify-write cycle to perform policy updates in order to avoid race |
| 900 | # conditions: An `etag` is returned in the response to `getIamPolicy`, and |
| 901 | # systems are expected to put that etag in the request to `setIamPolicy` to |
| 902 | # ensure that their change will be applied to the same version of the policy. |
| 903 | # |
| 904 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 905 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 906 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 907 | # the conditions in the version `3` policy are lost. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 908 | "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 909 | # `condition` that determines how and when the `bindings` are applied. Each |
| 910 | # of the `bindings` must contain at least one member. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 911 | { # Associates `members` with a `role`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 912 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
| 913 | # |
| 914 | # If the condition evaluates to `true`, then this binding applies to the |
| 915 | # current request. |
| 916 | # |
| 917 | # If the condition evaluates to `false`, then this binding does not apply to |
| 918 | # the current request. However, a different role binding might grant the same |
| 919 | # role to one or more of the members in this binding. |
| 920 | # |
| 921 | # To learn which resources support conditions in their IAM policies, see the |
| 922 | # [IAM |
| 923 | # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
| 924 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 925 | # are documented at https://github.com/google/cel-spec. |
| 926 | # |
| 927 | # Example (Comparison): |
| 928 | # |
| 929 | # title: "Summary size limit" |
| 930 | # description: "Determines if a summary is less than 100 chars" |
| 931 | # expression: "document.summary.size() < 100" |
| 932 | # |
| 933 | # Example (Equality): |
| 934 | # |
| 935 | # title: "Requestor is owner" |
| 936 | # description: "Determines if requestor is the document owner" |
| 937 | # expression: "document.owner == request.auth.claims.email" |
| 938 | # |
| 939 | # Example (Logic): |
| 940 | # |
| 941 | # title: "Public documents" |
| 942 | # description: "Determine whether the document should be publicly visible" |
| 943 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 944 | # |
| 945 | # Example (Data Manipulation): |
| 946 | # |
| 947 | # title: "Notification string" |
| 948 | # description: "Create a notification string with a timestamp." |
| 949 | # expression: "'New message received at ' + string(document.create_time)" |
| 950 | # |
| 951 | # The exact variables and functions that may be referenced within an expression |
| 952 | # are determined by the service that evaluates it. See the service |
| 953 | # documentation for additional information. |
| 954 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 955 | # reporting, e.g. a file name and a position in the file. |
| 956 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
| 957 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 958 | # expression. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 959 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 960 | # syntax. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 961 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
| 962 | # describes the expression, e.g. when hovered over it in a UI. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 963 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 964 | "role": "A String", # Role that is assigned to `members`. |
| 965 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 966 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 967 | # `members` can have the following values: |
| 968 | # |
| 969 | # * `allUsers`: A special identifier that represents anyone who is |
| 970 | # on the internet; with or without a Google account. |
| 971 | # |
| 972 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 973 | # who is authenticated with a Google account or a service account. |
| 974 | # |
| 975 | # * `user:{emailid}`: An email address that represents a specific Google |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 976 | # account. For example, `alice@example.com` . |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 977 | # |
| 978 | # |
| 979 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 980 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 981 | # |
| 982 | # * `group:{emailid}`: An email address that represents a Google group. |
| 983 | # For example, `admins@example.com`. |
| 984 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 985 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 986 | # identifier) representing a user that has been recently deleted. For |
| 987 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 988 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 989 | # retains the role in the binding. |
| 990 | # |
| 991 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 992 | # unique identifier) representing a service account that has been recently |
| 993 | # deleted. For example, |
| 994 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 995 | # If the service account is undeleted, this value reverts to |
| 996 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 997 | # role in the binding. |
| 998 | # |
| 999 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 1000 | # identifier) representing a Google group that has been recently |
| 1001 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 1002 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 1003 | # recovered group retains the role in the binding. |
| 1004 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1005 | # |
| 1006 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1007 | # users of that domain. For example, `google.com` or `example.com`. |
| 1008 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1009 | "A String", |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1010 | ], |
| 1011 | }, |
| 1012 | ], |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1013 | }</pre> |
| 1014 | </div> |
| 1015 | |
| 1016 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1017 | <code class="details" id="list">list(project, pageSize=None, pageToken=None, x__xgafv=None)</code> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1018 | <pre>Lists matching subscriptions. |
| 1019 | |
| 1020 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1021 | project: string, Required. The name of the project in which to list subscriptions. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1022 | Format is `projects/{project-id}`. (required) |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1023 | pageSize: integer, Maximum number of subscriptions to return. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1024 | pageToken: string, The value returned by the last `ListSubscriptionsResponse`; indicates that |
| 1025 | this is a continuation of a prior `ListSubscriptions` call, and that the |
| 1026 | system should return the next page of data. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1027 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1028 | Allowed values |
| 1029 | 1 - v1 error format |
| 1030 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1031 | |
| 1032 | Returns: |
| 1033 | An object of the form: |
| 1034 | |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 1035 | { # Response for the `ListSubscriptions` method. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1036 | "subscriptions": [ # The subscriptions that match the request. |
| 1037 | { # A subscription resource. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1038 | "topic": "A String", # Required. The name of the topic from which this subscription is receiving messages. |
| 1039 | # Format is `projects/{project}/topics/{topic}`. |
| 1040 | # The value of this field will be `_deleted-topic_` if the topic has been |
| 1041 | # deleted. |
| 1042 | "ackDeadlineSeconds": 42, # The approximate amount of time (on a best-effort basis) Pub/Sub waits for |
| 1043 | # the subscriber to acknowledge receipt before resending the message. In the |
| 1044 | # interval after the message is delivered and before it is acknowledged, it |
| 1045 | # is considered to be <i>outstanding</i>. During that time period, the |
| 1046 | # message will not be redelivered (on a best-effort basis). |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1047 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1048 | # For pull subscriptions, this value is used as the initial value for the ack |
| 1049 | # deadline. To override this value for a given message, call |
| 1050 | # `ModifyAckDeadline` with the corresponding `ack_id` if using |
| 1051 | # non-streaming pull or send the `ack_id` in a |
| 1052 | # `StreamingModifyAckDeadlineRequest` if using streaming pull. |
| 1053 | # The minimum custom deadline you can specify is 10 seconds. |
| 1054 | # The maximum custom deadline you can specify is 600 seconds (10 minutes). |
| 1055 | # If this parameter is 0, a default value of 10 seconds is used. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1056 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1057 | # For push delivery, this value is also used to set the request timeout for |
| 1058 | # the call to the push endpoint. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1059 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1060 | # If the subscriber never acknowledges the message, the Pub/Sub |
| 1061 | # system will eventually redeliver the message. |
| 1062 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
| 1063 | # managing labels</a>. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1064 | "a_key": "A String", |
| 1065 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1066 | "expirationPolicy": { # A policy that specifies the conditions for resource expiration (i.e., # A policy that specifies the conditions for this subscription's expiration. |
| 1067 | # A subscription is considered active as long as any connected subscriber is |
| 1068 | # successfully consuming messages from the subscription or is issuing |
| 1069 | # operations on the subscription. If `expiration_policy` is not set, a |
| 1070 | # *default policy* with `ttl` of 31 days will be used. The minimum allowed |
| 1071 | # value for `expiration_policy.ttl` is 1 day. |
| 1072 | # automatic resource deletion). |
| 1073 | "ttl": "A String", # Specifies the "time-to-live" duration for an associated resource. The |
| 1074 | # resource expires if it is not active for a period of `ttl`. The definition |
| 1075 | # of "activity" depends on the type of the associated resource. The minimum |
| 1076 | # and maximum allowed values for `ttl` depend on the type of the associated |
| 1077 | # resource, as well. If `ttl` is not set, the associated resource never |
| 1078 | # expires. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1079 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1080 | "retryPolicy": { # A policy that specifies how Cloud Pub/Sub retries message delivery. # A policy that specifies how Pub/Sub retries message delivery for this |
| 1081 | # subscription. |
| 1082 | # |
| 1083 | # If not set, the default retry policy is applied. This generally implies |
| 1084 | # that messages will be retried as soon as possible for healthy subscribers. |
| 1085 | # RetryPolicy will be triggered on NACKs or acknowledgement deadline |
| 1086 | # exceeded events for a given message. |
| 1087 | # |
| 1088 | # Retry delay will be exponential based on provided minimum and maximum |
| 1089 | # backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. |
| 1090 | # |
| 1091 | # RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded |
| 1092 | # events for a given message. |
| 1093 | # |
| 1094 | # Retry Policy is implemented on a best effort basis. At times, the delay |
| 1095 | # between consecutive deliveries may not match the configuration. That is, |
| 1096 | # delay can be more or less than configured backoff. |
| 1097 | "minimumBackoff": "A String", # The minimum delay between consecutive deliveries of a given message. |
| 1098 | # Value should be between 0 and 600 seconds. Defaults to 10 seconds. |
| 1099 | "maximumBackoff": "A String", # The maximum delay between consecutive deliveries of a given message. |
| 1100 | # Value should be between 0 and 600 seconds. Defaults to 600 seconds. |
| 1101 | }, |
| 1102 | "messageRetentionDuration": "A String", # How long to retain unacknowledged messages in the subscription's backlog, |
| 1103 | # from the moment a message is published. |
| 1104 | # If `retain_acked_messages` is true, then this also configures the retention |
| 1105 | # of acknowledged messages, and thus configures how far back in time a `Seek` |
| 1106 | # can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10 |
| 1107 | # minutes. |
| 1108 | "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is |
| 1109 | # used to configure it. An empty `pushConfig` signifies that the subscriber |
| 1110 | # will pull and ack messages using API methods. |
| 1111 | "oidcToken": { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an |
| 1112 | # `Authorization` header in the HTTP request for every pushed message. |
| 1113 | # [OpenID Connect |
| 1114 | # token](https://developers.google.com/identity/protocols/OpenIDConnect). |
| 1115 | "audience": "A String", # Audience to be used when generating OIDC token. The audience claim |
| 1116 | # identifies the recipients that the JWT is intended for. The audience |
| 1117 | # value is a single case-sensitive string. Having multiple values (array) |
| 1118 | # for the audience field is not supported. More info about the OIDC JWT |
| 1119 | # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 |
| 1120 | # Note: if not specified, the Push endpoint URL will be used. |
| 1121 | "serviceAccountEmail": "A String", # [Service account |
| 1122 | # email](https://cloud.google.com/iam/docs/service-accounts) |
| 1123 | # to be used for generating the OIDC token. The caller (for |
| 1124 | # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must |
| 1125 | # have the iam.serviceAccounts.actAs permission for the service account. |
| 1126 | }, |
| 1127 | "pushEndpoint": "A String", # A URL locating the endpoint to which messages should be pushed. |
| 1128 | # For example, a Webhook endpoint might use `https://example.com/push`. |
| 1129 | "attributes": { # Endpoint configuration attributes that can be used to control different |
| 1130 | # aspects of the message delivery. |
| 1131 | # |
| 1132 | # The only currently supported attribute is `x-goog-version`, which you can |
| 1133 | # use to change the format of the pushed message. This attribute |
| 1134 | # indicates the version of the data expected by the endpoint. This |
| 1135 | # controls the shape of the pushed message (i.e., its fields and metadata). |
| 1136 | # |
| 1137 | # If not present during the `CreateSubscription` call, it will default to |
| 1138 | # the version of the Pub/Sub API used to make such call. If not present in a |
| 1139 | # `ModifyPushConfig` call, its value will not be changed. `GetSubscription` |
| 1140 | # calls will always return a valid version, even if the subscription was |
| 1141 | # created without this attribute. |
| 1142 | # |
| 1143 | # The only supported values for the `x-goog-version` attribute are: |
| 1144 | # |
| 1145 | # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. |
| 1146 | # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. |
| 1147 | # |
| 1148 | # For example: |
| 1149 | # <pre><code>attributes { "x-goog-version": "v1" } </code></pre> |
| 1150 | "a_key": "A String", |
| 1151 | }, |
| 1152 | }, |
| 1153 | "deadLetterPolicy": { # 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 |
| 1154 | # this subscription. If dead_letter_policy is not set, dead lettering |
| 1155 | # is disabled. |
| 1156 | # |
| 1157 | # The Cloud Pub/Sub service account associated with this subscriptions's |
| 1158 | # parent project (i.e., |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1159 | # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1160 | # permission to Acknowledge() messages on this subscription. |
| 1161 | # dead lettered multiple times. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1162 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1163 | # If validation on any of the fields fails at subscription creation/updation, |
| 1164 | # the create/update subscription request will fail. |
| 1165 | "deadLetterTopic": "A String", # The name of the topic to which dead letter messages should be published. |
| 1166 | # Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service |
| 1167 | # account associated with the enclosing subscription's parent project (i.e., |
| 1168 | # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have |
| 1169 | # permission to Publish() to this topic. |
| 1170 | # |
| 1171 | # The operation will fail if the topic does not exist. |
| 1172 | # Users should ensure that there is a subscription attached to this topic |
| 1173 | # since messages published to a topic with no subscriptions are lost. |
| 1174 | "maxDeliveryAttempts": 42, # The maximum number of delivery attempts for any message. The value must be |
| 1175 | # between 5 and 100. |
| 1176 | # |
| 1177 | # The number of delivery attempts is defined as 1 + (the sum of number of |
| 1178 | # NACKs and number of times the acknowledgement deadline has been exceeded |
| 1179 | # for the message). |
| 1180 | # |
| 1181 | # A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that |
| 1182 | # client libraries may automatically extend ack_deadlines. |
| 1183 | # |
| 1184 | # This field will be honored on a best effort basis. |
| 1185 | # |
| 1186 | # If this parameter is 0, a default value of 5 is used. |
| 1187 | }, |
| 1188 | "filter": "A String", # An expression written in the Pub/Sub [filter |
| 1189 | # language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, |
| 1190 | # then only `PubsubMessage`s whose `attributes` field matches the filter are |
| 1191 | # delivered on this subscription. If empty, then no messages are filtered |
| 1192 | # out. |
| 1193 | "retainAckedMessages": True or False, # Indicates whether to retain acknowledged messages. If true, then |
| 1194 | # messages are not expunged from the subscription's backlog, even if they are |
| 1195 | # acknowledged, until they fall out of the `message_retention_duration` |
| 1196 | # window. This must be true if you would like to [Seek to a timestamp] |
| 1197 | # (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time). |
| 1198 | "name": "A String", # Required. The name of the subscription. It must have the format |
| 1199 | # `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must |
| 1200 | # start with a letter, and contain only letters (`[A-Za-z]`), numbers |
| 1201 | # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), |
| 1202 | # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters |
| 1203 | # in length, and it must not start with `"goog"`. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1204 | }, |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1205 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1206 | "nextPageToken": "A String", # If not empty, indicates that there may be more subscriptions that match |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1207 | # the request; this value should be passed in a new |
| 1208 | # `ListSubscriptionsRequest` to get more subscriptions. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1209 | }</pre> |
| 1210 | </div> |
| 1211 | |
| 1212 | <div class="method"> |
| 1213 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 1214 | <pre>Retrieves the next page of results. |
| 1215 | |
| 1216 | Args: |
| 1217 | previous_request: The request for the previous page. (required) |
| 1218 | previous_response: The response from the request for the previous page. (required) |
| 1219 | |
| 1220 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1221 | A request object that you can call 'execute()' on to request the next |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1222 | page. Returns None if there are no more items in the collection. |
| 1223 | </pre> |
| 1224 | </div> |
| 1225 | |
| 1226 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1227 | <code class="details" id="modifyAckDeadline">modifyAckDeadline(subscription, body=None, x__xgafv=None)</code> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1228 | <pre>Modifies the ack deadline for a specific message. This method is useful |
| 1229 | to indicate that more time is needed to process a message by the |
| 1230 | subscriber, or to make the message available for redelivery if the |
| 1231 | processing was interrupted. Note that this does not modify the |
| 1232 | subscription-level `ackDeadlineSeconds` used for subsequent messages. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1233 | |
| 1234 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1235 | subscription: string, Required. The name of the subscription. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1236 | Format is `projects/{project}/subscriptions/{sub}`. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1237 | body: object, The request body. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1238 | The object takes the form of: |
| 1239 | |
| 1240 | { # Request for the ModifyAckDeadline method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1241 | "ackDeadlineSeconds": 42, # Required. The new ack deadline with respect to the time this request was sent to |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1242 | # the Pub/Sub system. For example, if the value is 10, the new |
| 1243 | # ack deadline will expire 10 seconds after the `ModifyAckDeadline` call |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1244 | # was made. Specifying zero might immediately make the message available for |
| 1245 | # delivery to another subscriber client. This typically results in an |
| 1246 | # increase in the rate of message redeliveries (that is, duplicates). |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1247 | # The minimum deadline you can specify is 0 seconds. |
| 1248 | # The maximum deadline you can specify is 600 seconds (10 minutes). |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1249 | "ackIds": [ # Required. List of acknowledgment IDs. |
| 1250 | "A String", |
| 1251 | ], |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1252 | } |
| 1253 | |
| 1254 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1255 | Allowed values |
| 1256 | 1 - v1 error format |
| 1257 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1258 | |
| 1259 | Returns: |
| 1260 | An object of the form: |
| 1261 | |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1262 | { # A generic empty message that you can re-use to avoid defining duplicated |
| 1263 | # empty messages in your APIs. A typical example is to use it as the request |
| 1264 | # or the response type of an API method. For instance: |
| 1265 | # |
| 1266 | # service Foo { |
| 1267 | # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 1268 | # } |
| 1269 | # |
| 1270 | # The JSON representation for `Empty` is empty JSON object `{}`. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1271 | }</pre> |
| 1272 | </div> |
| 1273 | |
| 1274 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1275 | <code class="details" id="modifyPushConfig">modifyPushConfig(subscription, body=None, x__xgafv=None)</code> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1276 | <pre>Modifies the `PushConfig` for a specified subscription. |
| 1277 | |
| 1278 | This may be used to change a push subscription to a pull one (signified by |
| 1279 | an empty `PushConfig`) or vice versa, or change the endpoint URL and other |
| 1280 | attributes of a push subscription. Messages will accumulate for delivery |
| 1281 | continuously through the call regardless of changes to the `PushConfig`. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1282 | |
| 1283 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1284 | subscription: string, Required. The name of the subscription. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1285 | Format is `projects/{project}/subscriptions/{sub}`. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1286 | body: object, The request body. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1287 | The object takes the form of: |
| 1288 | |
| 1289 | { # Request for the ModifyPushConfig method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1290 | "pushConfig": { # Configuration for a push delivery endpoint. # Required. The push configuration for future deliveries. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1291 | # |
| 1292 | # An empty `pushConfig` indicates that the Pub/Sub system should |
| 1293 | # stop pushing messages from the given subscription and allow |
| 1294 | # messages to be pulled and acknowledged - effectively pausing |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1295 | # the subscription if `Pull` or `StreamingPull` is not called. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1296 | "oidcToken": { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an |
| 1297 | # `Authorization` header in the HTTP request for every pushed message. |
| 1298 | # [OpenID Connect |
| 1299 | # token](https://developers.google.com/identity/protocols/OpenIDConnect). |
| 1300 | "audience": "A String", # Audience to be used when generating OIDC token. The audience claim |
| 1301 | # identifies the recipients that the JWT is intended for. The audience |
| 1302 | # value is a single case-sensitive string. Having multiple values (array) |
| 1303 | # for the audience field is not supported. More info about the OIDC JWT |
| 1304 | # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 |
| 1305 | # Note: if not specified, the Push endpoint URL will be used. |
| 1306 | "serviceAccountEmail": "A String", # [Service account |
| 1307 | # email](https://cloud.google.com/iam/docs/service-accounts) |
| 1308 | # to be used for generating the OIDC token. The caller (for |
| 1309 | # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must |
| 1310 | # have the iam.serviceAccounts.actAs permission for the service account. |
| 1311 | }, |
| 1312 | "pushEndpoint": "A String", # A URL locating the endpoint to which messages should be pushed. |
| 1313 | # For example, a Webhook endpoint might use `https://example.com/push`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1314 | "attributes": { # Endpoint configuration attributes that can be used to control different |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1315 | # aspects of the message delivery. |
| 1316 | # |
| 1317 | # The only currently supported attribute is `x-goog-version`, which you can |
| 1318 | # use to change the format of the pushed message. This attribute |
| 1319 | # indicates the version of the data expected by the endpoint. This |
| 1320 | # controls the shape of the pushed message (i.e., its fields and metadata). |
| 1321 | # |
| 1322 | # If not present during the `CreateSubscription` call, it will default to |
| 1323 | # the version of the Pub/Sub API used to make such call. If not present in a |
| 1324 | # `ModifyPushConfig` call, its value will not be changed. `GetSubscription` |
| 1325 | # calls will always return a valid version, even if the subscription was |
| 1326 | # created without this attribute. |
| 1327 | # |
| 1328 | # The only supported values for the `x-goog-version` attribute are: |
| 1329 | # |
| 1330 | # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. |
| 1331 | # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. |
| 1332 | # |
| 1333 | # For example: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1334 | # <pre><code>attributes { "x-goog-version": "v1" } </code></pre> |
| 1335 | "a_key": "A String", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1336 | }, |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1337 | }, |
| 1338 | } |
| 1339 | |
| 1340 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1341 | Allowed values |
| 1342 | 1 - v1 error format |
| 1343 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1344 | |
| 1345 | Returns: |
| 1346 | An object of the form: |
| 1347 | |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1348 | { # A generic empty message that you can re-use to avoid defining duplicated |
| 1349 | # empty messages in your APIs. A typical example is to use it as the request |
| 1350 | # or the response type of an API method. For instance: |
| 1351 | # |
| 1352 | # service Foo { |
| 1353 | # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 1354 | # } |
| 1355 | # |
| 1356 | # The JSON representation for `Empty` is empty JSON object `{}`. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1357 | }</pre> |
| 1358 | </div> |
| 1359 | |
| 1360 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1361 | <code class="details" id="patch">patch(name, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1362 | <pre>Updates an existing subscription. Note that certain properties of a |
| 1363 | subscription, such as its topic, are not modifiable. |
| 1364 | |
| 1365 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1366 | name: string, Required. The name of the subscription. It must have the format |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1367 | `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1368 | start with a letter, and contain only letters (`[A-Za-z]`), numbers |
| 1369 | (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), |
| 1370 | plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1371 | in length, and it must not start with `"goog"`. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1372 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1373 | The object takes the form of: |
| 1374 | |
| 1375 | { # Request for the UpdateSubscription method. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1376 | "subscription": { # A subscription resource. # Required. The updated subscription object. |
| 1377 | "topic": "A String", # Required. The name of the topic from which this subscription is receiving messages. |
| 1378 | # Format is `projects/{project}/topics/{topic}`. |
| 1379 | # The value of this field will be `_deleted-topic_` if the topic has been |
| 1380 | # deleted. |
| 1381 | "ackDeadlineSeconds": 42, # The approximate amount of time (on a best-effort basis) Pub/Sub waits for |
| 1382 | # the subscriber to acknowledge receipt before resending the message. In the |
| 1383 | # interval after the message is delivered and before it is acknowledged, it |
| 1384 | # is considered to be <i>outstanding</i>. During that time period, the |
| 1385 | # message will not be redelivered (on a best-effort basis). |
| 1386 | # |
| 1387 | # For pull subscriptions, this value is used as the initial value for the ack |
| 1388 | # deadline. To override this value for a given message, call |
| 1389 | # `ModifyAckDeadline` with the corresponding `ack_id` if using |
| 1390 | # non-streaming pull or send the `ack_id` in a |
| 1391 | # `StreamingModifyAckDeadlineRequest` if using streaming pull. |
| 1392 | # The minimum custom deadline you can specify is 10 seconds. |
| 1393 | # The maximum custom deadline you can specify is 600 seconds (10 minutes). |
| 1394 | # If this parameter is 0, a default value of 10 seconds is used. |
| 1395 | # |
| 1396 | # For push delivery, this value is also used to set the request timeout for |
| 1397 | # the call to the push endpoint. |
| 1398 | # |
| 1399 | # If the subscriber never acknowledges the message, the Pub/Sub |
| 1400 | # system will eventually redeliver the message. |
| 1401 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
| 1402 | # managing labels</a>. |
| 1403 | "a_key": "A String", |
| 1404 | }, |
| 1405 | "expirationPolicy": { # A policy that specifies the conditions for resource expiration (i.e., # A policy that specifies the conditions for this subscription's expiration. |
| 1406 | # A subscription is considered active as long as any connected subscriber is |
| 1407 | # successfully consuming messages from the subscription or is issuing |
| 1408 | # operations on the subscription. If `expiration_policy` is not set, a |
| 1409 | # *default policy* with `ttl` of 31 days will be used. The minimum allowed |
| 1410 | # value for `expiration_policy.ttl` is 1 day. |
| 1411 | # automatic resource deletion). |
| 1412 | "ttl": "A String", # Specifies the "time-to-live" duration for an associated resource. The |
| 1413 | # resource expires if it is not active for a period of `ttl`. The definition |
| 1414 | # of "activity" depends on the type of the associated resource. The minimum |
| 1415 | # and maximum allowed values for `ttl` depend on the type of the associated |
| 1416 | # resource, as well. If `ttl` is not set, the associated resource never |
| 1417 | # expires. |
| 1418 | }, |
| 1419 | "retryPolicy": { # A policy that specifies how Cloud Pub/Sub retries message delivery. # A policy that specifies how Pub/Sub retries message delivery for this |
| 1420 | # subscription. |
| 1421 | # |
| 1422 | # If not set, the default retry policy is applied. This generally implies |
| 1423 | # that messages will be retried as soon as possible for healthy subscribers. |
| 1424 | # RetryPolicy will be triggered on NACKs or acknowledgement deadline |
| 1425 | # exceeded events for a given message. |
| 1426 | # |
| 1427 | # Retry delay will be exponential based on provided minimum and maximum |
| 1428 | # backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. |
| 1429 | # |
| 1430 | # RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded |
| 1431 | # events for a given message. |
| 1432 | # |
| 1433 | # Retry Policy is implemented on a best effort basis. At times, the delay |
| 1434 | # between consecutive deliveries may not match the configuration. That is, |
| 1435 | # delay can be more or less than configured backoff. |
| 1436 | "minimumBackoff": "A String", # The minimum delay between consecutive deliveries of a given message. |
| 1437 | # Value should be between 0 and 600 seconds. Defaults to 10 seconds. |
| 1438 | "maximumBackoff": "A String", # The maximum delay between consecutive deliveries of a given message. |
| 1439 | # Value should be between 0 and 600 seconds. Defaults to 600 seconds. |
| 1440 | }, |
| 1441 | "messageRetentionDuration": "A String", # How long to retain unacknowledged messages in the subscription's backlog, |
| 1442 | # from the moment a message is published. |
| 1443 | # If `retain_acked_messages` is true, then this also configures the retention |
| 1444 | # of acknowledged messages, and thus configures how far back in time a `Seek` |
| 1445 | # can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10 |
| 1446 | # minutes. |
| 1447 | "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is |
| 1448 | # used to configure it. An empty `pushConfig` signifies that the subscriber |
| 1449 | # will pull and ack messages using API methods. |
| 1450 | "oidcToken": { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an |
| 1451 | # `Authorization` header in the HTTP request for every pushed message. |
| 1452 | # [OpenID Connect |
| 1453 | # token](https://developers.google.com/identity/protocols/OpenIDConnect). |
| 1454 | "audience": "A String", # Audience to be used when generating OIDC token. The audience claim |
| 1455 | # identifies the recipients that the JWT is intended for. The audience |
| 1456 | # value is a single case-sensitive string. Having multiple values (array) |
| 1457 | # for the audience field is not supported. More info about the OIDC JWT |
| 1458 | # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 |
| 1459 | # Note: if not specified, the Push endpoint URL will be used. |
| 1460 | "serviceAccountEmail": "A String", # [Service account |
| 1461 | # email](https://cloud.google.com/iam/docs/service-accounts) |
| 1462 | # to be used for generating the OIDC token. The caller (for |
| 1463 | # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must |
| 1464 | # have the iam.serviceAccounts.actAs permission for the service account. |
| 1465 | }, |
| 1466 | "pushEndpoint": "A String", # A URL locating the endpoint to which messages should be pushed. |
| 1467 | # For example, a Webhook endpoint might use `https://example.com/push`. |
| 1468 | "attributes": { # Endpoint configuration attributes that can be used to control different |
| 1469 | # aspects of the message delivery. |
| 1470 | # |
| 1471 | # The only currently supported attribute is `x-goog-version`, which you can |
| 1472 | # use to change the format of the pushed message. This attribute |
| 1473 | # indicates the version of the data expected by the endpoint. This |
| 1474 | # controls the shape of the pushed message (i.e., its fields and metadata). |
| 1475 | # |
| 1476 | # If not present during the `CreateSubscription` call, it will default to |
| 1477 | # the version of the Pub/Sub API used to make such call. If not present in a |
| 1478 | # `ModifyPushConfig` call, its value will not be changed. `GetSubscription` |
| 1479 | # calls will always return a valid version, even if the subscription was |
| 1480 | # created without this attribute. |
| 1481 | # |
| 1482 | # The only supported values for the `x-goog-version` attribute are: |
| 1483 | # |
| 1484 | # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. |
| 1485 | # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. |
| 1486 | # |
| 1487 | # For example: |
| 1488 | # <pre><code>attributes { "x-goog-version": "v1" } </code></pre> |
| 1489 | "a_key": "A String", |
| 1490 | }, |
| 1491 | }, |
| 1492 | "deadLetterPolicy": { # 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 |
| 1493 | # this subscription. If dead_letter_policy is not set, dead lettering |
| 1494 | # is disabled. |
| 1495 | # |
| 1496 | # The Cloud Pub/Sub service account associated with this subscriptions's |
| 1497 | # parent project (i.e., |
| 1498 | # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have |
| 1499 | # permission to Acknowledge() messages on this subscription. |
| 1500 | # dead lettered multiple times. |
| 1501 | # |
| 1502 | # If validation on any of the fields fails at subscription creation/updation, |
| 1503 | # the create/update subscription request will fail. |
| 1504 | "deadLetterTopic": "A String", # The name of the topic to which dead letter messages should be published. |
| 1505 | # Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service |
| 1506 | # account associated with the enclosing subscription's parent project (i.e., |
| 1507 | # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have |
| 1508 | # permission to Publish() to this topic. |
| 1509 | # |
| 1510 | # The operation will fail if the topic does not exist. |
| 1511 | # Users should ensure that there is a subscription attached to this topic |
| 1512 | # since messages published to a topic with no subscriptions are lost. |
| 1513 | "maxDeliveryAttempts": 42, # The maximum number of delivery attempts for any message. The value must be |
| 1514 | # between 5 and 100. |
| 1515 | # |
| 1516 | # The number of delivery attempts is defined as 1 + (the sum of number of |
| 1517 | # NACKs and number of times the acknowledgement deadline has been exceeded |
| 1518 | # for the message). |
| 1519 | # |
| 1520 | # A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that |
| 1521 | # client libraries may automatically extend ack_deadlines. |
| 1522 | # |
| 1523 | # This field will be honored on a best effort basis. |
| 1524 | # |
| 1525 | # If this parameter is 0, a default value of 5 is used. |
| 1526 | }, |
| 1527 | "filter": "A String", # An expression written in the Pub/Sub [filter |
| 1528 | # language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, |
| 1529 | # then only `PubsubMessage`s whose `attributes` field matches the filter are |
| 1530 | # delivered on this subscription. If empty, then no messages are filtered |
| 1531 | # out. |
| 1532 | "retainAckedMessages": True or False, # Indicates whether to retain acknowledged messages. If true, then |
| 1533 | # messages are not expunged from the subscription's backlog, even if they are |
| 1534 | # acknowledged, until they fall out of the `message_retention_duration` |
| 1535 | # window. This must be true if you would like to [Seek to a timestamp] |
| 1536 | # (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time). |
| 1537 | "name": "A String", # Required. The name of the subscription. It must have the format |
| 1538 | # `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must |
| 1539 | # start with a letter, and contain only letters (`[A-Za-z]`), numbers |
| 1540 | # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), |
| 1541 | # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters |
| 1542 | # in length, and it must not start with `"goog"`. |
| 1543 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1544 | "updateMask": "A String", # Required. Indicates which fields in the provided subscription to update. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1545 | # Must be specified and non-empty. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1546 | } |
| 1547 | |
| 1548 | x__xgafv: string, V1 error format. |
| 1549 | Allowed values |
| 1550 | 1 - v1 error format |
| 1551 | 2 - v2 error format |
| 1552 | |
| 1553 | Returns: |
| 1554 | An object of the form: |
| 1555 | |
| 1556 | { # A subscription resource. |
| 1557 | "topic": "A String", # Required. The name of the topic from which this subscription is receiving messages. |
| 1558 | # Format is `projects/{project}/topics/{topic}`. |
| 1559 | # The value of this field will be `_deleted-topic_` if the topic has been |
| 1560 | # deleted. |
| 1561 | "ackDeadlineSeconds": 42, # The approximate amount of time (on a best-effort basis) Pub/Sub waits for |
| 1562 | # the subscriber to acknowledge receipt before resending the message. In the |
| 1563 | # interval after the message is delivered and before it is acknowledged, it |
| 1564 | # is considered to be <i>outstanding</i>. During that time period, the |
| 1565 | # message will not be redelivered (on a best-effort basis). |
| 1566 | # |
| 1567 | # For pull subscriptions, this value is used as the initial value for the ack |
| 1568 | # deadline. To override this value for a given message, call |
| 1569 | # `ModifyAckDeadline` with the corresponding `ack_id` if using |
| 1570 | # non-streaming pull or send the `ack_id` in a |
| 1571 | # `StreamingModifyAckDeadlineRequest` if using streaming pull. |
| 1572 | # The minimum custom deadline you can specify is 10 seconds. |
| 1573 | # The maximum custom deadline you can specify is 600 seconds (10 minutes). |
| 1574 | # If this parameter is 0, a default value of 10 seconds is used. |
| 1575 | # |
| 1576 | # For push delivery, this value is also used to set the request timeout for |
| 1577 | # the call to the push endpoint. |
| 1578 | # |
| 1579 | # If the subscriber never acknowledges the message, the Pub/Sub |
| 1580 | # system will eventually redeliver the message. |
| 1581 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
| 1582 | # managing labels</a>. |
| 1583 | "a_key": "A String", |
| 1584 | }, |
| 1585 | "expirationPolicy": { # A policy that specifies the conditions for resource expiration (i.e., # A policy that specifies the conditions for this subscription's expiration. |
| 1586 | # A subscription is considered active as long as any connected subscriber is |
| 1587 | # successfully consuming messages from the subscription or is issuing |
| 1588 | # operations on the subscription. If `expiration_policy` is not set, a |
| 1589 | # *default policy* with `ttl` of 31 days will be used. The minimum allowed |
| 1590 | # value for `expiration_policy.ttl` is 1 day. |
| 1591 | # automatic resource deletion). |
| 1592 | "ttl": "A String", # Specifies the "time-to-live" duration for an associated resource. The |
| 1593 | # resource expires if it is not active for a period of `ttl`. The definition |
| 1594 | # of "activity" depends on the type of the associated resource. The minimum |
| 1595 | # and maximum allowed values for `ttl` depend on the type of the associated |
| 1596 | # resource, as well. If `ttl` is not set, the associated resource never |
| 1597 | # expires. |
| 1598 | }, |
| 1599 | "retryPolicy": { # A policy that specifies how Cloud Pub/Sub retries message delivery. # A policy that specifies how Pub/Sub retries message delivery for this |
| 1600 | # subscription. |
| 1601 | # |
| 1602 | # If not set, the default retry policy is applied. This generally implies |
| 1603 | # that messages will be retried as soon as possible for healthy subscribers. |
| 1604 | # RetryPolicy will be triggered on NACKs or acknowledgement deadline |
| 1605 | # exceeded events for a given message. |
| 1606 | # |
| 1607 | # Retry delay will be exponential based on provided minimum and maximum |
| 1608 | # backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. |
| 1609 | # |
| 1610 | # RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded |
| 1611 | # events for a given message. |
| 1612 | # |
| 1613 | # Retry Policy is implemented on a best effort basis. At times, the delay |
| 1614 | # between consecutive deliveries may not match the configuration. That is, |
| 1615 | # delay can be more or less than configured backoff. |
| 1616 | "minimumBackoff": "A String", # The minimum delay between consecutive deliveries of a given message. |
| 1617 | # Value should be between 0 and 600 seconds. Defaults to 10 seconds. |
| 1618 | "maximumBackoff": "A String", # The maximum delay between consecutive deliveries of a given message. |
| 1619 | # Value should be between 0 and 600 seconds. Defaults to 600 seconds. |
| 1620 | }, |
| 1621 | "messageRetentionDuration": "A String", # How long to retain unacknowledged messages in the subscription's backlog, |
| 1622 | # from the moment a message is published. |
| 1623 | # If `retain_acked_messages` is true, then this also configures the retention |
| 1624 | # of acknowledged messages, and thus configures how far back in time a `Seek` |
| 1625 | # can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10 |
| 1626 | # minutes. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1627 | "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1628 | # used to configure it. An empty `pushConfig` signifies that the subscriber |
| 1629 | # will pull and ack messages using API methods. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1630 | "oidcToken": { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an |
| 1631 | # `Authorization` header in the HTTP request for every pushed message. |
| 1632 | # [OpenID Connect |
| 1633 | # token](https://developers.google.com/identity/protocols/OpenIDConnect). |
| 1634 | "audience": "A String", # Audience to be used when generating OIDC token. The audience claim |
| 1635 | # identifies the recipients that the JWT is intended for. The audience |
| 1636 | # value is a single case-sensitive string. Having multiple values (array) |
| 1637 | # for the audience field is not supported. More info about the OIDC JWT |
| 1638 | # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 |
| 1639 | # Note: if not specified, the Push endpoint URL will be used. |
| 1640 | "serviceAccountEmail": "A String", # [Service account |
| 1641 | # email](https://cloud.google.com/iam/docs/service-accounts) |
| 1642 | # to be used for generating the OIDC token. The caller (for |
| 1643 | # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must |
| 1644 | # have the iam.serviceAccounts.actAs permission for the service account. |
| 1645 | }, |
| 1646 | "pushEndpoint": "A String", # A URL locating the endpoint to which messages should be pushed. |
| 1647 | # For example, a Webhook endpoint might use `https://example.com/push`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1648 | "attributes": { # Endpoint configuration attributes that can be used to control different |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1649 | # aspects of the message delivery. |
| 1650 | # |
| 1651 | # The only currently supported attribute is `x-goog-version`, which you can |
| 1652 | # use to change the format of the pushed message. This attribute |
| 1653 | # indicates the version of the data expected by the endpoint. This |
| 1654 | # controls the shape of the pushed message (i.e., its fields and metadata). |
| 1655 | # |
| 1656 | # If not present during the `CreateSubscription` call, it will default to |
| 1657 | # the version of the Pub/Sub API used to make such call. If not present in a |
| 1658 | # `ModifyPushConfig` call, its value will not be changed. `GetSubscription` |
| 1659 | # calls will always return a valid version, even if the subscription was |
| 1660 | # created without this attribute. |
| 1661 | # |
| 1662 | # The only supported values for the `x-goog-version` attribute are: |
| 1663 | # |
| 1664 | # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. |
| 1665 | # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. |
| 1666 | # |
| 1667 | # For example: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1668 | # <pre><code>attributes { "x-goog-version": "v1" } </code></pre> |
| 1669 | "a_key": "A String", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1670 | }, |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1671 | }, |
| 1672 | "deadLetterPolicy": { # 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 |
| 1673 | # this subscription. If dead_letter_policy is not set, dead lettering |
| 1674 | # is disabled. |
| 1675 | # |
| 1676 | # The Cloud Pub/Sub service account associated with this subscriptions's |
| 1677 | # parent project (i.e., |
| 1678 | # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have |
| 1679 | # permission to Acknowledge() messages on this subscription. |
| 1680 | # dead lettered multiple times. |
| 1681 | # |
| 1682 | # If validation on any of the fields fails at subscription creation/updation, |
| 1683 | # the create/update subscription request will fail. |
| 1684 | "deadLetterTopic": "A String", # The name of the topic to which dead letter messages should be published. |
| 1685 | # Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service |
| 1686 | # account associated with the enclosing subscription's parent project (i.e., |
| 1687 | # service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have |
| 1688 | # permission to Publish() to this topic. |
| 1689 | # |
| 1690 | # The operation will fail if the topic does not exist. |
| 1691 | # Users should ensure that there is a subscription attached to this topic |
| 1692 | # since messages published to a topic with no subscriptions are lost. |
| 1693 | "maxDeliveryAttempts": 42, # The maximum number of delivery attempts for any message. The value must be |
| 1694 | # between 5 and 100. |
| 1695 | # |
| 1696 | # The number of delivery attempts is defined as 1 + (the sum of number of |
| 1697 | # NACKs and number of times the acknowledgement deadline has been exceeded |
| 1698 | # for the message). |
| 1699 | # |
| 1700 | # A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that |
| 1701 | # client libraries may automatically extend ack_deadlines. |
| 1702 | # |
| 1703 | # This field will be honored on a best effort basis. |
| 1704 | # |
| 1705 | # If this parameter is 0, a default value of 5 is used. |
| 1706 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1707 | "filter": "A String", # An expression written in the Pub/Sub [filter |
| 1708 | # language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, |
| 1709 | # then only `PubsubMessage`s whose `attributes` field matches the filter are |
| 1710 | # delivered on this subscription. If empty, then no messages are filtered |
| 1711 | # out. |
| 1712 | "retainAckedMessages": True or False, # Indicates whether to retain acknowledged messages. If true, then |
| 1713 | # messages are not expunged from the subscription's backlog, even if they are |
| 1714 | # acknowledged, until they fall out of the `message_retention_duration` |
| 1715 | # window. This must be true if you would like to [Seek to a timestamp] |
| 1716 | # (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time). |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1717 | "name": "A String", # Required. The name of the subscription. It must have the format |
| 1718 | # `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must |
| 1719 | # start with a letter, and contain only letters (`[A-Za-z]`), numbers |
| 1720 | # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), |
| 1721 | # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters |
| 1722 | # in length, and it must not start with `"goog"`. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1723 | }</pre> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1724 | </div> |
| 1725 | |
| 1726 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1727 | <code class="details" id="pull">pull(subscription, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1728 | <pre>Pulls messages from the server. The server may return `UNAVAILABLE` if |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1729 | there are too many concurrent pull requests pending for the given |
| 1730 | subscription. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1731 | |
| 1732 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1733 | subscription: string, Required. The subscription from which messages should be pulled. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1734 | Format is `projects/{project}/subscriptions/{sub}`. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1735 | body: object, The request body. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1736 | The object takes the form of: |
| 1737 | |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 1738 | { # Request for the `Pull` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1739 | "returnImmediately": True or False, # Optional. If this field set to true, the system will respond immediately even if |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1740 | # it there are no messages available to return in the `Pull` response. |
| 1741 | # Otherwise, the system may wait (for a bounded amount of time) until at |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1742 | # least one message is available, rather than returning no messages. Warning: |
| 1743 | # setting this field to `true` is discouraged because it adversely impacts |
| 1744 | # the performance of `Pull` operations. We recommend that users do not set |
| 1745 | # this field. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1746 | "maxMessages": 42, # Required. The maximum number of messages to return for this request. Must be a |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1747 | # positive integer. The Pub/Sub system may return fewer than the number |
| 1748 | # specified. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1749 | } |
| 1750 | |
| 1751 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1752 | Allowed values |
| 1753 | 1 - v1 error format |
| 1754 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1755 | |
| 1756 | Returns: |
| 1757 | An object of the form: |
| 1758 | |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 1759 | { # Response for the `Pull` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1760 | "receivedMessages": [ # Received Pub/Sub messages. The list will be empty if there are no more |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1761 | # messages available in the backlog. For JSON, the response can be entirely |
| 1762 | # empty. The Pub/Sub system may return fewer than the `maxMessages` requested |
| 1763 | # even if there are more messages available in the backlog. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1764 | { # A message and its corresponding acknowledgment ID. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1765 | "message": { # A message that is published by publishers and consumed by subscribers. The # The message. |
| 1766 | # message must contain either a non-empty data field or at least one attribute. |
| 1767 | # Note that client libraries represent this object differently |
| 1768 | # depending on the language. See the corresponding [client library |
| 1769 | # documentation](https://cloud.google.com/pubsub/docs/reference/libraries) for |
| 1770 | # more information. See [quotas and limits] |
| 1771 | # (https://cloud.google.com/pubsub/quotas) for more information about message |
| 1772 | # limits. |
| 1773 | "data": "A String", # The message data field. If this field is empty, the message must contain |
| 1774 | # at least one attribute. |
| 1775 | "publishTime": "A String", # The time at which the message was published, populated by the server when |
| 1776 | # it receives the `Publish` call. It must not be populated by the |
| 1777 | # publisher in a `Publish` call. |
| 1778 | "messageId": "A String", # ID of this message, assigned by the server when the message is published. |
| 1779 | # Guaranteed to be unique within the topic. This value may be read by a |
| 1780 | # subscriber that receives a `PubsubMessage` via a `Pull` call or a push |
| 1781 | # delivery. It must not be populated by the publisher in a `Publish` call. |
| 1782 | "attributes": { # Attributes for this message. If this field is empty, the message must |
| 1783 | # contain non-empty data. This can be used to filter messages on the |
| 1784 | # subscription. |
| 1785 | "a_key": "A String", |
| 1786 | }, |
| 1787 | }, |
| 1788 | "ackId": "A String", # This ID can be used to acknowledge the received message. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1789 | "deliveryAttempt": 42, # The approximate number of times that Cloud Pub/Sub has attempted to deliver |
| 1790 | # the associated message to a subscriber. |
| 1791 | # |
| 1792 | # More precisely, this is 1 + (number of NACKs) + |
| 1793 | # (number of ack_deadline exceeds) for this message. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1794 | # |
| 1795 | # A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline |
| 1796 | # exceeds event is whenever a message is not acknowledged within |
| 1797 | # ack_deadline. Note that ack_deadline is initially |
| 1798 | # Subscription.ackDeadlineSeconds, but may get extended automatically by |
| 1799 | # the client library. |
| 1800 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1801 | # Upon the first delivery of a given message, `delivery_attempt` will have a |
| 1802 | # value of 1. The value is calculated at best effort and is approximate. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1803 | # |
| 1804 | # If a DeadLetterPolicy is not set on the subscription, this will be 0. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1805 | }, |
| 1806 | ], |
| 1807 | }</pre> |
| 1808 | </div> |
| 1809 | |
| 1810 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1811 | <code class="details" id="seek">seek(subscription, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1812 | <pre>Seeks an existing subscription to a point in time or to a given snapshot, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1813 | whichever is provided in the request. Snapshots are used in [Seek]( |
| 1814 | https://cloud.google.com/pubsub/docs/replay-overview) operations, which |
| 1815 | allow you to manage message acknowledgments in bulk. That is, you can set |
| 1816 | the acknowledgment state of messages in an existing subscription to the |
| 1817 | state captured by a snapshot. Note that both the subscription and the |
| 1818 | snapshot must be on the same topic. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1819 | |
| 1820 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1821 | subscription: string, Required. The subscription to affect. (required) |
| 1822 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1823 | The object takes the form of: |
| 1824 | |
| 1825 | { # Request for the `Seek` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1826 | "time": "A String", # The time to seek to. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1827 | # Messages retained in the subscription that were published before this |
| 1828 | # time are marked as acknowledged, and messages retained in the |
| 1829 | # subscription that were published after this time are marked as |
| 1830 | # unacknowledged. Note that this operation affects only those messages |
| 1831 | # retained in the subscription (configured by the combination of |
| 1832 | # `message_retention_duration` and `retain_acked_messages`). For example, |
| 1833 | # if `time` corresponds to a point before the message retention |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1834 | # window (or to a point before the system's notion of the subscription |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1835 | # creation time), only retained messages will be marked as unacknowledged, |
| 1836 | # and already-expunged messages will not be restored. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1837 | "snapshot": "A String", # The snapshot to seek to. The snapshot's topic must be the same as that of |
| 1838 | # the provided subscription. |
| 1839 | # Format is `projects/{project}/snapshots/{snap}`. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1840 | } |
| 1841 | |
| 1842 | x__xgafv: string, V1 error format. |
| 1843 | Allowed values |
| 1844 | 1 - v1 error format |
| 1845 | 2 - v2 error format |
| 1846 | |
| 1847 | Returns: |
| 1848 | An object of the form: |
| 1849 | |
| 1850 | { # Response for the `Seek` method (this response is empty). |
| 1851 | }</pre> |
| 1852 | </div> |
| 1853 | |
| 1854 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1855 | <code class="details" id="setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</code> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1856 | <pre>Sets the access control policy on the specified resource. Replaces any |
| 1857 | existing policy. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1858 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1859 | Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1860 | |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1861 | Args: |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1862 | resource: string, REQUIRED: The resource for which the policy is being specified. |
Sai Cheemalapati | e833b79 | 2017-03-24 15:06:46 -0700 | [diff] [blame] | 1863 | See the operation documentation for the appropriate value for this field. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1864 | body: object, The request body. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 1865 | The object takes the form of: |
| 1866 | |
| 1867 | { # Request message for `SetIamPolicy` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1868 | "policy": { # 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 Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1869 | # the policy is limited to a few 10s of KB. An empty policy is a |
| 1870 | # valid policy but certain Cloud Platform services (such as Projects) |
| 1871 | # might reject them. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1872 | # controls for Google Cloud resources. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1873 | # |
| 1874 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1875 | # A `Policy` is a collection of `bindings`. A `binding` binds one or more |
| 1876 | # `members` to a single `role`. Members can be user accounts, service accounts, |
| 1877 | # Google groups, and domains (such as G Suite). A `role` is a named list of |
| 1878 | # permissions; each `role` can be an IAM predefined role or a user-created |
| 1879 | # custom role. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1880 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1881 | # For some types of Google Cloud resources, a `binding` can also specify a |
| 1882 | # `condition`, which is a logical expression that allows access to a resource |
| 1883 | # only if the expression evaluates to `true`. A condition can add constraints |
| 1884 | # based on attributes of the request, the resource, or both. To learn which |
| 1885 | # resources support conditions in their IAM policies, see the |
| 1886 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1887 | # |
| 1888 | # **JSON example:** |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1889 | # |
| 1890 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1891 | # "bindings": [ |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1892 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1893 | # "role": "roles/resourcemanager.organizationAdmin", |
| 1894 | # "members": [ |
| 1895 | # "user:mike@example.com", |
| 1896 | # "group:admins@example.com", |
| 1897 | # "domain:google.com", |
| 1898 | # "serviceAccount:my-project-id@appspot.gserviceaccount.com" |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1899 | # ] |
| 1900 | # }, |
| 1901 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1902 | # "role": "roles/resourcemanager.organizationViewer", |
| 1903 | # "members": [ |
| 1904 | # "user:eve@example.com" |
| 1905 | # ], |
| 1906 | # "condition": { |
| 1907 | # "title": "expirable access", |
| 1908 | # "description": "Does not grant access after Sep 2020", |
| 1909 | # "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1910 | # } |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1911 | # } |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1912 | # ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1913 | # "etag": "BwWWja0YfJA=", |
| 1914 | # "version": 3 |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1915 | # } |
| 1916 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1917 | # **YAML example:** |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1918 | # |
| 1919 | # bindings: |
| 1920 | # - members: |
| 1921 | # - user:mike@example.com |
| 1922 | # - group:admins@example.com |
| 1923 | # - domain:google.com |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1924 | # - serviceAccount:my-project-id@appspot.gserviceaccount.com |
| 1925 | # role: roles/resourcemanager.organizationAdmin |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1926 | # - members: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1927 | # - user:eve@example.com |
| 1928 | # role: roles/resourcemanager.organizationViewer |
| 1929 | # condition: |
| 1930 | # title: expirable access |
| 1931 | # description: Does not grant access after Sep 2020 |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1932 | # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1933 | # - etag: BwWWja0YfJA= |
| 1934 | # - version: 3 |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1935 | # |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1936 | # For a description of IAM and its features, see the |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1937 | # [IAM documentation](https://cloud.google.com/iam/docs/). |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 1938 | "version": 42, # Specifies the format of the policy. |
| 1939 | # |
| 1940 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 1941 | # are rejected. |
| 1942 | # |
| 1943 | # Any operation that affects conditional role bindings must specify version |
| 1944 | # `3`. This requirement applies to the following operations: |
| 1945 | # |
| 1946 | # * Getting a policy that includes a conditional role binding |
| 1947 | # * Adding a conditional role binding to a policy |
| 1948 | # * Changing a conditional role binding in a policy |
| 1949 | # * Removing any role binding, with or without a condition, from a policy |
| 1950 | # that includes conditions |
| 1951 | # |
| 1952 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 1953 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 1954 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 1955 | # the conditions in the version `3` policy are lost. |
| 1956 | # |
| 1957 | # If a policy does not include any conditions, operations on that policy may |
| 1958 | # specify any valid version or leave the field unset. |
| 1959 | # |
| 1960 | # To learn which resources support conditions in their IAM policies, see the |
| 1961 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
| 1962 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 1963 | # prevent simultaneous updates of a policy from overwriting each other. |
| 1964 | # It is strongly suggested that systems make use of the `etag` in the |
| 1965 | # read-modify-write cycle to perform policy updates in order to avoid race |
| 1966 | # conditions: An `etag` is returned in the response to `getIamPolicy`, and |
| 1967 | # systems are expected to put that etag in the request to `setIamPolicy` to |
| 1968 | # ensure that their change will be applied to the same version of the policy. |
| 1969 | # |
| 1970 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 1971 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 1972 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 1973 | # the conditions in the version `3` policy are lost. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1974 | "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1975 | # `condition` that determines how and when the `bindings` are applied. Each |
| 1976 | # of the `bindings` must contain at least one member. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 1977 | { # Associates `members` with a `role`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1978 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
| 1979 | # |
| 1980 | # If the condition evaluates to `true`, then this binding applies to the |
| 1981 | # current request. |
| 1982 | # |
| 1983 | # If the condition evaluates to `false`, then this binding does not apply to |
| 1984 | # the current request. However, a different role binding might grant the same |
| 1985 | # role to one or more of the members in this binding. |
| 1986 | # |
| 1987 | # To learn which resources support conditions in their IAM policies, see the |
| 1988 | # [IAM |
| 1989 | # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
| 1990 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 1991 | # are documented at https://github.com/google/cel-spec. |
| 1992 | # |
| 1993 | # Example (Comparison): |
| 1994 | # |
| 1995 | # title: "Summary size limit" |
| 1996 | # description: "Determines if a summary is less than 100 chars" |
| 1997 | # expression: "document.summary.size() < 100" |
| 1998 | # |
| 1999 | # Example (Equality): |
| 2000 | # |
| 2001 | # title: "Requestor is owner" |
| 2002 | # description: "Determines if requestor is the document owner" |
| 2003 | # expression: "document.owner == request.auth.claims.email" |
| 2004 | # |
| 2005 | # Example (Logic): |
| 2006 | # |
| 2007 | # title: "Public documents" |
| 2008 | # description: "Determine whether the document should be publicly visible" |
| 2009 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 2010 | # |
| 2011 | # Example (Data Manipulation): |
| 2012 | # |
| 2013 | # title: "Notification string" |
| 2014 | # description: "Create a notification string with a timestamp." |
| 2015 | # expression: "'New message received at ' + string(document.create_time)" |
| 2016 | # |
| 2017 | # The exact variables and functions that may be referenced within an expression |
| 2018 | # are determined by the service that evaluates it. See the service |
| 2019 | # documentation for additional information. |
| 2020 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 2021 | # reporting, e.g. a file name and a position in the file. |
| 2022 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
| 2023 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 2024 | # expression. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2025 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 2026 | # syntax. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2027 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
| 2028 | # describes the expression, e.g. when hovered over it in a UI. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2029 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2030 | "role": "A String", # Role that is assigned to `members`. |
| 2031 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2032 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2033 | # `members` can have the following values: |
| 2034 | # |
| 2035 | # * `allUsers`: A special identifier that represents anyone who is |
| 2036 | # on the internet; with or without a Google account. |
| 2037 | # |
| 2038 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 2039 | # who is authenticated with a Google account or a service account. |
| 2040 | # |
| 2041 | # * `user:{emailid}`: An email address that represents a specific Google |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2042 | # account. For example, `alice@example.com` . |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2043 | # |
| 2044 | # |
| 2045 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 2046 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 2047 | # |
| 2048 | # * `group:{emailid}`: An email address that represents a Google group. |
| 2049 | # For example, `admins@example.com`. |
| 2050 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2051 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 2052 | # identifier) representing a user that has been recently deleted. For |
| 2053 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 2054 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 2055 | # retains the role in the binding. |
| 2056 | # |
| 2057 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 2058 | # unique identifier) representing a service account that has been recently |
| 2059 | # deleted. For example, |
| 2060 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 2061 | # If the service account is undeleted, this value reverts to |
| 2062 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 2063 | # role in the binding. |
| 2064 | # |
| 2065 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 2066 | # identifier) representing a Google group that has been recently |
| 2067 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 2068 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 2069 | # recovered group retains the role in the binding. |
| 2070 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2071 | # |
| 2072 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2073 | # users of that domain. For example, `google.com` or `example.com`. |
| 2074 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2075 | "A String", |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 2076 | ], |
| 2077 | }, |
| 2078 | ], |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 2079 | }, |
| 2080 | } |
| 2081 | |
| 2082 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2083 | Allowed values |
| 2084 | 1 - v1 error format |
| 2085 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 2086 | |
| 2087 | Returns: |
| 2088 | An object of the form: |
| 2089 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2090 | { # An Identity and Access Management (IAM) policy, which specifies access |
| 2091 | # controls for Google Cloud resources. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2092 | # |
| 2093 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2094 | # A `Policy` is a collection of `bindings`. A `binding` binds one or more |
| 2095 | # `members` to a single `role`. Members can be user accounts, service accounts, |
| 2096 | # Google groups, and domains (such as G Suite). A `role` is a named list of |
| 2097 | # permissions; each `role` can be an IAM predefined role or a user-created |
| 2098 | # custom role. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2099 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2100 | # For some types of Google Cloud resources, a `binding` can also specify a |
| 2101 | # `condition`, which is a logical expression that allows access to a resource |
| 2102 | # only if the expression evaluates to `true`. A condition can add constraints |
| 2103 | # based on attributes of the request, the resource, or both. To learn which |
| 2104 | # resources support conditions in their IAM policies, see the |
| 2105 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2106 | # |
| 2107 | # **JSON example:** |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2108 | # |
| 2109 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2110 | # "bindings": [ |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2111 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2112 | # "role": "roles/resourcemanager.organizationAdmin", |
| 2113 | # "members": [ |
| 2114 | # "user:mike@example.com", |
| 2115 | # "group:admins@example.com", |
| 2116 | # "domain:google.com", |
| 2117 | # "serviceAccount:my-project-id@appspot.gserviceaccount.com" |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2118 | # ] |
| 2119 | # }, |
| 2120 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2121 | # "role": "roles/resourcemanager.organizationViewer", |
| 2122 | # "members": [ |
| 2123 | # "user:eve@example.com" |
| 2124 | # ], |
| 2125 | # "condition": { |
| 2126 | # "title": "expirable access", |
| 2127 | # "description": "Does not grant access after Sep 2020", |
| 2128 | # "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2129 | # } |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2130 | # } |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2131 | # ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2132 | # "etag": "BwWWja0YfJA=", |
| 2133 | # "version": 3 |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2134 | # } |
| 2135 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2136 | # **YAML example:** |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2137 | # |
| 2138 | # bindings: |
| 2139 | # - members: |
| 2140 | # - user:mike@example.com |
| 2141 | # - group:admins@example.com |
| 2142 | # - domain:google.com |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2143 | # - serviceAccount:my-project-id@appspot.gserviceaccount.com |
| 2144 | # role: roles/resourcemanager.organizationAdmin |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2145 | # - members: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2146 | # - user:eve@example.com |
| 2147 | # role: roles/resourcemanager.organizationViewer |
| 2148 | # condition: |
| 2149 | # title: expirable access |
| 2150 | # description: Does not grant access after Sep 2020 |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2151 | # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2152 | # - etag: BwWWja0YfJA= |
| 2153 | # - version: 3 |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2154 | # |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2155 | # For a description of IAM and its features, see the |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2156 | # [IAM documentation](https://cloud.google.com/iam/docs/). |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2157 | "version": 42, # Specifies the format of the policy. |
| 2158 | # |
| 2159 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 2160 | # are rejected. |
| 2161 | # |
| 2162 | # Any operation that affects conditional role bindings must specify version |
| 2163 | # `3`. This requirement applies to the following operations: |
| 2164 | # |
| 2165 | # * Getting a policy that includes a conditional role binding |
| 2166 | # * Adding a conditional role binding to a policy |
| 2167 | # * Changing a conditional role binding in a policy |
| 2168 | # * Removing any role binding, with or without a condition, from a policy |
| 2169 | # that includes conditions |
| 2170 | # |
| 2171 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 2172 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 2173 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 2174 | # the conditions in the version `3` policy are lost. |
| 2175 | # |
| 2176 | # If a policy does not include any conditions, operations on that policy may |
| 2177 | # specify any valid version or leave the field unset. |
| 2178 | # |
| 2179 | # To learn which resources support conditions in their IAM policies, see the |
| 2180 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
| 2181 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 2182 | # prevent simultaneous updates of a policy from overwriting each other. |
| 2183 | # It is strongly suggested that systems make use of the `etag` in the |
| 2184 | # read-modify-write cycle to perform policy updates in order to avoid race |
| 2185 | # conditions: An `etag` is returned in the response to `getIamPolicy`, and |
| 2186 | # systems are expected to put that etag in the request to `setIamPolicy` to |
| 2187 | # ensure that their change will be applied to the same version of the policy. |
| 2188 | # |
| 2189 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 2190 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 2191 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 2192 | # the conditions in the version `3` policy are lost. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2193 | "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2194 | # `condition` that determines how and when the `bindings` are applied. Each |
| 2195 | # of the `bindings` must contain at least one member. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 2196 | { # Associates `members` with a `role`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2197 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
| 2198 | # |
| 2199 | # If the condition evaluates to `true`, then this binding applies to the |
| 2200 | # current request. |
| 2201 | # |
| 2202 | # If the condition evaluates to `false`, then this binding does not apply to |
| 2203 | # the current request. However, a different role binding might grant the same |
| 2204 | # role to one or more of the members in this binding. |
| 2205 | # |
| 2206 | # To learn which resources support conditions in their IAM policies, see the |
| 2207 | # [IAM |
| 2208 | # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
| 2209 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 2210 | # are documented at https://github.com/google/cel-spec. |
| 2211 | # |
| 2212 | # Example (Comparison): |
| 2213 | # |
| 2214 | # title: "Summary size limit" |
| 2215 | # description: "Determines if a summary is less than 100 chars" |
| 2216 | # expression: "document.summary.size() < 100" |
| 2217 | # |
| 2218 | # Example (Equality): |
| 2219 | # |
| 2220 | # title: "Requestor is owner" |
| 2221 | # description: "Determines if requestor is the document owner" |
| 2222 | # expression: "document.owner == request.auth.claims.email" |
| 2223 | # |
| 2224 | # Example (Logic): |
| 2225 | # |
| 2226 | # title: "Public documents" |
| 2227 | # description: "Determine whether the document should be publicly visible" |
| 2228 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 2229 | # |
| 2230 | # Example (Data Manipulation): |
| 2231 | # |
| 2232 | # title: "Notification string" |
| 2233 | # description: "Create a notification string with a timestamp." |
| 2234 | # expression: "'New message received at ' + string(document.create_time)" |
| 2235 | # |
| 2236 | # The exact variables and functions that may be referenced within an expression |
| 2237 | # are determined by the service that evaluates it. See the service |
| 2238 | # documentation for additional information. |
| 2239 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 2240 | # reporting, e.g. a file name and a position in the file. |
| 2241 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
| 2242 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 2243 | # expression. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2244 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 2245 | # syntax. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2246 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
| 2247 | # describes the expression, e.g. when hovered over it in a UI. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2248 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 2249 | "role": "A String", # Role that is assigned to `members`. |
| 2250 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2251 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2252 | # `members` can have the following values: |
| 2253 | # |
| 2254 | # * `allUsers`: A special identifier that represents anyone who is |
| 2255 | # on the internet; with or without a Google account. |
| 2256 | # |
| 2257 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 2258 | # who is authenticated with a Google account or a service account. |
| 2259 | # |
| 2260 | # * `user:{emailid}`: An email address that represents a specific Google |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2261 | # account. For example, `alice@example.com` . |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2262 | # |
| 2263 | # |
| 2264 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 2265 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 2266 | # |
| 2267 | # * `group:{emailid}`: An email address that represents a Google group. |
| 2268 | # For example, `admins@example.com`. |
| 2269 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2270 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 2271 | # identifier) representing a user that has been recently deleted. For |
| 2272 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 2273 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 2274 | # retains the role in the binding. |
| 2275 | # |
| 2276 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 2277 | # unique identifier) representing a service account that has been recently |
| 2278 | # deleted. For example, |
| 2279 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 2280 | # If the service account is undeleted, this value reverts to |
| 2281 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 2282 | # role in the binding. |
| 2283 | # |
| 2284 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 2285 | # identifier) representing a Google group that has been recently |
| 2286 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 2287 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 2288 | # recovered group retains the role in the binding. |
| 2289 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2290 | # |
| 2291 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2292 | # users of that domain. For example, `google.com` or `example.com`. |
| 2293 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2294 | "A String", |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 2295 | ], |
| 2296 | }, |
| 2297 | ], |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 2298 | }</pre> |
| 2299 | </div> |
| 2300 | |
| 2301 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2302 | <code class="details" id="testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</code> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 2303 | <pre>Returns permissions that a caller has on the specified resource. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2304 | If the resource does not exist, this will return an empty set of |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2305 | permissions, not a `NOT_FOUND` error. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 2306 | |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 2307 | Note: This operation is designed to be used for building permission-aware |
| 2308 | UIs and command-line tools, not for authorization checking. This operation |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2309 | may "fail open" without warning. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 2310 | |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 2311 | Args: |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2312 | resource: string, REQUIRED: The resource for which the policy detail is being requested. |
Sai Cheemalapati | e833b79 | 2017-03-24 15:06:46 -0700 | [diff] [blame] | 2313 | See the operation documentation for the appropriate value for this field. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2314 | body: object, The request body. |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 2315 | The object takes the form of: |
| 2316 | |
| 2317 | { # Request message for `TestIamPermissions` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2318 | "permissions": [ # The set of permissions to check for the `resource`. Permissions with |
| 2319 | # wildcards (such as '*' or 'storage.*') are not allowed. For more |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2320 | # information see |
| 2321 | # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2322 | "A String", |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 2323 | ], |
| 2324 | } |
| 2325 | |
| 2326 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2327 | Allowed values |
| 2328 | 1 - v1 error format |
| 2329 | 2 - v2 error format |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 2330 | |
| 2331 | Returns: |
| 2332 | An object of the form: |
| 2333 | |
| 2334 | { # Response message for `TestIamPermissions` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2335 | "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2336 | # allowed. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2337 | "A String", |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 2338 | ], |
| 2339 | }</pre> |
| 2340 | </div> |
| 2341 | |
| 2342 | </body></html> |