@@ -247,8 +247,12 @@ def create_topic(
247247 metadata = None ,
248248 ):
249249 """
250- Creates the given topic with the given name. See the resource name
251- rules.
250+ Deletes the topic with the given name. Returns ``NOT_FOUND`` if the
251+ topic does not exist. After a topic is deleted, a new topic may be
252+ created with the same name; this is an entirely new topic with none of
253+ the old configuration or subscriptions. Existing subscriptions to this
254+ topic are not deleted, but their ``topic`` field is set to
255+ ``_deleted-topic_``.
252256
253257 Example:
254258 >>> from google.cloud import pubsub_v1
@@ -260,12 +264,9 @@ def create_topic(
260264 >>> response = client.create_topic(name)
261265
262266 Args:
263- name (str): Required. The name of the topic. It must have the format
264- ``"projects/{project}/topics/{topic}"``. ``{topic}`` must start with a
265- letter, and contain only letters (``[A-Za-z]``), numbers (``[0-9]``),
266- dashes (``-``), underscores (``_``), periods (``.``), tildes (``~``),
267- plus (``+``) or percent signs (``%``). It must be between 3 and 255
268- characters in length, and it must not start with ``"goog"``.
267+ name (str): If type_name is set, this need not be set. If both this and
268+ type_name are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or
269+ TYPE_GROUP.
269270 labels (dict[str -> str]): See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
270271 managing labels</a>.
271272 message_storage_policy (Union[dict, ~google.cloud.pubsub_v1.types.MessageStoragePolicy]): Policy constraining the set of Google Cloud Platform regions where messages
@@ -274,11 +275,10 @@ def create_topic(
274275
275276 If a dict is provided, it must be of the same form as the protobuf
276277 message :class:`~google.cloud.pubsub_v1.types.MessageStoragePolicy`
277- kms_key_name (str): The resource name of the Cloud KMS CryptoKey to be used to protect
278- access to messages published on this topic.
279-
280- The expected format is
281- ``projects/*/locations/*/keyRings/*/cryptoKeys/*``.
278+ kms_key_name (str): The set of permissions to check for the ``resource``. Permissions
279+ with wildcards (such as '*' or 'storage.*') are not allowed. For more
280+ information see `IAM
281+ Overview <https://cloud.google.com/iam/docs/overview#permissions>`__.
282282 retry (Optional[google.api_core.retry.Retry]): A retry object used
283283 to retry requests. If ``None`` is specified, requests will
284284 be retried using a default configuration.
@@ -362,11 +362,8 @@ def update_topic(
362362
363363 If a dict is provided, it must be of the same form as the protobuf
364364 message :class:`~google.cloud.pubsub_v1.types.Topic`
365- update_mask (Union[dict, ~google.cloud.pubsub_v1.types.FieldMask]): Required. Indicates which fields in the provided topic to update. Must
366- be specified and non-empty. Note that if ``update_mask`` contains
367- "message\_storage\_policy" but the ``message_storage_policy`` is not set
368- in the ``topic`` provided above, then the updated value is determined by
369- the policy configured at the project or organization level.
365+ update_mask (Union[dict, ~google.cloud.pubsub_v1.types.FieldMask]): An annotation that describes a resource definition without a
366+ corresponding message; see ``ResourceDescriptor``.
370367
371368 If a dict is provided, it must be of the same form as the protobuf
372369 message :class:`~google.cloud.pubsub_v1.types.FieldMask`
@@ -427,8 +424,37 @@ def publish(
427424 metadata = None ,
428425 ):
429426 """
430- Adds one or more messages to the topic. Returns ``NOT_FOUND`` if the
431- topic does not exist.
427+ Protocol Buffers - Google's data interchange format Copyright 2008
428+ Google Inc. All rights reserved.
429+ https://developers.google.com/protocol-buffers/
430+
431+ Redistribution and use in source and binary forms, with or without
432+ modification, are permitted provided that the following conditions are
433+ met:
434+
435+ ::
436+
437+ * Redistributions of source code must retain the above copyright
438+
439+ notice, this list of conditions and the following disclaimer. \*
440+ Redistributions in binary form must reproduce the above copyright
441+ notice, this list of conditions and the following disclaimer in the
442+ documentation and/or other materials provided with the distribution. \*
443+ Neither the name of Google Inc. nor the names of its contributors may be
444+ used to endorse or promote products derived from this software without
445+ specific prior written permission.
446+
447+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
448+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
449+ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
450+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
451+ OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
452+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
453+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
454+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
455+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
456+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
457+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
432458
433459 Example:
434460 >>> from google.cloud import pubsub_v1
@@ -443,8 +469,9 @@ def publish(
443469 >>> response = client.publish(topic, messages)
444470
445471 Args:
446- topic (str): Required. The messages in the request will be published on this topic.
447- Format is ``projects/{project}/topics/{topic}``.
472+ topic (str): Denotes a field as required. This indicates that the field **must**
473+ be provided as part of the request, and failure to do so will cause an
474+ error (usually ``INVALID_ARGUMENT``).
448475 messages (list[Union[dict, ~google.cloud.pubsub_v1.types.PubsubMessage]]): Required. The messages to publish.
449476
450477 If a dict is provided, it must be of the same form as the protobuf
@@ -517,8 +544,8 @@ def get_topic(
517544 >>> response = client.get_topic(topic)
518545
519546 Args:
520- topic (str): Required. The name of the topic to get . Format is
521- ``projects/{project}/topics/{topic }``.
547+ topic (str): Required. The name of the project in which to list snapshots . Format
548+ is ``projects/{project-id }``.
522549 retry (Optional[google.api_core.retry.Retry]): A retry object used
523550 to retry requests. If ``None`` is specified, requests will
524551 be retried using a default configuration.
@@ -600,8 +627,8 @@ def list_topics(
600627 ... pass
601628
602629 Args:
603- project (str): Required. The name of the project in which to list topics. Format is
604- ``projects/{project-id }``.
630+ project (str): Required. The subscription from which messages should be pulled.
631+ Format is ``projects/{project}/subscriptions/{sub }``.
605632 page_size (int): The maximum number of resources contained in the
606633 underlying API response. If page streaming is performed per-
607634 resource, this parameter does not affect the return value. If page
@@ -702,8 +729,13 @@ def list_topic_subscriptions(
702729 ... pass
703730
704731 Args:
705- topic (str): Required. The name of the topic that subscriptions are attached to.
706- Format is ``projects/{project}/topics/{topic}``.
732+ topic (str): Optional. If this field set to true, the system will respond
733+ immediately even if it there are no messages available to return in the
734+ ``Pull`` response. Otherwise, the system may wait (for a bounded amount
735+ of time) until at least one message is available, rather than returning
736+ no messages. Warning: setting this field to ``true`` is discouraged
737+ because it adversely impacts the performance of ``Pull`` operations. We
738+ recommend that users do not set this field.
707739 page_size (int): The maximum number of resources contained in the
708740 underlying API response. If page streaming is performed per-
709741 resource, this parameter does not affect the return value. If page
@@ -811,8 +843,10 @@ def list_topic_snapshots(
811843 ... pass
812844
813845 Args:
814- topic (str): Required. The name of the topic that snapshots are attached to. Format
815- is ``projects/{project}/topics/{topic}``.
846+ topic (str): Denotes a field as output only. This indicates that the field is
847+ provided in responses, but including the field in a request does nothing
848+ (the server *must* ignore it and *must not* throw an error as a result
849+ of the field's presence).
816850 page_size (int): The maximum number of resources contained in the
817851 underlying API response. If page streaming is performed per-
818852 resource, this parameter does not affect the return value. If page
@@ -888,12 +922,8 @@ def delete_topic(
888922 metadata = None ,
889923 ):
890924 """
891- Deletes the topic with the given name. Returns ``NOT_FOUND`` if the
892- topic does not exist. After a topic is deleted, a new topic may be
893- created with the same name; this is an entirely new topic with none of
894- the old configuration or subscriptions. Existing subscriptions to this
895- topic are not deleted, but their ``topic`` field is set to
896- ``_deleted-topic_``.
925+ An annotation that describes a resource reference, see
926+ ``ResourceReference``.
897927
898928 Example:
899929 >>> from google.cloud import pubsub_v1
@@ -905,8 +935,16 @@ def delete_topic(
905935 >>> client.delete_topic(topic)
906936
907937 Args:
908- topic (str): Required. Name of the topic to delete. Format is
909- ``projects/{project}/topics/{topic}``.
938+ topic (str): The resource type. It must be in the format of
939+ {service_name}/{resource_type_kind}. The ``resource_type_kind`` must be
940+ singular and must not include version numbers.
941+
942+ Example: ``storage.googleapis.com/Bucket``
943+
944+ The value of the resource_type_kind must follow the regular expression
945+ /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
946+ should use PascalCase (UpperCamelCase). The maximum number of characters
947+ allowed for the ``resource_type_kind`` is 100.
910948 retry (Optional[google.api_core.retry.Retry]): A retry object used
911949 to retry requests. If ``None`` is specified, requests will
912950 be retried using a default configuration.
@@ -983,10 +1021,7 @@ def set_iam_policy(
9831021 Args:
9841022 resource (str): REQUIRED: The resource for which the policy is being specified.
9851023 See the operation documentation for the appropriate value for this field.
986- policy (Union[dict, ~google.cloud.pubsub_v1.types.Policy]): REQUIRED: The complete policy to be applied to the ``resource``. The
987- size of the policy is limited to a few 10s of KB. An empty policy is a
988- valid policy but certain Cloud Platform services (such as Projects)
989- might reject them.
1024+ policy (Union[dict, ~google.cloud.pubsub_v1.types.Policy]): See ``HttpRule``.
9901025
9911026 If a dict is provided, it must be of the same form as the protobuf
9921027 message :class:`~google.cloud.pubsub_v1.types.Policy`
@@ -1063,8 +1098,8 @@ def get_iam_policy(
10631098 Args:
10641099 resource (str): REQUIRED: The resource for which the policy is being requested.
10651100 See the operation documentation for the appropriate value for this field.
1066- options_ (Union[dict, ~google.cloud.pubsub_v1.types.GetPolicyOptions]): OPTIONAL: A ``GetPolicyOptions`` object for specifying options to
1067- ``GetIamPolicy``. This field is only used by Cloud IAM .
1101+ options_ (Union[dict, ~google.cloud.pubsub_v1.types.GetPolicyOptions]): A URL locating the endpoint to which messages should be pushed. For
1102+ example, a Webhook endpoint might use ``https://example.com/push`` .
10681103
10691104 If a dict is provided, it must be of the same form as the protobuf
10701105 message :class:`~google.cloud.pubsub_v1.types.GetPolicyOptions`
@@ -1151,10 +1186,17 @@ def test_iam_permissions(
11511186 Args:
11521187 resource (str): REQUIRED: The resource for which the policy detail is being requested.
11531188 See the operation documentation for the appropriate value for this field.
1154- permissions (list[str]): The set of permissions to check for the ``resource``. Permissions with
1155- wildcards (such as '*' or 'storage.*') are not allowed. For more
1156- information see `IAM
1157- Overview <https://cloud.google.com/iam/docs/overview#permissions>`__.
1189+ permissions (list[str]): The snapshot is guaranteed to exist up until this time. A
1190+ newly-created snapshot expires no later than 7 days from the time of its
1191+ creation. Its exact lifetime is determined at creation by the existing
1192+ backlog in the source subscription. Specifically, the lifetime of the
1193+ snapshot is
1194+ ``7 days - (age of oldest unacked message in the subscription)``. For
1195+ example, consider a subscription whose oldest unacked message is 3 days
1196+ old. If a snapshot is created from this subscription, the snapshot --
1197+ which will always capture this 3-day-old backlog as long as the snapshot
1198+ exists -- will expire in 4 days. The service will refuse to create a
1199+ snapshot that would expire in less than 1 hour after creation.
11581200 retry (Optional[google.api_core.retry.Retry]): A retry object used
11591201 to retry requests. If ``None`` is specified, requests will
11601202 be retried using a default configuration.
0 commit comments