Skip to content

Commit 0701113

Browse files
authored
chore: librarian generate pull request: 20260205T210552Z (#1580)
PR created by the Librarian CLI to generate Cloud Client Libraries code from protos. BEGIN_COMMIT BEGIN_NESTED_COMMIT feat: Add AIInference MessageTransform type PiperOrigin-RevId: 853856321 Library-IDs: google-cloud-pubsub Source-link: [googleapis/googleapis@9fb55c41](googleapis/googleapis@9fb55c41) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `topic` in message `.google.pubsub.v1.Subscription` is updated PiperOrigin-RevId: 853856321 Library-IDs: google-cloud-pubsub Source-link: [googleapis/googleapis@9fb55c41](googleapis/googleapis@9fb55c41) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `analytics_hub_subscription_info` in message `.google.pubsub.v1.Subscription` is updated PiperOrigin-RevId: 853856321 Library-IDs: google-cloud-pubsub Source-link: [googleapis/googleapis@9fb55c41](googleapis/googleapis@9fb55c41) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `subscription` in message `.google.pubsub.v1.CreateSnapshotRequest` is updated PiperOrigin-RevId: 853856321 Library-IDs: google-cloud-pubsub Source-link: [googleapis/googleapis@9fb55c41](googleapis/googleapis@9fb55c41) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: add tags documentation links to Pub/Sub resource tags fields PiperOrigin-RevId: 845891076 Library-IDs: google-cloud-pubsub Source-link: [googleapis/googleapis@ff251e77](googleapis/googleapis@ff251e77) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: Add the IDENTIFIER field behavior annotation to fields of Cloud Pub/Sub methods that represent a specific identity and need to be sourced with additional care PiperOrigin-RevId: 840763233 Library-IDs: google-cloud-pubsub Source-link: [googleapis/googleapis@d89bb8a1](googleapis/googleapis@d89bb8a1) END_NESTED_COMMIT END_COMMIT This pull request is generated with proto changes between [googleapis/googleapis@9fcfbea0](googleapis/googleapis@9fcfbea) (exclusive) and [googleapis/googleapis@9fb55c41](googleapis/googleapis@9fb55c4) (inclusive). Librarian Version: v0.8.0 Language Image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:b8058df4c45e9a6e07f6b4d65b458d0d059241dd34c814f151c8bf6b89211209
1 parent e4b4f52 commit 0701113

File tree

18 files changed

+183
-61
lines changed

18 files changed

+183
-61
lines changed

.librarian/generator-input/librarian.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,10 @@
338338
samples=True,
339339
cov_level=99,
340340
versions=gcp.common.detect_versions(path="./google", default_first=True),
341-
unit_test_python_versions=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"],
341+
unit_test_python_versions=["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"],
342342
unit_test_dependencies=["flaky"],
343343
system_test_python_versions=["3.12"],
344-
system_test_external_dependencies=["psutil","flaky"],
344+
system_test_external_dependencies=["psutil", "flaky"],
345345
)
346346
s.move(templated_files, excludes=[".coveragerc", ".github/**", "README.rst", "docs/**", ".kokoro/**"])
347347

.librarian/state.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-li
22
libraries:
33
- id: google-cloud-pubsub
44
version: 2.34.0
5-
last_generated_commit: 9fcfbea0aa5b50fa22e190faceb073d74504172b
5+
last_generated_commit: 2d0b3a154fb4f56993487c5409850ad3431a2690
66
apis:
77
- path: google/pubsub/v1
88
service_config: pubsub_v1.yaml

google/pubsub/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from google.pubsub_v1.services.subscriber.async_client import SubscriberAsyncClient
2929

3030
from google.pubsub_v1.types.pubsub import AcknowledgeRequest
31+
from google.pubsub_v1.types.pubsub import AIInference
3132
from google.pubsub_v1.types.pubsub import BigQueryConfig
3233
from google.pubsub_v1.types.pubsub import CloudStorageConfig
3334
from google.pubsub_v1.types.pubsub import CreateSnapshotRequest
@@ -104,6 +105,7 @@
104105
"SubscriberClient",
105106
"SubscriberAsyncClient",
106107
"AcknowledgeRequest",
108+
"AIInference",
107109
"BigQueryConfig",
108110
"CloudStorageConfig",
109111
"CreateSnapshotRequest",

google/pubsub_v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from .services.subscriber import SubscriberAsyncClient
3737

3838
from .types.pubsub import AcknowledgeRequest
39+
from .types.pubsub import AIInference
3940
from .types.pubsub import BigQueryConfig
4041
from .types.pubsub import CloudStorageConfig
4142
from .types.pubsub import CreateSnapshotRequest
@@ -202,6 +203,7 @@ def _get_version(dependency_name):
202203
"PublisherAsyncClient",
203204
"SchemaServiceAsyncClient",
204205
"SubscriberAsyncClient",
206+
"AIInference",
205207
"AcknowledgeRequest",
206208
"BigQueryConfig",
207209
"CloudStorageConfig",

