Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use gapic-generator-python 0.63.1 #575

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
175 changes: 175 additions & 0 deletions google/pubsub_v1/services/publisher/async_client.py
Original file line number Diff line number Diff line change
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