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 75 <h1><a href="pubsub_v1beta2.html">Google Cloud Pub/Sub API</a> . <a href="pubsub_v1beta2.projects.html">projects</a> . <a href="pubsub_v1beta2.projects.topics.html">topics</a></h1> 76 <h2>Instance Methods</h2> 77 <p class="toc_element"> 78 <code><a href="pubsub_v1beta2.projects.topics.subscriptions.html">subscriptions()</a></code> 79 </p> 80 <p class="firstline">Returns the subscriptions Resource.</p> 81 82 <p class="toc_element"> 83 <code><a href="#create">create(name, body, x__xgafv=None)</a></code></p> 84 <p class="firstline">Creates the given topic with the given name.</p> 85 <p class="toc_element"> 86 <code><a href="#delete">delete(topic, x__xgafv=None)</a></code></p> 87 <p class="firstline">Deletes the topic with the given name. Returns `NOT_FOUND` if the topic</p> 88 <p class="toc_element"> 89 <code><a href="#get">get(topic, x__xgafv=None)</a></code></p> 90 <p class="firstline">Gets the configuration of a topic.</p> 91 <p class="toc_element"> 92 <code><a href="#getIamPolicy">getIamPolicy(resource, x__xgafv=None)</a></code></p> 93 <p class="firstline">Gets the access control policy for a resource.</p> 94 <p class="toc_element"> 95 <code><a href="#list">list(project, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p> 96 <p class="firstline">Lists matching topics.</p> 97 <p class="toc_element"> 98 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 99 <p class="firstline">Retrieves the next page of results.</p> 100 <p class="toc_element"> 101 <code><a href="#publish">publish(topic, body, x__xgafv=None)</a></code></p> 102 <p class="firstline">Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic</p> 103 <p class="toc_element"> 104 <code><a href="#setIamPolicy">setIamPolicy(resource, body, x__xgafv=None)</a></code></p> 105 <p class="firstline">Sets the access control policy on the specified resource. Replaces any</p> 106 <p class="toc_element"> 107 <code><a href="#testIamPermissions">testIamPermissions(resource, body, x__xgafv=None)</a></code></p> 108 <p class="firstline">Returns permissions that a caller has on the specified resource.</p> 109 <h3>Method Details</h3> 110 <div class="method"> 111 <code class="details" id="create">create(name, body, x__xgafv=None)</code> 112 <pre>Creates the given topic with the given name. 113 114 Args: 115 name: string, The name of the topic. It must have the format 116 `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, 117 and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), 118 underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent 119 signs (`%`). It must be between 3 and 255 characters in length, and it 120 must not start with `"goog"`. (required) 121 body: object, The request body. (required) 122 The object takes the form of: 123 124 { # A topic resource. 125 "name": "A String", # The name of the topic. It must have the format 126 # `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, 127 # and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), 128 # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent 129 # signs (`%`). It must be between 3 and 255 characters in length, and it 130 # must not start with `"goog"`. 131 } 132 133 x__xgafv: string, V1 error format. 134 Allowed values 135 1 - v1 error format 136 2 - v2 error format 137 138 Returns: 139 An object of the form: 140 141 { # A topic resource. 142 "name": "A String", # The name of the topic. It must have the format 143 # `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, 144 # and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), 145 # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent 146 # signs (`%`). It must be between 3 and 255 characters in length, and it 147 # must not start with `"goog"`. 148 }</pre> 149 </div> 150 151 <div class="method"> 152 <code class="details" id="delete">delete(topic, x__xgafv=None)</code> 153 <pre>Deletes the topic with the given name. Returns `NOT_FOUND` if the topic 154 does not exist. After a topic is deleted, a new topic may be created with 155 the same name; this is an entirely new topic with none of the old 156 configuration or subscriptions. Existing subscriptions to this topic are 157 not deleted, but their `topic` field is set to `_deleted-topic_`. 158 159 Args: 160 topic: string, Name of the topic to delete. (required) 161 x__xgafv: string, V1 error format. 162 Allowed values 163 1 - v1 error format 164 2 - v2 error format 165 166 Returns: 167 An object of the form: 168 169 { # A generic empty message that you can re-use to avoid defining duplicated 170 # empty messages in your APIs. A typical example is to use it as the request 171 # or the response type of an API method. For instance: 172 # 173 # service Foo { 174 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 175 # } 176 # 177 # The JSON representation for `Empty` is empty JSON object `{}`. 178 }</pre> 179 </div> 180 181 <div class="method"> 182 <code class="details" id="get">get(topic, x__xgafv=None)</code> 183 <pre>Gets the configuration of a topic. 184 185 Args: 186 topic: string, The name of the topic to get. (required) 187 x__xgafv: string, V1 error format. 188 Allowed values 189 1 - v1 error format 190 2 - v2 error format 191 192 Returns: 193 An object of the form: 194 195 { # A topic resource. 196 "name": "A String", # The name of the topic. It must have the format 197 # `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, 198 # and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), 199 # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent 200 # signs (`%`). It must be between 3 and 255 characters in length, and it 201 # must not start with `"goog"`. 202 }</pre> 203 </div> 204 205 <div class="method"> 206 <code class="details" id="getIamPolicy">getIamPolicy(resource, x__xgafv=None)</code> 207 <pre>Gets the access control policy for a resource. 208 Returns an empty policy if the resource exists and does not have a policy 209 set. 210 211 Args: 212 resource: string, REQUIRED: The resource for which the policy is being requested. 213 See the operation documentation for the appropriate value for this field. (required) 214 x__xgafv: string, V1 error format. 215 Allowed values 216 1 - v1 error format 217 2 - v2 error format 218 219 Returns: 220 An object of the form: 221 222 { # Defines an Identity and Access Management (IAM) policy. It is used to 223 # specify access control policies for Cloud Platform resources. 224 # 225 # 226 # A `Policy` consists of a list of `bindings`. A `Binding` binds a list of 227 # `members` to a `role`, where the members can be user accounts, Google groups, 228 # Google domains, and service accounts. A `role` is a named list of permissions 229 # defined by IAM. 230 # 231 # **Example** 232 # 233 # { 234 # "bindings": [ 235 # { 236 # "role": "roles/owner", 237 # "members": [ 238 # "user:mike (a] example.com", 239 # "group:admins (a] example.com", 240 # "domain:google.com", 241 # "serviceAccount:my-other-app (a] appspot.gserviceaccount.com", 242 # ] 243 # }, 244 # { 245 # "role": "roles/viewer", 246 # "members": ["user:sean (a] example.com"] 247 # } 248 # ] 249 # } 250 # 251 # For a description of IAM and its features, see the 252 # [IAM developer's guide](https://cloud.google.com/iam). 253 "bindings": [ # Associates a list of `members` to a `role`. 254 # Multiple `bindings` must not be specified for the same `role`. 255 # `bindings` with no members will result in an error. 256 { # Associates `members` with a `role`. 257 "role": "A String", # Role that is assigned to `members`. 258 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 259 # Required 260 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. 261 # `members` can have the following values: 262 # 263 # * `allUsers`: A special identifier that represents anyone who is 264 # on the internet; with or without a Google account. 265 # 266 # * `allAuthenticatedUsers`: A special identifier that represents anyone 267 # who is authenticated with a Google account or a service account. 268 # 269 # * `user:{emailid}`: An email address that represents a specific Google 270 # account. For example, `alice (a] gmail.com` or `joe (a] example.com`. 271 # 272 # 273 # * `serviceAccount:{emailid}`: An email address that represents a service 274 # account. For example, `my-other-app (a] appspot.gserviceaccount.com`. 275 # 276 # * `group:{emailid}`: An email address that represents a Google group. 277 # For example, `admins (a] example.com`. 278 # 279 # * `domain:{domain}`: A Google Apps domain name that represents all the 280 # users of that domain. For example, `google.com` or `example.com`. 281 # 282 "A String", 283 ], 284 }, 285 ], 286 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help 287 # prevent simultaneous updates of a policy from overwriting each other. 288 # It is strongly suggested that systems make use of the `etag` in the 289 # read-modify-write cycle to perform policy updates in order to avoid race 290 # conditions: An `etag` is returned in the response to `getIamPolicy`, and 291 # systems are expected to put that etag in the request to `setIamPolicy` to 292 # ensure that their change will be applied to the same version of the policy. 293 # 294 # If no `etag` is provided in the call to `setIamPolicy`, then the existing 295 # policy is overwritten blindly. 296 "version": 42, # Version of the `Policy`. The default version is 0. 297 }</pre> 298 </div> 299 300 <div class="method"> 301 <code class="details" id="list">list(project, pageSize=None, pageToken=None, x__xgafv=None)</code> 302 <pre>Lists matching topics. 303 304 Args: 305 project: string, The name of the cloud project that topics belong to. (required) 306 pageSize: integer, Maximum number of topics to return. 307 pageToken: string, The value returned by the last `ListTopicsResponse`; indicates that this is 308 a continuation of a prior `ListTopics` call, and that the system should 309 return the next page of data. 310 x__xgafv: string, V1 error format. 311 Allowed values 312 1 - v1 error format 313 2 - v2 error format 314 315 Returns: 316 An object of the form: 317 318 { # Response for the `ListTopics` method. 319 "nextPageToken": "A String", # If not empty, indicates that there may be more topics that match the 320 # request; this value should be passed in a new `ListTopicsRequest`. 321 "topics": [ # The resulting topics. 322 { # A topic resource. 323 "name": "A String", # The name of the topic. It must have the format 324 # `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, 325 # and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), 326 # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent 327 # signs (`%`). It must be between 3 and 255 characters in length, and it 328 # must not start with `"goog"`. 329 }, 330 ], 331 }</pre> 332 </div> 333 334 <div class="method"> 335 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 336 <pre>Retrieves the next page of results. 337 338 Args: 339 previous_request: The request for the previous page. (required) 340 previous_response: The response from the request for the previous page. (required) 341 342 Returns: 343 A request object that you can call 'execute()' on to request the next 344 page. Returns None if there are no more items in the collection. 345 </pre> 346 </div> 347 348 <div class="method"> 349 <code class="details" id="publish">publish(topic, body, x__xgafv=None)</code> 350 <pre>Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic 351 does not exist. The message payload must not be empty; it must contain 352 either a non-empty data field, or at least one attribute. 353 354 Args: 355 topic: string, The messages in the request will be published on this topic. (required) 356 body: object, The request body. (required) 357 The object takes the form of: 358 359 { # Request for the Publish method. 360 "messages": [ # The messages to publish. 361 { # A message data and its attributes. The message payload must not be empty; 362 # it must contain either a non-empty data field, or at least one attribute. 363 "attributes": { # Optional attributes for this message. 364 "a_key": "A String", 365 }, 366 "data": "A String", # The message payload. For JSON requests, the value of this field must be 367 # [base64-encoded](https://tools.ietf.org/html/rfc4648). 368 "publishTime": "A String", # The time at which the message was published, populated by the server when 369 # it receives the `Publish` call. It must not be populated by the 370 # publisher in a `Publish` call. 371 "messageId": "A String", # ID of this message, assigned by the server when the message is published. 372 # Guaranteed to be unique within the topic. This value may be read by a 373 # subscriber that receives a `PubsubMessage` via a `Pull` call or a push 374 # delivery. It must not be populated by the publisher in a `Publish` call. 375 }, 376 ], 377 } 378 379 x__xgafv: string, V1 error format. 380 Allowed values 381 1 - v1 error format 382 2 - v2 error format 383 384 Returns: 385 An object of the form: 386 387 { # Response for the `Publish` method. 388 "messageIds": [ # The server-assigned ID of each published message, in the same order as 389 # the messages in the request. IDs are guaranteed to be unique within 390 # the topic. 391 "A String", 392 ], 393 }</pre> 394 </div> 395 396 <div class="method"> 397 <code class="details" id="setIamPolicy">setIamPolicy(resource, body, x__xgafv=None)</code> 398 <pre>Sets the access control policy on the specified resource. Replaces any 399 existing policy. 400 401 Args: 402 resource: string, REQUIRED: The resource for which the policy is being specified. 403 See the operation documentation for the appropriate value for this field. (required) 404 body: object, The request body. (required) 405 The object takes the form of: 406 407 { # Request message for `SetIamPolicy` method. 408 "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 409 # the policy is limited to a few 10s of KB. An empty policy is a 410 # valid policy but certain Cloud Platform services (such as Projects) 411 # might reject them. 412 # specify access control policies for Cloud Platform resources. 413 # 414 # 415 # A `Policy` consists of a list of `bindings`. A `Binding` binds a list of 416 # `members` to a `role`, where the members can be user accounts, Google groups, 417 # Google domains, and service accounts. A `role` is a named list of permissions 418 # defined by IAM. 419 # 420 # **Example** 421 # 422 # { 423 # "bindings": [ 424 # { 425 # "role": "roles/owner", 426 # "members": [ 427 # "user:mike (a] example.com", 428 # "group:admins (a] example.com", 429 # "domain:google.com", 430 # "serviceAccount:my-other-app (a] appspot.gserviceaccount.com", 431 # ] 432 # }, 433 # { 434 # "role": "roles/viewer", 435 # "members": ["user:sean (a] example.com"] 436 # } 437 # ] 438 # } 439 # 440 # For a description of IAM and its features, see the 441 # [IAM developer's guide](https://cloud.google.com/iam). 442 "bindings": [ # Associates a list of `members` to a `role`. 443 # Multiple `bindings` must not be specified for the same `role`. 444 # `bindings` with no members will result in an error. 445 { # Associates `members` with a `role`. 446 "role": "A String", # Role that is assigned to `members`. 447 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 448 # Required 449 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. 450 # `members` can have the following values: 451 # 452 # * `allUsers`: A special identifier that represents anyone who is 453 # on the internet; with or without a Google account. 454 # 455 # * `allAuthenticatedUsers`: A special identifier that represents anyone 456 # who is authenticated with a Google account or a service account. 457 # 458 # * `user:{emailid}`: An email address that represents a specific Google 459 # account. For example, `alice (a] gmail.com` or `joe (a] example.com`. 460 # 461 # 462 # * `serviceAccount:{emailid}`: An email address that represents a service 463 # account. For example, `my-other-app (a] appspot.gserviceaccount.com`. 464 # 465 # * `group:{emailid}`: An email address that represents a Google group. 466 # For example, `admins (a] example.com`. 467 # 468 # * `domain:{domain}`: A Google Apps domain name that represents all the 469 # users of that domain. For example, `google.com` or `example.com`. 470 # 471 "A String", 472 ], 473 }, 474 ], 475 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help 476 # prevent simultaneous updates of a policy from overwriting each other. 477 # It is strongly suggested that systems make use of the `etag` in the 478 # read-modify-write cycle to perform policy updates in order to avoid race 479 # conditions: An `etag` is returned in the response to `getIamPolicy`, and 480 # systems are expected to put that etag in the request to `setIamPolicy` to 481 # ensure that their change will be applied to the same version of the policy. 482 # 483 # If no `etag` is provided in the call to `setIamPolicy`, then the existing 484 # policy is overwritten blindly. 485 "version": 42, # Version of the `Policy`. The default version is 0. 486 }, 487 } 488 489 x__xgafv: string, V1 error format. 490 Allowed values 491 1 - v1 error format 492 2 - v2 error format 493 494 Returns: 495 An object of the form: 496 497 { # Defines an Identity and Access Management (IAM) policy. It is used to 498 # specify access control policies for Cloud Platform resources. 499 # 500 # 501 # A `Policy` consists of a list of `bindings`. A `Binding` binds a list of 502 # `members` to a `role`, where the members can be user accounts, Google groups, 503 # Google domains, and service accounts. A `role` is a named list of permissions 504 # defined by IAM. 505 # 506 # **Example** 507 # 508 # { 509 # "bindings": [ 510 # { 511 # "role": "roles/owner", 512 # "members": [ 513 # "user:mike (a] example.com", 514 # "group:admins (a] example.com", 515 # "domain:google.com", 516 # "serviceAccount:my-other-app (a] appspot.gserviceaccount.com", 517 # ] 518 # }, 519 # { 520 # "role": "roles/viewer", 521 # "members": ["user:sean (a] example.com"] 522 # } 523 # ] 524 # } 525 # 526 # For a description of IAM and its features, see the 527 # [IAM developer's guide](https://cloud.google.com/iam). 528 "bindings": [ # Associates a list of `members` to a `role`. 529 # Multiple `bindings` must not be specified for the same `role`. 530 # `bindings` with no members will result in an error. 531 { # Associates `members` with a `role`. 532 "role": "A String", # Role that is assigned to `members`. 533 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 534 # Required 535 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. 536 # `members` can have the following values: 537 # 538 # * `allUsers`: A special identifier that represents anyone who is 539 # on the internet; with or without a Google account. 540 # 541 # * `allAuthenticatedUsers`: A special identifier that represents anyone 542 # who is authenticated with a Google account or a service account. 543 # 544 # * `user:{emailid}`: An email address that represents a specific Google 545 # account. For example, `alice (a] gmail.com` or `joe (a] example.com`. 546 # 547 # 548 # * `serviceAccount:{emailid}`: An email address that represents a service 549 # account. For example, `my-other-app (a] appspot.gserviceaccount.com`. 550 # 551 # * `group:{emailid}`: An email address that represents a Google group. 552 # For example, `admins (a] example.com`. 553 # 554 # * `domain:{domain}`: A Google Apps domain name that represents all the 555 # users of that domain. For example, `google.com` or `example.com`. 556 # 557 "A String", 558 ], 559 }, 560 ], 561 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help 562 # prevent simultaneous updates of a policy from overwriting each other. 563 # It is strongly suggested that systems make use of the `etag` in the 564 # read-modify-write cycle to perform policy updates in order to avoid race 565 # conditions: An `etag` is returned in the response to `getIamPolicy`, and 566 # systems are expected to put that etag in the request to `setIamPolicy` to 567 # ensure that their change will be applied to the same version of the policy. 568 # 569 # If no `etag` is provided in the call to `setIamPolicy`, then the existing 570 # policy is overwritten blindly. 571 "version": 42, # Version of the `Policy`. The default version is 0. 572 }</pre> 573 </div> 574 575 <div class="method"> 576 <code class="details" id="testIamPermissions">testIamPermissions(resource, body, x__xgafv=None)</code> 577 <pre>Returns permissions that a caller has on the specified resource. 578 If the resource does not exist, this will return an empty set of 579 permissions, not a NOT_FOUND error. 580 581 Note: This operation is designed to be used for building permission-aware 582 UIs and command-line tools, not for authorization checking. This operation 583 may "fail open" without warning. 584 585 Args: 586 resource: string, REQUIRED: The resource for which the policy detail is being requested. 587 See the operation documentation for the appropriate value for this field. (required) 588 body: object, The request body. (required) 589 The object takes the form of: 590 591 { # Request message for `TestIamPermissions` method. 592 "permissions": [ # The set of permissions to check for the `resource`. Permissions with 593 # wildcards (such as '*' or 'storage.*') are not allowed. For more 594 # information see 595 # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). 596 "A String", 597 ], 598 } 599 600 x__xgafv: string, V1 error format. 601 Allowed values 602 1 - v1 error format 603 2 - v2 error format 604 605 Returns: 606 An object of the form: 607 608 { # Response message for `TestIamPermissions` method. 609 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is 610 # allowed. 611 "A String", 612 ], 613 }</pre> 614 </div> 615 616 </body></html>