google/pubsub_v1/services/publisher/async_client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -339,14 +339,14 @@ async def sample_create_topic():
339339
request (Optional[Union[google.pubsub_v1.types.Topic, dict]]):
340340
The request object. A topic resource.
341341
name (:class:`str`):
342-
Required. The name of the topic. It must have the format
343-
``"projects/{project}/topics/{topic}"``. ``{topic}``
344-
must start with a letter, and contain only letters
345-
(``[A-Za-z]``), numbers (``[0-9]``), dashes (``-``),
346-
underscores (``_``), periods (``.``), tildes (``~``),
347-
plus (``+``) or percent signs (``%``). It must be
348-
between 3 and 255 characters in length, and it must not
349-
start with ``"goog"``.
342+
Required. Identifier. The name of the topic. It must
343+
have the format ``"projects/{project}/topics/{topic}"``.
344+
``{topic}`` must start with a letter, and contain only
345+
letters (``[A-Za-z]``), numbers (``[0-9]``), dashes
346+
(``-``), underscores (``_``), periods (``.``), tildes
347+
(``~``), plus (``+``) or percent signs (``%``). It must
348+
be between 3 and 255 characters in length, and it must
349+
not start with ``"goog"``.
350350
351351
This corresponds to the ``name`` field
352352
on the ``request`` instance; if ``request`` is provided, this

google/pubsub_v1/services/publisher/client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -868,14 +868,14 @@ def sample_create_topic():
868868
request (Union[google.pubsub_v1.types.Topic, dict]):
869869
The request object. A topic resource.
870870
name (str):
871-
Required. The name of the topic. It must have the format
872-
``"projects/{project}/topics/{topic}"``. ``{topic}``
873-
must start with a letter, and contain only letters
874-
(``[A-Za-z]``), numbers (``[0-9]``), dashes (``-``),
875-
underscores (``_``), periods (``.``), tildes (``~``),
876-
plus (``+``) or percent signs (``%``). It must be
877-
between 3 and 255 characters in length, and it must not
878-
start with ``"goog"``.
871+
Required. Identifier. The name of the topic. It must
872+
have the format ``"projects/{project}/topics/{topic}"``.
873+
``{topic}`` must start with a letter, and contain only
874+
letters (``[A-Za-z]``), numbers (``[0-9]``), dashes
875+
(``-``), underscores (``_``), periods (``.``), tildes
876+
(``~``), plus (``+``) or percent signs (``%``). It must
877+
be between 3 and 255 characters in length, and it must
878+
not start with ``"goog"``.
879879
880880
This corresponds to the ``name`` field
881881
on the ``request`` instance; if ``request`` is provided, this

google/pubsub_v1/services/subscriber/async_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,8 @@ async def sample_create_subscription():
360360
then the subscriber will pull and ack messages using API
361361
methods. At most one of these fields may be set.
362362
name (:class:`str`):
363-
Required. The name of the subscription. It must have the
364-
format
363+
Required. Identifier. The name of the subscription. It
364+
must have the format
365365
``"projects/{project}/subscriptions/{subscription}"``.
366366
``{subscription}`` must start with a letter, and contain
367367
only letters (``[A-Za-z]``), numbers (``[0-9]``), dashes

google/pubsub_v1/services/subscriber/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,8 +872,8 @@ def sample_create_subscription():
872872
then the subscriber will pull and ack messages using API
873873
methods. At most one of these fields may be set.
874874
name (str):
875-
Required. The name of the subscription. It must have the
876-
format
875+
Required. Identifier. The name of the subscription. It
876+
must have the format
877877
``"projects/{project}/subscriptions/{subscription}"``.
878878
``{subscription}`` must start with a letter, and contain
879879
only letters (``[A-Za-z]``), numbers (``[0-9]``), dashes

