| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e4b4f52 commit 0701113
18 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -338,10 +338,10 @@ | |||
| 338 | 338 | samples=True, | |
| 339 | 339 | cov_level=99, | |
| 340 | 340 | 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"], | ||
| 342 | 342 | unit_test_dependencies=["flaky"], | |
| 343 | 343 | system_test_python_versions=["3.12"], | |
| 344 | - system_test_external_dependencies=["psutil","flaky"], | ||
| 344 | + system_test_external_dependencies=["psutil", "flaky"], | ||
| 345 | 345 | ) | |
| 346 | 346 | s.move(templated_files, excludes=[".coveragerc", ".github/**", "README.rst", "docs/**", ".kokoro/**"]) | |
| 347 | 347 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-li | |||
| 2 | 2 | libraries: | |
| 3 | 3 | - id: google-cloud-pubsub | |
| 4 | 4 | version: 2.34.0 | |
| 5 | - last_generated_commit: 9fcfbea0aa5b50fa22e190faceb073d74504172b | ||
| 5 | + last_generated_commit: 2d0b3a154fb4f56993487c5409850ad3431a2690 | ||
| 6 | 6 | apis: | |
| 7 | 7 | - path: google/pubsub/v1 | |
| 8 | 8 | service_config: pubsub_v1.yaml | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,6 +28,7 @@ | |||
| 28 | 28 | from google.pubsub_v1.services.subscriber.async_client import SubscriberAsyncClient | |
| 29 | 29 | ||
| 30 | 30 | from google.pubsub_v1.types.pubsub import AcknowledgeRequest | |
| 31 | + from google.pubsub_v1.types.pubsub import AIInference | ||
| 31 | 32 | from google.pubsub_v1.types.pubsub import BigQueryConfig | |
| 32 | 33 | from google.pubsub_v1.types.pubsub import CloudStorageConfig | |
| 33 | 34 | from google.pubsub_v1.types.pubsub import CreateSnapshotRequest | |
@@ -104,6 +105,7 @@ | |||
| 104 | 105 | "SubscriberClient", | |
| 105 | 106 | "SubscriberAsyncClient", | |
| 106 | 107 | "AcknowledgeRequest", | |
| 108 | + "AIInference", | ||
| 107 | 109 | "BigQueryConfig", | |
| 108 | 110 | "CloudStorageConfig", | |
| 109 | 111 | "CreateSnapshotRequest", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,6 +36,7 @@ | |||
| 36 | 36 | from .services.subscriber import SubscriberAsyncClient | |
| 37 | 37 | ||
| 38 | 38 | from .types.pubsub import AcknowledgeRequest | |
| 39 | + from .types.pubsub import AIInference | ||
| 39 | 40 | from .types.pubsub import BigQueryConfig | |
| 40 | 41 | from .types.pubsub import CloudStorageConfig | |
| 41 | 42 | from .types.pubsub import CreateSnapshotRequest | |
@@ -202,6 +203,7 @@ def _get_version(dependency_name): | |||
| 202 | 203 | "PublisherAsyncClient", | |
| 203 | 204 | "SchemaServiceAsyncClient", | |
| 204 | 205 | "SubscriberAsyncClient", | |
| 206 | + "AIInference", | ||
| 205 | 207 | "AcknowledgeRequest", | |
| 206 | 208 | "BigQueryConfig", | |
| 207 | 209 | "CloudStorageConfig", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -339,14 +339,14 @@ async def sample_create_topic(): | |||
| 339 | 339 | request (Optional[Union[google.pubsub_v1.types.Topic, dict]]): | |
| 340 | 340 | The request object. A topic resource. | |
| 341 | 341 | 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"``. | ||
| 350 | 350 | ||
| 351 | 351 | This corresponds to the ``name`` field | |
| 352 | 352 | on the ``request`` instance; if ``request`` is provided, this | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -868,14 +868,14 @@ def sample_create_topic(): | |||
| 868 | 868 | request (Union[google.pubsub_v1.types.Topic, dict]): | |
| 869 | 869 | The request object. A topic resource. | |
| 870 | 870 | 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"``. | ||
| 879 | 879 | ||
| 880 | 880 | This corresponds to the ``name`` field | |
| 881 | 881 | on the ``request`` instance; if ``request`` is provided, this | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -360,8 +360,8 @@ async def sample_create_subscription(): | |||
| 360 | 360 | then the subscriber will pull and ack messages using API | |
| 361 | 361 | methods. At most one of these fields may be set. | |
| 362 | 362 | 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 | ||
| 365 | 365 | ``"projects/{project}/subscriptions/{subscription}"``. | |
| 366 | 366 | ``{subscription}`` must start with a letter, and contain | |
| 367 | 367 | only letters (``[A-Za-z]``), numbers (``[0-9]``), dashes | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -872,8 +872,8 @@ def sample_create_subscription(): | |||
| 872 | 872 | then the subscriber will pull and ack messages using API | |
| 873 | 873 | methods. At most one of these fields may be set. | |
| 874 | 874 | 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 | ||
| 877 | 877 | ``"projects/{project}/subscriptions/{subscription}"``. | |
| 878 | 878 | ``{subscription}`` must start with a letter, and contain | |
| 879 | 879 | only letters (``[A-Za-z]``), numbers (``[0-9]``), dashes | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,6 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | 18 | from .pubsub import ( | |
| 19 | 19 | AcknowledgeRequest, | |
| 20 | + AIInference, | ||
| 20 | 21 | BigQueryConfig, | |
| 21 | 22 | CloudStorageConfig, | |
| 22 | 23 | CreateSnapshotRequest, | |
@@ -99,6 +100,7 @@ | |||
| 99 | 100 | __all__ = ( | |
| 100 | 101 | "TimeoutType", | |
| 101 | 102 | "AcknowledgeRequest", | |
| 103 | + "AIInference", | ||
| 102 | 104 | "BigQueryConfig", | |
| 103 | 105 | "CloudStorageConfig", | |
| 104 | 106 | "CreateSnapshotRequest", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,6 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | 22 | from google.protobuf import duration_pb2 # type: ignore | |
| 23 | 23 | from google.protobuf import field_mask_pb2 # type: ignore | |
| 24 | + from google.protobuf import struct_pb2 # type: ignore | ||
| 24 | 25 | from google.protobuf import timestamp_pb2 # type: ignore | |
| 25 | 26 | from google.pubsub_v1.types import schema as gp_schema | |
| 26 | 27 | ||
@@ -34,6 +35,7 @@ | |||
| 34 | 35 | "PlatformLogsSettings", | |
| 35 | 36 | "IngestionFailureEvent", | |
| 36 | 37 | "JavaScriptUDF", | |
| 38 | + "AIInference", | ||
| 37 | 39 | "MessageTransform", | |
| 38 | 40 | "Topic", | |
| 39 | 41 | "PubsubMessage", | |
@@ -1344,9 +1346,78 @@ class JavaScriptUDF(proto.Message): | |||
| 1344 | 1346 | ) | |
| 1345 | 1347 | ||
| 1346 | 1348 | ||
| 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 | + | ||
| 1347 | 1413 | class MessageTransform(proto.Message): | |
| 1348 | 1414 | r"""All supported message transforms types. | |
| 1349 | 1415 | ||
| 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 | + | ||
| 1350 | 1421 | .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields | |
| 1351 | 1422 | ||
| 1352 | 1423 | Attributes: | |
@@ -1355,6 +1426,13 @@ class MessageTransform(proto.Message): | |||
| 1355 | 1426 | JavaScriptUDF's are specified on a resource, each must have | |
| 1356 | 1427 | a unique ``function_name``. | |
| 1357 | 1428 | ||
| 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 | + | ||
| 1358 | 1436 | This field is a member of `oneof`_ ``transform``. | |
| 1359 | 1437 | enabled (bool): | |
| 1360 | 1438 | Optional. This field is deprecated, use the ``disabled`` | |
@@ -1370,6 +1448,12 @@ class MessageTransform(proto.Message): | |||
| 1370 | 1448 | oneof="transform", | |
| 1371 | 1449 | message="JavaScriptUDF", | |
| 1372 | 1450 | ) | |
| 1451 | + ai_inference: "AIInference" = proto.Field( | ||
| 1452 | + proto.MESSAGE, | ||
| 1453 | + number=6, | ||
| 1454 | + oneof="transform", | ||
| 1455 | + message="AIInference", | ||
| 1456 | + ) | ||
| 1373 | 1457 | enabled: bool = proto.Field( | |
| 1374 | 1458 | proto.BOOL, | |
| 1375 | 1459 | number=3, | |
@@ -1385,10 +1469,10 @@ class Topic(proto.Message): | |||
| 1385 | 1469 | ||
| 1386 | 1470 | Attributes: | |
| 1387 | 1471 | 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 (``-``), | ||
| 1392 | 1476 | underscores (``_``), periods (``.``), tildes (``~``), plus | |
| 1393 | 1477 | (``+``) or percent signs (``%``). It must be between 3 and | |
| 1394 | 1478 | 255 characters in length, and it must not start with | |
@@ -1442,7 +1526,11 @@ class Topic(proto.Message): | |||
| 1442 | 1526 | example: | |
| 1443 | 1527 | ||
| 1444 | 1528 | "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. | ||
| 1446 | 1534 | """ | |
| 1447 | 1535 | ||
| 1448 | 1536 | class State(proto.Enum): | |
@@ -1889,8 +1977,8 @@ class Subscription(proto.Message): | |||
| 1889 | 1977 | ||
| 1890 | 1978 | Attributes: | |
| 1891 | 1979 | 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 | ||
| 1894 | 1982 | ``"projects/{project}/subscriptions/{subscription}"``. | |
| 1895 | 1983 | ``{subscription}`` must start with a letter, and contain | |
| 1896 | 1984 | only letters (``[A-Za-z]``), numbers (``[0-9]``), dashes | |
@@ -2043,7 +2131,7 @@ class Subscription(proto.Message): | |||
| 2043 | 2131 | analytics_hub_subscription_info (google.pubsub_v1.types.Subscription.AnalyticsHubSubscriptionInfo): | |
| 2044 | 2132 | Output only. Information about the associated | |
| 2045 | 2133 | Analytics Hub subscription. Only set if the | |
| 2046 | - subscritpion is created by Analytics Hub. | ||
| 2134 | + subscription is created by Analytics Hub. | ||
| 2047 | 2135 | message_transforms (MutableSequence[google.pubsub_v1.types.MessageTransform]): | |
| 2048 | 2136 | Optional. Transforms to be applied to | |
| 2049 | 2137 | messages before they are delivered to | |
@@ -2055,7 +2143,11 @@ class Subscription(proto.Message): | |||
| 2055 | 2143 | example: | |
| 2056 | 2144 | ||
| 2057 | 2145 | "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. | ||
| 2059 | 2151 | """ | |
| 2060 | 2152 | ||
| 2061 | 2153 | class State(proto.Enum): | |
@@ -2530,13 +2622,18 @@ class State(proto.Enum): | |||
| 2530 | 2622 | Cannot write to the destination because enforce_in_transit | |
| 2531 | 2623 | is set to true and the destination locations are not in the | |
| 2532 | 2624 | 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. | ||
| 2533 | 2629 | """ | |
| 2534 | 2630 | STATE_UNSPECIFIED = 0 | |
| 2535 | 2631 | ACTIVE = 1 | |
| 2536 | 2632 | PERMISSION_DENIED = 2 | |
| 2537 | 2633 | NOT_FOUND = 3 | |
| 2538 | 2634 | SCHEMA_MISMATCH = 4 | |
| 2539 | 2635 | IN_TRANSIT_LOCATION_RESTRICTION = 5 | |
| 2636 | + VERTEX_AI_LOCATION_RESTRICTION = 6 | ||
| 2540 | 2637 | ||
| 2541 | 2638 | table: str = proto.Field( | |
| 2542 | 2639 | proto.STRING, | |
@@ -2663,13 +2760,18 @@ class State(proto.Enum): | |||
| 2663 | 2760 | Cannot write to the Cloud Storage bucket due | |
| 2664 | 2761 | to an incompatibility between the topic schema | |
| 2665 | 2762 | 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. | ||
| 2666 | 2767 | """ | |
| 2667 | 2768 | STATE_UNSPECIFIED = 0 | |
| 2668 | 2769 | ACTIVE = 1 | |
| 2669 | 2770 | PERMISSION_DENIED = 2 | |
| 2670 | 2771 | NOT_FOUND = 3 | |
| 2671 | 2772 | IN_TRANSIT_LOCATION_RESTRICTION = 4 | |
| 2672 | 2773 | SCHEMA_MISMATCH = 5 | |
| 2774 | + VERTEX_AI_LOCATION_RESTRICTION = 6 | ||
| 2673 | 2775 | ||
| 2674 | 2776 | class TextConfig(proto.Message): | |
| 2675 | 2777 | r"""Configuration for writing message data in text format. | |
@@ -3354,7 +3456,11 @@ class CreateSnapshotRequest(proto.Message): | |||
| 3354 | 3456 | example: | |
| 3355 | 3457 | ||
| 3356 | 3458 | "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. | ||
| 3358 | 3464 | """ | |
| 3359 | 3465 | ||
| 3360 | 3466 | name: str = proto.Field( | |
| Back | FazBrowse Home | New Git URL |
0 commit comments