Skip to content

Commit

Permalink
chore: use gapic-generator-python 0.63.1 (#575)
Browse files Browse the repository at this point in the history
- [x] Regenerate this pull request now.

docs: add autogenerated code snippets
PiperOrigin-RevId: 426256923

Source-Link: googleapis/googleapis@9ebabfa

Source-Link: googleapis/googleapis-gen@a881752
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTg4MTc1MjYzZTYwYTFkNDVkM2E0NDc4NDg2NTJiMGY2NzBiMmNiOCJ9
  • Loading branch information
gcf-owl-bot[bot] committed Feb 5, 2022
1 parent c48fb8c commit aa3754c
Show file tree
Hide file tree
Showing 70 changed files with 6,782 additions and 0 deletions.
175 changes: 175 additions & 0 deletions google/pubsub_v1/services/publisher/async_client.py
Expand Up @@ -220,6 +220,26 @@ async def create_topic(
name rules]
(https://cloud.google.com/pubsub/docs/admin#resource_names).
.. code-block::
from google import pubsub_v1
def sample_create_topic():
# Create a client
client = pubsub_v1.PublisherClient()
# Initialize request argument(s)
request = pubsub_v1.Topic(
name="name_value",
)
# Make the request
response = client.create_topic(request=request)
# Handle response
print(response)
Args:
request (Union[google.pubsub_v1.types.Topic, dict]):
The request object. A topic resource.
Expand Down Expand Up @@ -304,6 +324,29 @@ async def update_topic(
r"""Updates an existing topic. Note that certain
properties of a topic are not modifiable.
.. code-block::
from google import pubsub_v1
def sample_update_topic():
# Create a client
client = pubsub_v1.PublisherClient()
# Initialize request argument(s)
topic = pubsub_v1.Topic()
topic.name = "name_value"
request = pubsub_v1.UpdateTopicRequest(
topic=topic,
)
# Make the request
response = client.update_topic(request=request)
# Handle response
print(response)
Args:
request (Union[google.pubsub_v1.types.UpdateTopicRequest, dict]):
The request object. Request for the UpdateTopic method.
Expand Down Expand Up @@ -365,6 +408,26 @@ async def publish(
r"""Adds one or more messages to the topic. Returns ``NOT_FOUND`` if
the topic does not exist.
.. code-block::
from google import pubsub_v1
def sample_publish():
# Create a client
client = pubsub_v1.PublisherClient()
# Initialize request argument(s)
request = pubsub_v1.PublishRequest(
topic="topic_value",
)
# Make the request
response = client.publish(request=request)
# Handle response
print(response)
Args:
request (Union[google.pubsub_v1.types.PublishRequest, dict]):
The request object. Request for the Publish method.
Expand Down Expand Up @@ -457,6 +520,25 @@ async def get_topic(
) -> pubsub.Topic:
r"""Gets the configuration of a topic.
.. code-block::
from google import pubsub_v1
def sample_get_topic():
# Create a client
client = pubsub_v1.PublisherClient()
# Initialize request argument(s)
request = pubsub_v1.GetTopicRequest(
topic="topic_value",
)
# Make the request
response = client.get_topic(request=request)
# Handle response
print(response)
Args:
request (Union[google.pubsub_v1.types.GetTopicRequest, dict]):
The request object. Request for the GetTopic method.
Expand Down Expand Up @@ -537,6 +619,24 @@ async def list_topics(
) -> pagers.ListTopicsAsyncPager:
r"""Lists matching topics.
.. code-block::
from google import pubsub_v1
def sample_list_topics():
# Create a client
client = pubsub_v1.PublisherClient()
# Initialize request argument(s)
request = pubsub_v1.ListTopicsRequest(
project="project_value",
)
# Make the request
page_result = client.list_topics(request=request)
for response in page_result:
print(response)
Args:
request (Union[google.pubsub_v1.types.ListTopicsRequest, dict]):
The request object. Request for the `ListTopics` method.
Expand Down Expand Up @@ -628,6 +728,25 @@ async def list_topic_subscriptions(
r"""Lists the names of the attached subscriptions on this
topic.
.. code-block::
from google import pubsub_v1
def sample_list_topic_subscriptions():
# Create a client
client = pubsub_v1.PublisherClient()
# Initialize request argument(s)
request = pubsub_v1.ListTopicSubscriptionsRequest(
topic="topic_value",
)
# Make the request
page_result = client.list_topic_subscriptions(request=request)
for response in page_result:
print(response)
Args:
request (Union[google.pubsub_v1.types.ListTopicSubscriptionsRequest, dict]):
The request object. Request for the
Expand Down Expand Up @@ -725,6 +844,25 @@ async def list_topic_snapshots(
bulk. That is, you can set the acknowledgment state of messages
in an existing subscription to the state captured by a snapshot.
.. code-block::
from google import pubsub_v1
def sample_list_topic_snapshots():
# Create a client
client = pubsub_v1.PublisherClient()
# Initialize request argument(s)
request = pubsub_v1.ListTopicSnapshotsRequest(
topic="topic_value",
)
# Make the request
page_result = client.list_topic_snapshots(request=request)
for response in page_result:
print(response)
Args:
request (Union[google.pubsub_v1.types.ListTopicSnapshotsRequest, dict]):
The request object. Request for the `ListTopicSnapshots`
Expand Down Expand Up @@ -822,6 +960,23 @@ async def delete_topic(
subscriptions to this topic are not deleted, but their ``topic``
field is set to ``_deleted-topic_``.
.. code-block::
from google import pubsub_v1
def sample_delete_topic():
# Create a client
client = pubsub_v1.PublisherClient()
# Initialize request argument(s)
request = pubsub_v1.DeleteTopicRequest(
topic="topic_value",
)
# Make the request
response = client.delete_topic(request=request)
Args:
request (Union[google.pubsub_v1.types.DeleteTopicRequest, dict]):
The request object. Request for the `DeleteTopic`
Expand Down Expand Up @@ -899,6 +1054,26 @@ async def detach_subscription(
the subscription is a push subscription, pushes to the endpoint
will stop.
.. code-block::
from google import pubsub_v1
def sample_detach_subscription():
# Create a client
client = pubsub_v1.PublisherClient()
# Initialize request argument(s)
request = pubsub_v1.DetachSubscriptionRequest(
subscription="subscription_value",
)
# Make the request
response = client.detach_subscription(request=request)
# Handle response
print(response)
Args:
request (Union[google.pubsub_v1.types.DetachSubscriptionRequest, dict]):
The request object. Request for the DetachSubscription
Expand Down

0 comments on commit aa3754c

Please sign in to comment.