1<html><body> 2<style> 3 4body, h1, h2, h3, div, span, p, pre, a { 5 margin: 0; 6 padding: 0; 7 border: 0; 8 font-weight: inherit; 9 font-style: inherit; 10 font-size: 100%; 11 font-family: inherit; 12 vertical-align: baseline; 13} 14 15body { 16 font-size: 13px; 17 padding: 1em; 18} 19 20h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23} 24 25h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28} 29 30h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34} 35 36pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39} 40 41pre { 42 margin-top: 0.5em; 43} 44 45h1, h2, h3, p { 46 font-family: Arial, sans serif; 47} 48 49h1, h2, h3 { 50 border-bottom: solid #CCC 1px; 51} 52 53.toc_element { 54 margin-top: 0.5em; 55} 56 57.firstline { 58 margin-left: 2 em; 59} 60 61.method { 62 margin-top: 1em; 63 border: solid 1px #CCC; 64 padding: 1em; 65 background: #EEE; 66} 67 68.details { 69 font-weight: bold; 70 font-size: 14px; 71} 72 73</style> 74 75<h1><a href="pubsub_v1beta2.html">Cloud Pub/Sub API</a> . <a href="pubsub_v1beta2.projects.html">projects</a> . <a href="pubsub_v1beta2.projects.subscriptions.html">subscriptions</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="#acknowledge">acknowledge(subscription, body, x__xgafv=None)</a></code></p> 79<p class="firstline">Acknowledges the messages associated with the `ack_ids` in the</p> 80<p class="toc_element"> 81 <code><a href="#create">create(name, body, x__xgafv=None)</a></code></p> 82<p class="firstline">Creates a subscription to a given topic.</p> 83<p class="toc_element"> 84 <code><a href="#delete">delete(subscription, x__xgafv=None)</a></code></p> 85<p class="firstline">Deletes an existing subscription. All pending messages in the subscription</p> 86<p class="toc_element"> 87 <code><a href="#get">get(subscription, x__xgafv=None)</a></code></p> 88<p class="firstline">Gets the configuration details of a subscription.</p> 89<p class="toc_element"> 90 <code><a href="#getIamPolicy">getIamPolicy(resource, x__xgafv=None)</a></code></p> 91<p class="firstline">Gets the access control policy for a resource.</p> 92<p class="toc_element"> 93 <code><a href="#list">list(project, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p> 94<p class="firstline">Lists matching subscriptions.</p> 95<p class="toc_element"> 96 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 97<p class="firstline">Retrieves the next page of results.</p> 98<p class="toc_element"> 99 <code><a href="#modifyAckDeadline">modifyAckDeadline(subscription, body, x__xgafv=None)</a></code></p> 100<p class="firstline">Modifies the ack deadline for a specific message. This method is useful</p> 101<p class="toc_element"> 102 <code><a href="#modifyPushConfig">modifyPushConfig(subscription, body, x__xgafv=None)</a></code></p> 103<p class="firstline">Modifies the `PushConfig` for a specified subscription.</p> 104<p class="toc_element"> 105 <code><a href="#pull">pull(subscription, body, x__xgafv=None)</a></code></p> 106<p class="firstline">Pulls messages from the server. Returns an empty list if there are no</p> 107<p class="toc_element"> 108 <code><a href="#setIamPolicy">setIamPolicy(resource, body, x__xgafv=None)</a></code></p> 109<p class="firstline">Sets the access control policy on the specified resource. Replaces any</p> 110<p class="toc_element"> 111 <code><a href="#testIamPermissions">testIamPermissions(resource, body, x__xgafv=None)</a></code></p> 112<p class="firstline">Returns permissions that a caller has on the specified resource.</p> 113<h3>Method Details</h3> 114<div class="method"> 115 <code class="details" id="acknowledge">acknowledge(subscription, body, x__xgafv=None)</code> 116 <pre>Acknowledges the messages associated with the `ack_ids` in the 117`AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages 118from the subscription. 119 120Acknowledging a message whose ack deadline has expired may succeed, 121but such a message may be redelivered later. Acknowledging a message more 122than once will not result in an error. 123 124Args: 125 subscription: string, The subscription whose message is being acknowledged. (required) 126 body: object, The request body. (required) 127 The object takes the form of: 128 129{ # Request for the Acknowledge method. 130 "ackIds": [ # The acknowledgment ID for the messages being acknowledged that was returned 131 # by the Pub/Sub system in the `Pull` response. Must not be empty. 132 "A String", 133 ], 134 } 135 136 x__xgafv: string, V1 error format. 137 Allowed values 138 1 - v1 error format 139 2 - v2 error format 140 141Returns: 142 An object of the form: 143 144 { # A generic empty message that you can re-use to avoid defining duplicated 145 # empty messages in your APIs. A typical example is to use it as the request 146 # or the response type of an API method. For instance: 147 # 148 # service Foo { 149 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 150 # } 151 # 152 # The JSON representation for `Empty` is empty JSON object `{}`. 153 }</pre> 154</div> 155 156<div class="method"> 157 <code class="details" id="create">create(name, body, x__xgafv=None)</code> 158 <pre>Creates a subscription to a given topic. 159If the subscription already exists, returns `ALREADY_EXISTS`. 160If the corresponding topic doesn't exist, returns `NOT_FOUND`. 161 162If the name is not provided in the request, the server will assign a random 163name for this subscription on the same project as the topic. Note that 164for REST API requests, you must specify a name. 165 166Args: 167 name: string, The name of the subscription. It must have the format 168`"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must 169start with a letter, and contain only letters (`[A-Za-z]`), numbers 170(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), 171plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters 172in length, and it must not start with `"goog"`. (required) 173 body: object, The request body. (required) 174 The object takes the form of: 175 176{ # A subscription resource. 177 "ackDeadlineSeconds": 42, # This value is the maximum time after a subscriber receives a message 178 # before the subscriber should acknowledge the message. After message 179 # delivery but before the ack deadline expires and before the message is 180 # acknowledged, it is an outstanding message and will not be delivered 181 # again during that time (on a best-effort basis). 182 # 183 # For pull subscriptions, this value is used as the initial value for the ack 184 # deadline. To override this value for a given message, call 185 # `ModifyAckDeadline` with the corresponding `ack_id` if using pull. 186 # The maximum custom deadline you can specify is 600 seconds (10 minutes). 187 # 188 # For push delivery, this value is also used to set the request timeout for 189 # the call to the push endpoint. 190 # 191 # If the subscriber never acknowledges the message, the Pub/Sub 192 # system will eventually redeliver the message. 193 # 194 # If this parameter is 0, a default value of 10 seconds is used. 195 "topic": "A String", # The name of the topic from which this subscription is receiving messages. 196 # The value of this field will be `_deleted-topic_` if the topic has been 197 # deleted. 198 "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is 199 # used to configure it. An empty `pushConfig` signifies that the subscriber 200 # will pull and ack messages using API methods. 201 "oidcToken": { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an 202 # `Authorization` header in the HTTP request for every pushed message. 203 # [OpenID Connect 204 # token](https://developers.google.com/identity/protocols/OpenIDConnect). 205 "audience": "A String", # Audience to be used when generating OIDC token. The audience claim 206 # identifies the recipients that the JWT is intended for. The audience 207 # value is a single case-sensitive string. Having multiple values (array) 208 # for the audience field is not supported. More info about the OIDC JWT 209 # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 210 # Note: if not specified, the Push endpoint URL will be used. 211 "serviceAccountEmail": "A String", # [Service account 212 # email](https://cloud.google.com/iam/docs/service-accounts) 213 # to be used for generating the OIDC token. The caller (for 214 # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must 215 # have the iam.serviceAccounts.actAs permission for the service account. 216 }, 217 "attributes": { # Endpoint configuration attributes. 218 # 219 # Every endpoint has a set of API supported attributes that can be used to 220 # control different aspects of the message delivery. 221 # 222 # The currently supported attribute is `x-goog-version`, which you can 223 # use to change the format of the push message. This attribute 224 # indicates the version of the data expected by the endpoint. This 225 # controls the shape of the envelope (i.e. its fields and metadata). 226 # The endpoint version is based on the version of the Pub/Sub 227 # API. 228 # 229 # If not present during the `CreateSubscription` call, it will default to 230 # the version of the API used to make such call. If not present during a 231 # `ModifyPushConfig` call, its value will not be changed. `GetSubscription` 232 # calls will always return a valid version, even if the subscription was 233 # created without this attribute. 234 # 235 # The possible values for this attribute are: 236 # 237 # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. 238 # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. 239 "a_key": "A String", 240 }, 241 "pushEndpoint": "A String", # A URL locating the endpoint to which messages should be pushed. 242 # For example, a Webhook endpoint might use "https://example.com/push". 243 }, 244 "name": "A String", # The name of the subscription. It must have the format 245 # `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must 246 # start with a letter, and contain only letters (`[A-Za-z]`), numbers 247 # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), 248 # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters 249 # in length, and it must not start with `"goog"`. 250} 251 252 x__xgafv: string, V1 error format. 253 Allowed values 254 1 - v1 error format 255 2 - v2 error format 256 257Returns: 258 An object of the form: 259 260 { # A subscription resource. 261 "ackDeadlineSeconds": 42, # This value is the maximum time after a subscriber receives a message 262 # before the subscriber should acknowledge the message. After message 263 # delivery but before the ack deadline expires and before the message is 264 # acknowledged, it is an outstanding message and will not be delivered 265 # again during that time (on a best-effort basis). 266 # 267 # For pull subscriptions, this value is used as the initial value for the ack 268 # deadline. To override this value for a given message, call 269 # `ModifyAckDeadline` with the corresponding `ack_id` if using pull. 270 # The maximum custom deadline you can specify is 600 seconds (10 minutes). 271 # 272 # For push delivery, this value is also used to set the request timeout for 273 # the call to the push endpoint. 274 # 275 # If the subscriber never acknowledges the message, the Pub/Sub 276 # system will eventually redeliver the message. 277 # 278 # If this parameter is 0, a default value of 10 seconds is used. 279 "topic": "A String", # The name of the topic from which this subscription is receiving messages. 280 # The value of this field will be `_deleted-topic_` if the topic has been 281 # deleted. 282 "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is 283 # used to configure it. An empty `pushConfig` signifies that the subscriber 284 # will pull and ack messages using API methods. 285 "oidcToken": { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an 286 # `Authorization` header in the HTTP request for every pushed message. 287 # [OpenID Connect 288 # token](https://developers.google.com/identity/protocols/OpenIDConnect). 289 "audience": "A String", # Audience to be used when generating OIDC token. The audience claim 290 # identifies the recipients that the JWT is intended for. The audience 291 # value is a single case-sensitive string. Having multiple values (array) 292 # for the audience field is not supported. More info about the OIDC JWT 293 # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 294 # Note: if not specified, the Push endpoint URL will be used. 295 "serviceAccountEmail": "A String", # [Service account 296 # email](https://cloud.google.com/iam/docs/service-accounts) 297 # to be used for generating the OIDC token. The caller (for 298 # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must 299 # have the iam.serviceAccounts.actAs permission for the service account. 300 }, 301 "attributes": { # Endpoint configuration attributes. 302 # 303 # Every endpoint has a set of API supported attributes that can be used to 304 # control different aspects of the message delivery. 305 # 306 # The currently supported attribute is `x-goog-version`, which you can 307 # use to change the format of the push message. This attribute 308 # indicates the version of the data expected by the endpoint. This 309 # controls the shape of the envelope (i.e. its fields and metadata). 310 # The endpoint version is based on the version of the Pub/Sub 311 # API. 312 # 313 # If not present during the `CreateSubscription` call, it will default to 314 # the version of the API used to make such call. If not present during a 315 # `ModifyPushConfig` call, its value will not be changed. `GetSubscription` 316 # calls will always return a valid version, even if the subscription was 317 # created without this attribute. 318 # 319 # The possible values for this attribute are: 320 # 321 # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. 322 # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. 323 "a_key": "A String", 324 }, 325 "pushEndpoint": "A String", # A URL locating the endpoint to which messages should be pushed. 326 # For example, a Webhook endpoint might use "https://example.com/push". 327 }, 328 "name": "A String", # The name of the subscription. It must have the format 329 # `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must 330 # start with a letter, and contain only letters (`[A-Za-z]`), numbers 331 # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), 332 # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters 333 # in length, and it must not start with `"goog"`. 334 }</pre> 335</div> 336 337<div class="method"> 338 <code class="details" id="delete">delete(subscription, x__xgafv=None)</code> 339 <pre>Deletes an existing subscription. All pending messages in the subscription 340are immediately dropped. Calls to `Pull` after deletion will return 341`NOT_FOUND`. After a subscription is deleted, a new one may be created with 342the same name, but the new one has no association with the old 343subscription, or its topic unless the same topic is specified. 344 345Args: 346 subscription: string, The subscription to delete. (required) 347 x__xgafv: string, V1 error format. 348 Allowed values 349 1 - v1 error format 350 2 - v2 error format 351 352Returns: 353 An object of the form: 354 355 { # A generic empty message that you can re-use to avoid defining duplicated 356 # empty messages in your APIs. A typical example is to use it as the request 357 # or the response type of an API method. For instance: 358 # 359 # service Foo { 360 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 361 # } 362 # 363 # The JSON representation for `Empty` is empty JSON object `{}`. 364 }</pre> 365</div> 366 367<div class="method"> 368 <code class="details" id="get">get(subscription, x__xgafv=None)</code> 369 <pre>Gets the configuration details of a subscription. 370 371Args: 372 subscription: string, The name of the subscription to get. (required) 373 x__xgafv: string, V1 error format. 374 Allowed values 375 1 - v1 error format 376 2 - v2 error format 377 378Returns: 379 An object of the form: 380 381 { # A subscription resource. 382 "ackDeadlineSeconds": 42, # This value is the maximum time after a subscriber receives a message 383 # before the subscriber should acknowledge the message. After message 384 # delivery but before the ack deadline expires and before the message is 385 # acknowledged, it is an outstanding message and will not be delivered 386 # again during that time (on a best-effort basis). 387 # 388 # For pull subscriptions, this value is used as the initial value for the ack 389 # deadline. To override this value for a given message, call 390 # `ModifyAckDeadline` with the corresponding `ack_id` if using pull. 391 # The maximum custom deadline you can specify is 600 seconds (10 minutes). 392 # 393 # For push delivery, this value is also used to set the request timeout for 394 # the call to the push endpoint. 395 # 396 # If the subscriber never acknowledges the message, the Pub/Sub 397 # system will eventually redeliver the message. 398 # 399 # If this parameter is 0, a default value of 10 seconds is used. 400 "topic": "A String", # The name of the topic from which this subscription is receiving messages. 401 # The value of this field will be `_deleted-topic_` if the topic has been 402 # deleted. 403 "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is 404 # used to configure it. An empty `pushConfig` signifies that the subscriber 405 # will pull and ack messages using API methods. 406 "oidcToken": { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an 407 # `Authorization` header in the HTTP request for every pushed message. 408 # [OpenID Connect 409 # token](https://developers.google.com/identity/protocols/OpenIDConnect). 410 "audience": "A String", # Audience to be used when generating OIDC token. The audience claim 411 # identifies the recipients that the JWT is intended for. The audience 412 # value is a single case-sensitive string. Having multiple values (array) 413 # for the audience field is not supported. More info about the OIDC JWT 414 # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 415 # Note: if not specified, the Push endpoint URL will be used. 416 "serviceAccountEmail": "A String", # [Service account 417 # email](https://cloud.google.com/iam/docs/service-accounts) 418 # to be used for generating the OIDC token. The caller (for 419 # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must 420 # have the iam.serviceAccounts.actAs permission for the service account. 421 }, 422 "attributes": { # Endpoint configuration attributes. 423 # 424 # Every endpoint has a set of API supported attributes that can be used to 425 # control different aspects of the message delivery. 426 # 427 # The currently supported attribute is `x-goog-version`, which you can 428 # use to change the format of the push message. This attribute 429 # indicates the version of the data expected by the endpoint. This 430 # controls the shape of the envelope (i.e. its fields and metadata). 431 # The endpoint version is based on the version of the Pub/Sub 432 # API. 433 # 434 # If not present during the `CreateSubscription` call, it will default to 435 # the version of the API used to make such call. If not present during a 436 # `ModifyPushConfig` call, its value will not be changed. `GetSubscription` 437 # calls will always return a valid version, even if the subscription was 438 # created without this attribute. 439 # 440 # The possible values for this attribute are: 441 # 442 # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. 443 # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. 444 "a_key": "A String", 445 }, 446 "pushEndpoint": "A String", # A URL locating the endpoint to which messages should be pushed. 447 # For example, a Webhook endpoint might use "https://example.com/push". 448 }, 449 "name": "A String", # The name of the subscription. It must have the format 450 # `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must 451 # start with a letter, and contain only letters (`[A-Za-z]`), numbers 452 # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), 453 # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters 454 # in length, and it must not start with `"goog"`. 455 }</pre> 456</div> 457 458<div class="method"> 459 <code class="details" id="getIamPolicy">getIamPolicy(resource, x__xgafv=None)</code> 460 <pre>Gets the access control policy for a resource. 461Returns an empty policy if the resource exists and does not have a policy 462set. 463 464Args: 465 resource: string, REQUIRED: The resource for which the policy is being requested. 466See the operation documentation for the appropriate value for this field. (required) 467 x__xgafv: string, V1 error format. 468 Allowed values 469 1 - v1 error format 470 2 - v2 error format 471 472Returns: 473 An object of the form: 474 475 { # Defines an Identity and Access Management (IAM) policy. It is used to 476 # specify access control policies for Cloud Platform resources. 477 # 478 # 479 # A `Policy` consists of a list of `bindings`. A `binding` binds a list of 480 # `members` to a `role`, where the members can be user accounts, Google groups, 481 # Google domains, and service accounts. A `role` is a named list of permissions 482 # defined by IAM. 483 # 484 # **JSON Example** 485 # 486 # { 487 # "bindings": [ 488 # { 489 # "role": "roles/owner", 490 # "members": [ 491 # "user:mike@example.com", 492 # "group:admins@example.com", 493 # "domain:google.com", 494 # "serviceAccount:my-other-app@appspot.gserviceaccount.com" 495 # ] 496 # }, 497 # { 498 # "role": "roles/viewer", 499 # "members": ["user:sean@example.com"] 500 # } 501 # ] 502 # } 503 # 504 # **YAML Example** 505 # 506 # bindings: 507 # - members: 508 # - user:mike@example.com 509 # - group:admins@example.com 510 # - domain:google.com 511 # - serviceAccount:my-other-app@appspot.gserviceaccount.com 512 # role: roles/owner 513 # - members: 514 # - user:sean@example.com 515 # role: roles/viewer 516 # 517 # 518 # For a description of IAM and its features, see the 519 # [IAM developer's guide](https://cloud.google.com/iam/docs). 520 "bindings": [ # Associates a list of `members` to a `role`. 521 # `bindings` with no members will result in an error. 522 { # Associates `members` with a `role`. 523 "role": "A String", # Role that is assigned to `members`. 524 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 525 "condition": { # Represents an expression text. Example: # The condition that is associated with this binding. 526 # NOTE: An unsatisfied condition will not allow user access via current 527 # binding. Different bindings, including their conditions, are examined 528 # independently. 529 # 530 # title: "User account presence" 531 # description: "Determines whether the request has a user account" 532 # expression: "size(request.user) > 0" 533 "description": "A String", # An optional description of the expression. This is a longer text which 534 # describes the expression, e.g. when hovered over it in a UI. 535 "expression": "A String", # Textual representation of an expression in 536 # Common Expression Language syntax. 537 # 538 # The application context of the containing message determines which 539 # well-known feature set of CEL is supported. 540 "location": "A String", # An optional string indicating the location of the expression for error 541 # reporting, e.g. a file name and a position in the file. 542 "title": "A String", # An optional title for the expression, i.e. a short string describing 543 # its purpose. This can be used e.g. in UIs which allow to enter the 544 # expression. 545 }, 546 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. 547 # `members` can have the following values: 548 # 549 # * `allUsers`: A special identifier that represents anyone who is 550 # on the internet; with or without a Google account. 551 # 552 # * `allAuthenticatedUsers`: A special identifier that represents anyone 553 # who is authenticated with a Google account or a service account. 554 # 555 # * `user:{emailid}`: An email address that represents a specific Google 556 # account. For example, `alice@gmail.com` . 557 # 558 # 559 # * `serviceAccount:{emailid}`: An email address that represents a service 560 # account. For example, `my-other-app@appspot.gserviceaccount.com`. 561 # 562 # * `group:{emailid}`: An email address that represents a Google group. 563 # For example, `admins@example.com`. 564 # 565 # 566 # * `domain:{domain}`: The G Suite domain (primary) that represents all the 567 # users of that domain. For example, `google.com` or `example.com`. 568 # 569 "A String", 570 ], 571 }, 572 ], 573 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help 574 # prevent simultaneous updates of a policy from overwriting each other. 575 # It is strongly suggested that systems make use of the `etag` in the 576 # read-modify-write cycle to perform policy updates in order to avoid race 577 # conditions: An `etag` is returned in the response to `getIamPolicy`, and 578 # systems are expected to put that etag in the request to `setIamPolicy` to 579 # ensure that their change will be applied to the same version of the policy. 580 # 581 # If no `etag` is provided in the call to `setIamPolicy`, then the existing 582 # policy is overwritten blindly. 583 "version": 42, # Deprecated. 584 }</pre> 585</div> 586 587<div class="method"> 588 <code class="details" id="list">list(project, pageSize=None, pageToken=None, x__xgafv=None)</code> 589 <pre>Lists matching subscriptions. 590 591Args: 592 project: string, The name of the cloud project that subscriptions belong to. (required) 593 pageSize: integer, Maximum number of subscriptions to return. 594 pageToken: string, The value returned by the last `ListSubscriptionsResponse`; indicates that 595this is a continuation of a prior `ListSubscriptions` call, and that the 596system should return the next page of data. 597 x__xgafv: string, V1 error format. 598 Allowed values 599 1 - v1 error format 600 2 - v2 error format 601 602Returns: 603 An object of the form: 604 605 { # Response for the `ListSubscriptions` method. 606 "nextPageToken": "A String", # If not empty, indicates that there may be more subscriptions that match 607 # the request; this value should be passed in a new 608 # `ListSubscriptionsRequest` to get more subscriptions. 609 "subscriptions": [ # The subscriptions that match the request. 610 { # A subscription resource. 611 "ackDeadlineSeconds": 42, # This value is the maximum time after a subscriber receives a message 612 # before the subscriber should acknowledge the message. After message 613 # delivery but before the ack deadline expires and before the message is 614 # acknowledged, it is an outstanding message and will not be delivered 615 # again during that time (on a best-effort basis). 616 # 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 pull. 620 # The maximum custom deadline you can specify is 600 seconds (10 minutes). 621 # 622 # For push delivery, this value is also used to set the request timeout for 623 # the call to the push endpoint. 624 # 625 # If the subscriber never acknowledges the message, the Pub/Sub 626 # system will eventually redeliver the message. 627 # 628 # If this parameter is 0, a default value of 10 seconds is used. 629 "topic": "A String", # The name of the topic from which this subscription is receiving messages. 630 # The value of this field will be `_deleted-topic_` if the topic has been 631 # deleted. 632 "pushConfig": { # Configuration for a push delivery endpoint. # If push delivery is used with this subscription, this field is 633 # used to configure it. An empty `pushConfig` signifies that the subscriber 634 # will pull and ack messages using API methods. 635 "oidcToken": { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an 636 # `Authorization` header in the HTTP request for every pushed message. 637 # [OpenID Connect 638 # token](https://developers.google.com/identity/protocols/OpenIDConnect). 639 "audience": "A String", # Audience to be used when generating OIDC token. The audience claim 640 # identifies the recipients that the JWT is intended for. The audience 641 # value is a single case-sensitive string. Having multiple values (array) 642 # for the audience field is not supported. More info about the OIDC JWT 643 # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 644 # Note: if not specified, the Push endpoint URL will be used. 645 "serviceAccountEmail": "A String", # [Service account 646 # email](https://cloud.google.com/iam/docs/service-accounts) 647 # to be used for generating the OIDC token. The caller (for 648 # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must 649 # have the iam.serviceAccounts.actAs permission for the service account. 650 }, 651 "attributes": { # Endpoint configuration attributes. 652 # 653 # Every endpoint has a set of API supported attributes that can be used to 654 # control different aspects of the message delivery. 655 # 656 # The currently supported attribute is `x-goog-version`, which you can 657 # use to change the format of the push message. This attribute 658 # indicates the version of the data expected by the endpoint. This 659 # controls the shape of the envelope (i.e. its fields and metadata). 660 # The endpoint version is based on the version of the Pub/Sub 661 # API. 662 # 663 # If not present during the `CreateSubscription` call, it will default to 664 # the version of the API used to make such call. If not present during a 665 # `ModifyPushConfig` call, its value will not be changed. `GetSubscription` 666 # calls will always return a valid version, even if the subscription was 667 # created without this attribute. 668 # 669 # The possible values for this attribute are: 670 # 671 # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. 672 # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. 673 "a_key": "A String", 674 }, 675 "pushEndpoint": "A String", # A URL locating the endpoint to which messages should be pushed. 676 # For example, a Webhook endpoint might use "https://example.com/push". 677 }, 678 "name": "A String", # The name of the subscription. It must have the format 679 # `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must 680 # start with a letter, and contain only letters (`[A-Za-z]`), numbers 681 # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), 682 # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters 683 # in length, and it must not start with `"goog"`. 684 }, 685 ], 686 }</pre> 687</div> 688 689<div class="method"> 690 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 691 <pre>Retrieves the next page of results. 692 693Args: 694 previous_request: The request for the previous page. (required) 695 previous_response: The response from the request for the previous page. (required) 696 697Returns: 698 A request object that you can call 'execute()' on to request the next 699 page. Returns None if there are no more items in the collection. 700 </pre> 701</div> 702 703<div class="method"> 704 <code class="details" id="modifyAckDeadline">modifyAckDeadline(subscription, body, x__xgafv=None)</code> 705 <pre>Modifies the ack deadline for a specific message. This method is useful 706to indicate that more time is needed to process a message by the 707subscriber, or to make the message available for redelivery if the 708processing was interrupted. Note that this does not modify the 709subscription-level `ackDeadlineSeconds` used for subsequent messages. 710 711Args: 712 subscription: string, The name of the subscription. (required) 713 body: object, The request body. (required) 714 The object takes the form of: 715 716{ # Request for the ModifyAckDeadline method. 717 "ackDeadlineSeconds": 42, # The new ack deadline with respect to the time this request was sent to 718 # the Pub/Sub system. Must be >= 0. For example, if the value is 10, the new 719 # ack deadline will expire 10 seconds after the `ModifyAckDeadline` call 720 # was made. Specifying zero may immediately make the message available for 721 # another pull request. 722 "ackId": "A String", # The acknowledgment ID. Either this or ack_ids must be populated, but not 723 # both. 724 "ackIds": [ # List of acknowledgment IDs. 725 "A String", 726 ], 727 } 728 729 x__xgafv: string, V1 error format. 730 Allowed values 731 1 - v1 error format 732 2 - v2 error format 733 734Returns: 735 An object of the form: 736 737 { # A generic empty message that you can re-use to avoid defining duplicated 738 # empty messages in your APIs. A typical example is to use it as the request 739 # or the response type of an API method. For instance: 740 # 741 # service Foo { 742 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 743 # } 744 # 745 # The JSON representation for `Empty` is empty JSON object `{}`. 746 }</pre> 747</div> 748 749<div class="method"> 750 <code class="details" id="modifyPushConfig">modifyPushConfig(subscription, body, x__xgafv=None)</code> 751 <pre>Modifies the `PushConfig` for a specified subscription. 752 753This may be used to change a push subscription to a pull one (signified by 754an empty `PushConfig`) or vice versa, or change the endpoint URL and other 755attributes of a push subscription. Messages will accumulate for delivery 756continuously through the call regardless of changes to the `PushConfig`. 757 758Args: 759 subscription: string, The name of the subscription. (required) 760 body: object, The request body. (required) 761 The object takes the form of: 762 763{ # Request for the ModifyPushConfig method. 764 "pushConfig": { # Configuration for a push delivery endpoint. # The push configuration for future deliveries. 765 # 766 # An empty `pushConfig` indicates that the Pub/Sub system should 767 # stop pushing messages from the given subscription and allow 768 # messages to be pulled and acknowledged - effectively pausing 769 # the subscription if `Pull` is not called. 770 "oidcToken": { # Contains information needed for generating an # If specified, Pub/Sub will generate and attach an OIDC JWT token as an 771 # `Authorization` header in the HTTP request for every pushed message. 772 # [OpenID Connect 773 # token](https://developers.google.com/identity/protocols/OpenIDConnect). 774 "audience": "A String", # Audience to be used when generating OIDC token. The audience claim 775 # identifies the recipients that the JWT is intended for. The audience 776 # value is a single case-sensitive string. Having multiple values (array) 777 # for the audience field is not supported. More info about the OIDC JWT 778 # token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 779 # Note: if not specified, the Push endpoint URL will be used. 780 "serviceAccountEmail": "A String", # [Service account 781 # email](https://cloud.google.com/iam/docs/service-accounts) 782 # to be used for generating the OIDC token. The caller (for 783 # CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must 784 # have the iam.serviceAccounts.actAs permission for the service account. 785 }, 786 "attributes": { # Endpoint configuration attributes. 787 # 788 # Every endpoint has a set of API supported attributes that can be used to 789 # control different aspects of the message delivery. 790 # 791 # The currently supported attribute is `x-goog-version`, which you can 792 # use to change the format of the push message. This attribute 793 # indicates the version of the data expected by the endpoint. This 794 # controls the shape of the envelope (i.e. its fields and metadata). 795 # The endpoint version is based on the version of the Pub/Sub 796 # API. 797 # 798 # If not present during the `CreateSubscription` call, it will default to 799 # the version of the API used to make such call. If not present during a 800 # `ModifyPushConfig` call, its value will not be changed. `GetSubscription` 801 # calls will always return a valid version, even if the subscription was 802 # created without this attribute. 803 # 804 # The possible values for this attribute are: 805 # 806 # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. 807 # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. 808 "a_key": "A String", 809 }, 810 "pushEndpoint": "A String", # A URL locating the endpoint to which messages should be pushed. 811 # For example, a Webhook endpoint might use "https://example.com/push". 812 }, 813 } 814 815 x__xgafv: string, V1 error format. 816 Allowed values 817 1 - v1 error format 818 2 - v2 error format 819 820Returns: 821 An object of the form: 822 823 { # A generic empty message that you can re-use to avoid defining duplicated 824 # empty messages in your APIs. A typical example is to use it as the request 825 # or the response type of an API method. For instance: 826 # 827 # service Foo { 828 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 829 # } 830 # 831 # The JSON representation for `Empty` is empty JSON object `{}`. 832 }</pre> 833</div> 834 835<div class="method"> 836 <code class="details" id="pull">pull(subscription, body, x__xgafv=None)</code> 837 <pre>Pulls messages from the server. Returns an empty list if there are no 838messages available in the backlog. The server may return `UNAVAILABLE` if 839there are too many concurrent pull requests pending for the given 840subscription. 841 842Args: 843 subscription: string, The subscription from which messages should be pulled. (required) 844 body: object, The request body. (required) 845 The object takes the form of: 846 847{ # Request for the `Pull` method. 848 "returnImmediately": True or False, # If this is specified as true the system will respond immediately even if 849 # it is not able to return a message in the `Pull` response. Otherwise the 850 # system is allowed to wait until at least one message is available rather 851 # than returning no messages. The client may cancel the request if it does 852 # not wish to wait any longer for the response. 853 "maxMessages": 42, # The maximum number of messages returned for this request. The Pub/Sub 854 # system may return fewer than the number specified. 855 } 856 857 x__xgafv: string, V1 error format. 858 Allowed values 859 1 - v1 error format 860 2 - v2 error format 861 862Returns: 863 An object of the form: 864 865 { # Response for the `Pull` method. 866 "receivedMessages": [ # Received Pub/Sub messages. The Pub/Sub system will return zero messages if 867 # there are no more available in the backlog. The Pub/Sub system may return 868 # fewer than the `maxMessages` requested even if there are more messages 869 # available in the backlog. 870 { # A message and its corresponding acknowledgment ID. 871 "ackId": "A String", # This ID can be used to acknowledge the received message. 872 "message": { # A message data and its attributes. The message payload must not be empty; # The message. 873 # it must contain either a non-empty data field, or at least one attribute. 874 "attributes": { # Optional attributes for this message. 875 "a_key": "A String", 876 }, 877 "data": "A String", # The message payload. For JSON requests, the value of this field must be 878 # [base64-encoded](https://tools.ietf.org/html/rfc4648). 879 "publishTime": "A String", # The time at which the message was published, populated by the server when 880 # it receives the `Publish` call. It must not be populated by the 881 # publisher in a `Publish` call. 882 "messageId": "A String", # ID of this message, assigned by the server when the message is published. 883 # Guaranteed to be unique within the topic. This value may be read by a 884 # subscriber that receives a `PubsubMessage` via a `Pull` call or a push 885 # delivery. It must not be populated by the publisher in a `Publish` call. 886 }, 887 }, 888 ], 889 }</pre> 890</div> 891 892<div class="method"> 893 <code class="details" id="setIamPolicy">setIamPolicy(resource, body, x__xgafv=None)</code> 894 <pre>Sets the access control policy on the specified resource. Replaces any 895existing policy. 896 897Args: 898 resource: string, REQUIRED: The resource for which the policy is being specified. 899See the operation documentation for the appropriate value for this field. (required) 900 body: object, The request body. (required) 901 The object takes the form of: 902 903{ # Request message for `SetIamPolicy` method. 904 "policy": { # Defines an Identity and Access Management (IAM) policy. It is used to # REQUIRED: The complete policy to be applied to the `resource`. The size of 905 # the policy is limited to a few 10s of KB. An empty policy is a 906 # valid policy but certain Cloud Platform services (such as Projects) 907 # might reject them. 908 # specify access control policies for Cloud Platform resources. 909 # 910 # 911 # A `Policy` consists of a list of `bindings`. A `binding` binds a list of 912 # `members` to a `role`, where the members can be user accounts, Google groups, 913 # Google domains, and service accounts. A `role` is a named list of permissions 914 # defined by IAM. 915 # 916 # **JSON Example** 917 # 918 # { 919 # "bindings": [ 920 # { 921 # "role": "roles/owner", 922 # "members": [ 923 # "user:mike@example.com", 924 # "group:admins@example.com", 925 # "domain:google.com", 926 # "serviceAccount:my-other-app@appspot.gserviceaccount.com" 927 # ] 928 # }, 929 # { 930 # "role": "roles/viewer", 931 # "members": ["user:sean@example.com"] 932 # } 933 # ] 934 # } 935 # 936 # **YAML Example** 937 # 938 # bindings: 939 # - members: 940 # - user:mike@example.com 941 # - group:admins@example.com 942 # - domain:google.com 943 # - serviceAccount:my-other-app@appspot.gserviceaccount.com 944 # role: roles/owner 945 # - members: 946 # - user:sean@example.com 947 # role: roles/viewer 948 # 949 # 950 # For a description of IAM and its features, see the 951 # [IAM developer's guide](https://cloud.google.com/iam/docs). 952 "bindings": [ # Associates a list of `members` to a `role`. 953 # `bindings` with no members will result in an error. 954 { # Associates `members` with a `role`. 955 "role": "A String", # Role that is assigned to `members`. 956 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 957 "condition": { # Represents an expression text. Example: # The condition that is associated with this binding. 958 # NOTE: An unsatisfied condition will not allow user access via current 959 # binding. Different bindings, including their conditions, are examined 960 # independently. 961 # 962 # title: "User account presence" 963 # description: "Determines whether the request has a user account" 964 # expression: "size(request.user) > 0" 965 "description": "A String", # An optional description of the expression. This is a longer text which 966 # describes the expression, e.g. when hovered over it in a UI. 967 "expression": "A String", # Textual representation of an expression in 968 # Common Expression Language syntax. 969 # 970 # The application context of the containing message determines which 971 # well-known feature set of CEL is supported. 972 "location": "A String", # An optional string indicating the location of the expression for error 973 # reporting, e.g. a file name and a position in the file. 974 "title": "A String", # An optional title for the expression, i.e. a short string describing 975 # its purpose. This can be used e.g. in UIs which allow to enter the 976 # expression. 977 }, 978 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. 979 # `members` can have the following values: 980 # 981 # * `allUsers`: A special identifier that represents anyone who is 982 # on the internet; with or without a Google account. 983 # 984 # * `allAuthenticatedUsers`: A special identifier that represents anyone 985 # who is authenticated with a Google account or a service account. 986 # 987 # * `user:{emailid}`: An email address that represents a specific Google 988 # account. For example, `alice@gmail.com` . 989 # 990 # 991 # * `serviceAccount:{emailid}`: An email address that represents a service 992 # account. For example, `my-other-app@appspot.gserviceaccount.com`. 993 # 994 # * `group:{emailid}`: An email address that represents a Google group. 995 # For example, `admins@example.com`. 996 # 997 # 998 # * `domain:{domain}`: The G Suite domain (primary) that represents all the 999 # users of that domain. For example, `google.com` or `example.com`. 1000 # 1001 "A String", 1002 ], 1003 }, 1004 ], 1005 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help 1006 # prevent simultaneous updates of a policy from overwriting each other. 1007 # It is strongly suggested that systems make use of the `etag` in the 1008 # read-modify-write cycle to perform policy updates in order to avoid race 1009 # conditions: An `etag` is returned in the response to `getIamPolicy`, and 1010 # systems are expected to put that etag in the request to `setIamPolicy` to 1011 # ensure that their change will be applied to the same version of the policy. 1012 # 1013 # If no `etag` is provided in the call to `setIamPolicy`, then the existing 1014 # policy is overwritten blindly. 1015 "version": 42, # Deprecated. 1016 }, 1017 } 1018 1019 x__xgafv: string, V1 error format. 1020 Allowed values 1021 1 - v1 error format 1022 2 - v2 error format 1023 1024Returns: 1025 An object of the form: 1026 1027 { # Defines an Identity and Access Management (IAM) policy. It is used to 1028 # specify access control policies for Cloud Platform resources. 1029 # 1030 # 1031 # A `Policy` consists of a list of `bindings`. A `binding` binds a list of 1032 # `members` to a `role`, where the members can be user accounts, Google groups, 1033 # Google domains, and service accounts. A `role` is a named list of permissions 1034 # defined by IAM. 1035 # 1036 # **JSON Example** 1037 # 1038 # { 1039 # "bindings": [ 1040 # { 1041 # "role": "roles/owner", 1042 # "members": [ 1043 # "user:mike@example.com", 1044 # "group:admins@example.com", 1045 # "domain:google.com", 1046 # "serviceAccount:my-other-app@appspot.gserviceaccount.com" 1047 # ] 1048 # }, 1049 # { 1050 # "role": "roles/viewer", 1051 # "members": ["user:sean@example.com"] 1052 # } 1053 # ] 1054 # } 1055 # 1056 # **YAML Example** 1057 # 1058 # bindings: 1059 # - members: 1060 # - user:mike@example.com 1061 # - group:admins@example.com 1062 # - domain:google.com 1063 # - serviceAccount:my-other-app@appspot.gserviceaccount.com 1064 # role: roles/owner 1065 # - members: 1066 # - user:sean@example.com 1067 # role: roles/viewer 1068 # 1069 # 1070 # For a description of IAM and its features, see the 1071 # [IAM developer's guide](https://cloud.google.com/iam/docs). 1072 "bindings": [ # Associates a list of `members` to a `role`. 1073 # `bindings` with no members will result in an error. 1074 { # Associates `members` with a `role`. 1075 "role": "A String", # Role that is assigned to `members`. 1076 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 1077 "condition": { # Represents an expression text. Example: # The condition that is associated with this binding. 1078 # NOTE: An unsatisfied condition will not allow user access via current 1079 # binding. Different bindings, including their conditions, are examined 1080 # independently. 1081 # 1082 # title: "User account presence" 1083 # description: "Determines whether the request has a user account" 1084 # expression: "size(request.user) > 0" 1085 "description": "A String", # An optional description of the expression. This is a longer text which 1086 # describes the expression, e.g. when hovered over it in a UI. 1087 "expression": "A String", # Textual representation of an expression in 1088 # Common Expression Language syntax. 1089 # 1090 # The application context of the containing message determines which 1091 # well-known feature set of CEL is supported. 1092 "location": "A String", # An optional string indicating the location of the expression for error 1093 # reporting, e.g. a file name and a position in the file. 1094 "title": "A String", # An optional title for the expression, i.e. a short string describing 1095 # its purpose. This can be used e.g. in UIs which allow to enter the 1096 # expression. 1097 }, 1098 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. 1099 # `members` can have the following values: 1100 # 1101 # * `allUsers`: A special identifier that represents anyone who is 1102 # on the internet; with or without a Google account. 1103 # 1104 # * `allAuthenticatedUsers`: A special identifier that represents anyone 1105 # who is authenticated with a Google account or a service account. 1106 # 1107 # * `user:{emailid}`: An email address that represents a specific Google 1108 # account. For example, `alice@gmail.com` . 1109 # 1110 # 1111 # * `serviceAccount:{emailid}`: An email address that represents a service 1112 # account. For example, `my-other-app@appspot.gserviceaccount.com`. 1113 # 1114 # * `group:{emailid}`: An email address that represents a Google group. 1115 # For example, `admins@example.com`. 1116 # 1117 # 1118 # * `domain:{domain}`: The G Suite domain (primary) that represents all the 1119 # users of that domain. For example, `google.com` or `example.com`. 1120 # 1121 "A String", 1122 ], 1123 }, 1124 ], 1125 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help 1126 # prevent simultaneous updates of a policy from overwriting each other. 1127 # It is strongly suggested that systems make use of the `etag` in the 1128 # read-modify-write cycle to perform policy updates in order to avoid race 1129 # conditions: An `etag` is returned in the response to `getIamPolicy`, and 1130 # systems are expected to put that etag in the request to `setIamPolicy` to 1131 # ensure that their change will be applied to the same version of the policy. 1132 # 1133 # If no `etag` is provided in the call to `setIamPolicy`, then the existing 1134 # policy is overwritten blindly. 1135 "version": 42, # Deprecated. 1136 }</pre> 1137</div> 1138 1139<div class="method"> 1140 <code class="details" id="testIamPermissions">testIamPermissions(resource, body, x__xgafv=None)</code> 1141 <pre>Returns permissions that a caller has on the specified resource. 1142If the resource does not exist, this will return an empty set of 1143permissions, not a NOT_FOUND error. 1144 1145Note: This operation is designed to be used for building permission-aware 1146UIs and command-line tools, not for authorization checking. This operation 1147may "fail open" without warning. 1148 1149Args: 1150 resource: string, REQUIRED: The resource for which the policy detail is being requested. 1151See the operation documentation for the appropriate value for this field. (required) 1152 body: object, The request body. (required) 1153 The object takes the form of: 1154 1155{ # Request message for `TestIamPermissions` method. 1156 "permissions": [ # The set of permissions to check for the `resource`. Permissions with 1157 # wildcards (such as '*' or 'storage.*') are not allowed. For more 1158 # information see 1159 # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). 1160 "A String", 1161 ], 1162 } 1163 1164 x__xgafv: string, V1 error format. 1165 Allowed values 1166 1 - v1 error format 1167 2 - v2 error format 1168 1169Returns: 1170 An object of the form: 1171 1172 { # Response message for `TestIamPermissions` method. 1173 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is 1174 # allowed. 1175 "A String", 1176 ], 1177 }</pre> 1178</div> 1179 1180</body></html>