Skip to content

Commit 6c5913d

Browse files
yoshi-automationsduskis
authored andcommitted
[CHANGE ME] Re-generated pubsub to pick up changes in the API or client library generator. (#7936)
1 parent f8e4ead commit 6c5913d

9 files changed

Lines changed: 502 additions & 616 deletions

File tree

pubsub/google/cloud/pubsub_v1/gapic/publisher_client.py

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,17 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8383
from_service_account_json = from_service_account_file
8484

8585
@classmethod
86-
def topic_path(cls, project, topic):
87-
"""Return a fully-qualified topic string."""
86+
def project_path(cls, project):
87+
"""Return a fully-qualified project string."""
8888
return google.api_core.path_template.expand(
89-
"projects/{project}/topics/{topic}", project=project, topic=topic
89+
"projects/{project}", project=project
9090
)
9191

9292
@classmethod
93-
def project_path(cls, project):
94-
"""Return a fully-qualified project string."""
93+
def topic_path(cls, project, topic):
94+
"""Return a fully-qualified topic string."""
9595
return google.api_core.path_template.expand(
96-
"projects/{project}", project=project
96+
"projects/{project}/topics/{topic}", project=project, topic=topic
9797
)
9898

9999
def __init__(
@@ -200,6 +200,7 @@ def create_topic(
200200
name,
201201
labels=None,
202202
message_storage_policy=None,
203+
kms_key_name=None,
203204
retry=google.api_core.gapic_v1.method.DEFAULT,
204205
timeout=google.api_core.gapic_v1.method.DEFAULT,
205206
metadata=None,
@@ -235,6 +236,14 @@ def create_topic(
235236
236237
If a dict is provided, it must be of the same form as the protobuf
237238
message :class:`~google.cloud.pubsub_v1.types.MessageStoragePolicy`
239+
kms_key_name (str): The resource name of the Cloud KMS CryptoKey to be used to protect
240+
access to messages published on this topic.
241+
242+
The expected format is
243+
``projects/*/locations/*/keyRings/*/cryptoKeys/*``. EXPERIMENTAL: This
244+
feature is part of a closed alpha release. This API might be changed in
245+
backward-incompatible ways and is not recommended for production use. It
246+
is not subject to any SLA or deprecation policy.
238247
retry (Optional[google.api_core.retry.Retry]): A retry object used
239248
to retry requests. If ``None`` is specified, requests will not
240249
be retried.
@@ -266,7 +275,10 @@ def create_topic(
266275
)
267276

268277
request = pubsub_pb2.Topic(
269-
name=name, labels=labels, message_storage_policy=message_storage_policy
278+
name=name,
279+
labels=labels,
280+
message_storage_policy=message_storage_policy,
281+
kms_key_name=kms_key_name,
270282
)
271283
if metadata is None:
272284
metadata = []
@@ -825,8 +837,7 @@ def set_iam_policy(
825837
826838
Args:
827839
resource (str): REQUIRED: The resource for which the policy is being specified.
828-
``resource`` is usually specified as a path. For example, a Project
829-
resource is specified as ``projects/{project}``.
840+
See the operation documentation for the appropriate value for this field.
830841
policy (Union[dict, ~google.cloud.pubsub_v1.types.Policy]): REQUIRED: The complete policy to be applied to the ``resource``. The
831842
size of the policy is limited to a few 10s of KB. An empty policy is a
832843
valid policy but certain Cloud Platform services (such as Projects)
@@ -905,8 +916,7 @@ def get_iam_policy(
905916
906917
Args:
907918
resource (str): REQUIRED: The resource for which the policy is being requested.
908-
``resource`` is usually specified as a path. For example, a Project
909-
resource is specified as ``projects/{project}``.
919+
See the operation documentation for the appropriate value for this field.
910920
retry (Optional[google.api_core.retry.Retry]): A retry object used
911921
to retry requests. If ``None`` is specified, requests will not
912922
be retried.
@@ -968,6 +978,10 @@ def test_iam_permissions(
968978
resource does not exist, this will return an empty set of permissions,
969979
not a NOT\_FOUND error.
970980
981+
Note: This operation is designed to be used for building
982+
permission-aware UIs and command-line tools, not for authorization
983+
checking. This operation may "fail open" without warning.
984+
971985
Example:
972986
>>> from google.cloud import pubsub_v1
973987
>>>
@@ -982,8 +996,7 @@ def test_iam_permissions(
982996
983997
Args:
984998
resource (str): REQUIRED: The resource for which the policy detail is being requested.
985-
``resource`` is usually specified as a path. For example, a Project
986-
resource is specified as ``projects/{project}``.
999+
See the operation documentation for the appropriate value for this field.
9871000
permissions (list[str]): The set of permissions to check for the ``resource``. Permissions with
9881001
wildcards (such as '*' or 'storage.*') are not allowed. For more
9891002
information see `IAM

pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py

Lines changed: 35 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,6 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8585

8686
from_service_account_json = from_service_account_file
8787

88-
@classmethod
89-
def subscription_path(cls, project, subscription):
90-
"""Return a fully-qualified subscription string."""
91-
return google.api_core.path_template.expand(
92-
"projects/{project}/subscriptions/{subscription}",
93-
project=project,
94-
subscription=subscription,
95-
)
96-
97-
@classmethod
98-
def topic_path(cls, project, topic):
99-
"""Return a fully-qualified topic string."""
100-
return google.api_core.path_template.expand(
101-
"projects/{project}/topics/{topic}", project=project, topic=topic
102-
)
103-
10488
@classmethod
10589
def project_path(cls, project):
10690
"""Return a fully-qualified project string."""
@@ -117,6 +101,22 @@ def snapshot_path(cls, project, snapshot):
117101
snapshot=snapshot,
118102
)
119103

104+
@classmethod
105+
def subscription_path(cls, project, subscription):
106+
"""Return a fully-qualified subscription string."""
107+
return google.api_core.path_template.expand(
108+
"projects/{project}/subscriptions/{subscription}",
109+
project=project,
110+
subscription=subscription,
111+
)
112+
113+
@classmethod
114+
def topic_path(cls, project, topic):
115+
"""Return a fully-qualified topic string."""
116+
return google.api_core.path_template.expand(
117+
"projects/{project}/topics/{topic}", project=project, topic=topic
118+
)
119+
120120
def __init__(
121121
self,
122122
transport=None,
@@ -293,19 +293,13 @@ def create_subscription(
293293
messages are not expunged from the subscription's backlog, even if they
294294
are acknowledged, until they fall out of the
295295
``message_retention_duration`` window. This must be true if you would
296-
like to Seek to a timestamp. BETA: This feature is part of a beta
297-
release. This API might be changed in backward-incompatible ways and is
298-
not recommended for production use. It is not subject to any SLA or
299-
deprecation policy.
296+
like to Seek to a timestamp.
300297
message_retention_duration (Union[dict, ~google.cloud.pubsub_v1.types.Duration]): How long to retain unacknowledged messages in the subscription's
301298
backlog, from the moment a message is published. If
302299
``retain_acked_messages`` is true, then this also configures the
303300
retention of acknowledged messages, and thus configures how far back in
304301
time a ``Seek`` can be done. Defaults to 7 days. Cannot be more than 7
305-
days or less than 10 minutes. BETA: This feature is part of a beta
306-
release. This API might be changed in backward-incompatible ways and is
307-
not recommended for production use. It is not subject to any SLA or
308-
deprecation policy.
302+
days or less than 10 minutes.
309303
310304
If a dict is provided, it must be of the same form as the protobuf
311305
message :class:`~google.cloud.pubsub_v1.types.Duration`
@@ -323,10 +317,7 @@ def create_subscription(
323317
subscriber is successfully consuming messages from the subscription or
324318
is issuing operations on the subscription. If ``expiration_policy`` is
325319
not set, a *default policy* with ``ttl`` of 31 days will be used. The
326-
minimum allowed value for ``expiration_policy.ttl`` is 1 day. BETA: This
327-
feature is part of a beta release. This API might be changed in
328-
backward-incompatible ways and is not recommended for production use. It
329-
is not subject to any SLA or deprecation policy.
320+
minimum allowed value for ``expiration_policy.ttl`` is 1 day.
330321
331322
If a dict is provided, it must be of the same form as the protobuf
332323
message :class:`~google.cloud.pubsub_v1.types.ExpirationPolicy`
@@ -1151,10 +1142,7 @@ def list_snapshots(
11511142
operations, which allow
11521143
you to manage message acknowledgments in bulk. That is, you can set the
11531144
acknowledgment state of messages in an existing subscription to the state
1154-
captured by a snapshot.<br><br>
1155-
<b>BETA:</b> This feature is part of a beta release. This API might be
1156-
changed in backward-incompatible ways and is not recommended for production
1157-
use. It is not subject to any SLA or deprecation policy.
1145+
captured by a snapshot.
11581146
11591147
Example:
11601148
>>> from google.cloud import pubsub_v1
@@ -1260,15 +1248,12 @@ def create_snapshot(
12601248
Creates a snapshot from the requested subscription. Snapshots are used
12611249
in Seek operations, which allow you to manage message acknowledgments in
12621250
bulk. That is, you can set the acknowledgment state of messages in an
1263-
existing subscription to the state captured by a snapshot. BETA: This
1264-
feature is part of a beta release. This API might be changed in
1265-
backward-incompatible ways and is not recommended for production use. It
1266-
is not subject to any SLA or deprecation policy. If the snapshot already
1267-
exists, returns ``ALREADY_EXISTS``. If the requested subscription
1268-
doesn't exist, returns ``NOT_FOUND``. If the backlog in the subscription
1269-
is too old -- and the resulting snapshot would expire in less than 1
1270-
hour -- then ``FAILED_PRECONDITION`` is returned. See also the
1271-
``Snapshot.expire_time`` field. If the name is not provided in the
1251+
existing subscription to the state captured by a snapshot. If the
1252+
snapshot already exists, returns ``ALREADY_EXISTS``. If the requested
1253+
subscription doesn't exist, returns ``NOT_FOUND``. If the backlog in the
1254+
subscription is too old -- and the resulting snapshot would expire in
1255+
less than 1 hour -- then ``FAILED_PRECONDITION`` is returned. See also
1256+
the ``Snapshot.expire_time`` field. If the name is not provided in the
12721257
request, the server will assign a random name for this snapshot on the
12731258
same project as the subscription, conforming to the `resource name
12741259
format <https://cloud.google.com/pubsub/docs/admin#resource_names>`__.
@@ -1365,11 +1350,7 @@ def update_snapshot(
13651350
operations, which allow
13661351
you to manage message acknowledgments in bulk. That is, you can set the
13671352
acknowledgment state of messages in an existing subscription to the state
1368-
captured by a snapshot.<br><br>
1369-
<b>BETA:</b> This feature is part of a beta release. This API might be
1370-
changed in backward-incompatible ways and is not recommended for production
1371-
use. It is not subject to any SLA or deprecation policy.
1372-
Note that certain properties of a snapshot are not modifiable.
1353+
captured by a snapshot.
13731354
13741355
Example:
13751356
>>> from google.cloud import pubsub_v1
@@ -1459,9 +1440,6 @@ def delete_snapshot(
14591440
you to manage message acknowledgments in bulk. That is, you can set the
14601441
acknowledgment state of messages in an existing subscription to the state
14611442
captured by a snapshot.<br><br>
1462-
<b>BETA:</b> This feature is part of a beta release. This API might be
1463-
changed in backward-incompatible ways and is not recommended for production
1464-
use. It is not subject to any SLA or deprecation policy.
14651443
When the snapshot is deleted, all messages retained in the snapshot
14661444
are immediately dropped. After a snapshot is deleted, a new one may be
14671445
created with the same name, but the new one has no association with the old
@@ -1541,10 +1519,7 @@ def seek(
15411519
you to manage message acknowledgments in bulk. That is, you can set the
15421520
acknowledgment state of messages in an existing subscription to the state
15431521
captured by a snapshot. Note that both the subscription and the snapshot
1544-
must be on the same topic.<br><br>
1545-
<b>BETA:</b> This feature is part of a beta release. This API might be
1546-
changed in backward-incompatible ways and is not recommended for production
1547-
use. It is not subject to any SLA or deprecation policy.
1522+
must be on the same topic.
15481523
15491524
Example:
15501525
>>> from google.cloud import pubsub_v1
@@ -1651,8 +1626,7 @@ def set_iam_policy(
16511626
16521627
Args:
16531628
resource (str): REQUIRED: The resource for which the policy is being specified.
1654-
``resource`` is usually specified as a path. For example, a Project
1655-
resource is specified as ``projects/{project}``.
1629+
See the operation documentation for the appropriate value for this field.
16561630
policy (Union[dict, ~google.cloud.pubsub_v1.types.Policy]): REQUIRED: The complete policy to be applied to the ``resource``. The
16571631
size of the policy is limited to a few 10s of KB. An empty policy is a
16581632
valid policy but certain Cloud Platform services (such as Projects)
@@ -1731,8 +1705,7 @@ def get_iam_policy(
17311705
17321706
Args:
17331707
resource (str): REQUIRED: The resource for which the policy is being requested.
1734-
``resource`` is usually specified as a path. For example, a Project
1735-
resource is specified as ``projects/{project}``.
1708+
See the operation documentation for the appropriate value for this field.
17361709
retry (Optional[google.api_core.retry.Retry]): A retry object used
17371710
to retry requests. If ``None`` is specified, requests will not
17381711
be retried.
@@ -1794,6 +1767,10 @@ def test_iam_permissions(
17941767
resource does not exist, this will return an empty set of permissions,
17951768
not a NOT\_FOUND error.
17961769
1770+
Note: This operation is designed to be used for building
1771+
permission-aware UIs and command-line tools, not for authorization
1772+
checking. This operation may "fail open" without warning.
1773+
17971774
Example:
17981775
>>> from google.cloud import pubsub_v1
17991776
>>>
@@ -1808,8 +1785,7 @@ def test_iam_permissions(
18081785
18091786
Args:
18101787
resource (str): REQUIRED: The resource for which the policy detail is being requested.
1811-
``resource`` is usually specified as a path. For example, a Project
1812-
resource is specified as ``projects/{project}``.
1788+
See the operation documentation for the appropriate value for this field.
18131789
permissions (list[str]): The set of permissions to check for the ``resource``. Permissions with
18141790
wildcards (such as '*' or 'storage.*') are not allowed. For more
18151791
information see `IAM

pubsub/google/cloud/pubsub_v1/gapic/transports/publisher_grpc_transport.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ def test_iam_permissions(self):
236236
resource does not exist, this will return an empty set of permissions,
237237
not a NOT\_FOUND error.
238238
239+
Note: This operation is designed to be used for building
240+
permission-aware UIs and command-line tools, not for authorization
241+
checking. This operation may "fail open" without warning.
242+
239243
Returns:
240244
Callable: A callable which accepts the appropriate
241245
deserialized request object and returns a

0 commit comments

Comments
 (0)