google/pubsub_v1/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from .pubsub import (
1919
AcknowledgeRequest,
20+
AIInference,
2021
BigQueryConfig,
2122
CloudStorageConfig,
2223
CreateSnapshotRequest,
@@ -99,6 +100,7 @@
99100
__all__ = (
100101
"TimeoutType",
101102
"AcknowledgeRequest",
103+
"AIInference",
102104
"BigQueryConfig",
103105
"CloudStorageConfig",
104106
"CreateSnapshotRequest",

google/pubsub_v1/types/pubsub.py

Lines changed: 116 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
from google.protobuf import duration_pb2 # type: ignore
2323
from google.protobuf import field_mask_pb2 # type: ignore
24+
from google.protobuf import struct_pb2 # type: ignore
2425
from google.protobuf import timestamp_pb2 # type: ignore
2526
from google.pubsub_v1.types import schema as gp_schema
2627

@@ -34,6 +35,7 @@
3435
"PlatformLogsSettings",
3536
"IngestionFailureEvent",
3637
"JavaScriptUDF",
38+
"AIInference",
3739
"MessageTransform",
3840
"Topic",
3941
"PubsubMessage",
@@ -1344,9 +1346,78 @@ class JavaScriptUDF(proto.Message):
13441346
)
13451347

13461348

1349+
class AIInference(proto.Message):
1350+
r"""Configuration for making inference requests against Vertex AI
1351+
models.
1352+
1353+
1354+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
1355+
1356+
Attributes:
1357+
endpoint (str):
1358+
Required. An endpoint to a Vertex AI model of the form
1359+
``projects/{project}/locations/{location}/endpoints/{endpoint}``
1360+
or
1361+
``projects/{project}/locations/{location}/publishers/{publisher}/models/{model}``.
1362+
Vertex AI API requests will be sent to this endpoint.
1363+
unstructured_inference (google.pubsub_v1.types.AIInference.UnstructuredInference):
1364+
Optional. Requests and responses can be any
1365+
arbitrary JSON object.
1366+
1367+
This field is a member of `oneof`_ ``inference_mode``.
1368+
service_account_email (str):
1369+
Optional. The service account to use to make prediction
1370+
requests against endpoints. The resource creator or updater
1371+
that specifies this field must have
1372+
``iam.serviceAccounts.actAs`` permission on the service
1373+
account. If not specified, the Pub/Sub `service
1374+
agent <{$universe.dns_names.final_documentation_domain}/iam/docs/service-agents>`__,
1375+
service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com,
1376+
is used.
1377+
"""
1378+
1379+
class UnstructuredInference(proto.Message):
1380+
r"""Configuration for making inferences using arbitrary JSON
1381+
payloads.
1382+
1383+
Attributes:
1384+
parameters (google.protobuf.struct_pb2.Struct):
1385+
Optional. A parameters object to be included
1386+
in each inference request. The parameters object
1387+
is combined with the data field of the Pub/Sub
1388+
message to form the inference request.
1389+
"""
1390+
1391+
parameters: struct_pb2.Struct = proto.Field(
1392+
proto.MESSAGE,
1393+
number=1,
1394+
message=struct_pb2.Struct,
1395+
)
1396+
1397+
endpoint: str = proto.Field(
1398+
proto.STRING,
1399+
number=1,
1400+
)
1401+
unstructured_inference: UnstructuredInference = proto.Field(
1402+
proto.MESSAGE,
1403+
number=2,
1404+
oneof="inference_mode",
1405+
message=UnstructuredInference,
1406+
)
1407+
service_account_email: str = proto.Field(
1408+
proto.STRING,
1409+
number=3,
1410+
)
1411+
1412+
13471413
class MessageTransform(proto.Message):
13481414
r"""All supported message transforms types.
13491415
1416+
This message has `oneof`_ fields (mutually exclusive fields).
1417+
For each oneof, at most one member field can be set at the same time.
1418+
Setting any member of the oneof automatically clears all other
1419+
members.
1420+
13501421
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
13511422
13521423
Attributes:
@@ -1355,6 +1426,13 @@ class MessageTransform(proto.Message):
13551426
JavaScriptUDF's are specified on a resource, each must have
13561427
a unique ``function_name``.
13571428
1429+
This field is a member of `oneof`_ ``transform``.
1430+
ai_inference (google.pubsub_v1.types.AIInference):
1431+
Optional. AI Inference. Specifies the Vertex
1432+
AI endpoint that inference requests built from
1433+
the Pub/Sub message data and provided parameters
1434+
will be sent to.
1435+
13581436
This field is a member of `oneof`_ ``transform``.
13591437
enabled (bool):
13601438
Optional. This field is deprecated, use the ``disabled``
@@ -1370,6 +1448,12 @@ class MessageTransform(proto.Message):
13701448
oneof="transform",
13711449
message="JavaScriptUDF",
13721450
)
1451+
ai_inference: "AIInference" = proto.Field(
1452+
proto.MESSAGE,
1453+
number=6,
1454+
oneof="transform",
1455+
message="AIInference",
1456+
)
13731457
enabled: bool = proto.Field(
13741458
proto.BOOL,
13751459
number=3,
@@ -1385,10 +1469,10 @@ class Topic(proto.Message):
13851469
13861470
Attributes:
13871471
name (str):
1388-
Required. The name of the topic. It must have the format
1389-
``"projects/{project}/topics/{topic}"``. ``{topic}`` must
1390-
start with a letter, and contain only letters
1391-
(``[A-Za-z]``), numbers (``[0-9]``), dashes (``-``),
1472+
Required. Identifier. The name of the topic. It must have
1473+
the format ``"projects/{project}/topics/{topic}"``.
1474+
``{topic}`` must start with a letter, and contain only
1475+
letters (``[A-Za-z]``), numbers (``[0-9]``), dashes (``-``),
13921476
underscores (``_``), periods (``.``), tildes (``~``), plus
13931477
(``+``) or percent signs (``%``). It must be between 3 and
13941478
255 characters in length, and it must not start with
@@ -1442,7 +1526,11 @@ class Topic(proto.Message):
14421526
example:
14431527
14441528
"123/environment": "production",
1445-
"123/costCenter": "marketing".
1529+
"123/costCenter": "marketing"
1530+
See
1531+
https://docs.cloud.google.com/pubsub/docs/tags
1532+
for more information on using tags with Pub/Sub
1533+
resources.
14461534
"""
14471535

14481536
class State(proto.Enum):
@@ -1889,8 +1977,8 @@ class Subscription(proto.Message):
18891977
18901978
Attributes:
18911979
name (str):
1892-
Required. The name of the subscription. It must have the
1893-
format
1980+
Required. Identifier. The name of the subscription. It must
1981+
have the format
18941982
``"projects/{project}/subscriptions/{subscription}"``.
18951983
``{subscription}`` must start with a letter, and contain
18961984
only letters (``[A-Za-z]``), numbers (``[0-9]``), dashes
@@ -2043,7 +2131,7 @@ class Subscription(proto.Message):
20432131
analytics_hub_subscription_info (google.pubsub_v1.types.Subscription.AnalyticsHubSubscriptionInfo):
20442132
Output only. Information about the associated
20452133
Analytics Hub subscription. Only set if the
2046-
subscritpion is created by Analytics Hub.
2134+
subscription is created by Analytics Hub.
20472135
message_transforms (MutableSequence[google.pubsub_v1.types.MessageTransform]):
20482136
Optional. Transforms to be applied to
20492137
messages before they are delivered to
@@ -2055,7 +2143,11 @@ class Subscription(proto.Message):
20552143
example:
20562144
20572145
"123/environment": "production",
2058-
"123/costCenter": "marketing".
2146+
"123/costCenter": "marketing"
2147+
See
2148+
https://docs.cloud.google.com/pubsub/docs/tags
2149+
for more information on using tags with Pub/Sub
2150+
resources.
20592151
"""
20602152

20612153
class State(proto.Enum):
@@ -2530,13 +2622,18 @@ class State(proto.Enum):
25302622
Cannot write to the destination because enforce_in_transit
25312623
is set to true and the destination locations are not in the
25322624
allowed regions.
2625+
VERTEX_AI_LOCATION_RESTRICTION (6):
2626+
Cannot write to the BigQuery table because the table is not
2627+
in the same location as where Vertex AI models used in
2628+
``message_transform``\ s are deployed.
25332629
"""
25342630
STATE_UNSPECIFIED = 0
25352631
ACTIVE = 1
25362632
PERMISSION_DENIED = 2
25372633
NOT_FOUND = 3
25382634
SCHEMA_MISMATCH = 4
25392635
IN_TRANSIT_LOCATION_RESTRICTION = 5
2636+
VERTEX_AI_LOCATION_RESTRICTION = 6
25402637

25412638
table: str = proto.Field(
25422639
proto.STRING,
@@ -2663,13 +2760,18 @@ class State(proto.Enum):
26632760
Cannot write to the Cloud Storage bucket due
26642761
to an incompatibility between the topic schema
26652762
and subscription settings.
2763+
VERTEX_AI_LOCATION_RESTRICTION (6):
2764+
Cannot write to the Cloud Storage bucket because the bucket
2765+
is not in the same location as where Vertex AI models used
2766+
in ``message_transform``\ s are deployed.
26662767
"""
26672768
STATE_UNSPECIFIED = 0
26682769
ACTIVE = 1
26692770
PERMISSION_DENIED = 2
26702771
NOT_FOUND = 3
26712772
IN_TRANSIT_LOCATION_RESTRICTION = 4
26722773
SCHEMA_MISMATCH = 5
2774+
VERTEX_AI_LOCATION_RESTRICTION = 6
26732775

26742776
class TextConfig(proto.Message):
26752777
r"""Configuration for writing message data in text format.
@@ -3354,7 +3456,11 @@ class CreateSnapshotRequest(proto.Message):
33543456
example:
33553457
33563458
"123/environment": "production",
3357-
"123/costCenter": "marketing".
3459+
"123/costCenter": "marketing"
3460+
See
3461+
https://docs.cloud.google.com/pubsub/docs/tags
3462+
for more information on using tags with Pub/Sub
3463+
resources.
33583464
"""
33593465

33603466
name: str = proto.Field(

0 commit comments

Comments
 (0)