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