2121
2222from google .protobuf import duration_pb2 # type: ignore
2323from google .protobuf import field_mask_pb2 # type: ignore
24+ from google .protobuf import struct_pb2 # type: ignore
2425from google .protobuf import timestamp_pb2 # type: ignore
2526from google .pubsub_v1 .types import schema as gp_schema
2627
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+
13471413class 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