Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed Jan 30, 2025
1 parent a47ef5c commit 5e04a2a
Show file tree
Hide file tree
Showing 150 changed files with 150 additions and 75,360 deletions.
4 changes: 4 additions & 0 deletions google/pubsub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
from google.pubsub_v1.types.pubsub import GetTopicRequest
from google.pubsub_v1.types.pubsub import IngestionDataSourceSettings
from google.pubsub_v1.types.pubsub import IngestionFailureEvent
from google.pubsub_v1.types.pubsub import JavaScriptUDF
from google.pubsub_v1.types.pubsub import ListSnapshotsRequest
from google.pubsub_v1.types.pubsub import ListSnapshotsResponse
from google.pubsub_v1.types.pubsub import ListSubscriptionsRequest
Expand All @@ -54,6 +55,7 @@
from google.pubsub_v1.types.pubsub import ListTopicSubscriptionsRequest
from google.pubsub_v1.types.pubsub import ListTopicSubscriptionsResponse
from google.pubsub_v1.types.pubsub import MessageStoragePolicy
from google.pubsub_v1.types.pubsub import MessageTransform
from google.pubsub_v1.types.pubsub import ModifyAckDeadlineRequest
from google.pubsub_v1.types.pubsub import ModifyPushConfigRequest
from google.pubsub_v1.types.pubsub import PlatformLogsSettings
Expand Down Expand Up @@ -117,6 +119,7 @@
"GetTopicRequest",
"IngestionDataSourceSettings",
"IngestionFailureEvent",
"JavaScriptUDF",
"ListSnapshotsRequest",
"ListSnapshotsResponse",
"ListSubscriptionsRequest",
Expand All @@ -128,6 +131,7 @@
"ListTopicSubscriptionsRequest",
"ListTopicSubscriptionsResponse",
"MessageStoragePolicy",
"MessageTransform",
"ModifyAckDeadlineRequest",
"ModifyPushConfigRequest",
"PlatformLogsSettings",
Expand Down
4 changes: 4 additions & 0 deletions google/pubsub_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from .types.pubsub import GetTopicRequest
from .types.pubsub import IngestionDataSourceSettings
from .types.pubsub import IngestionFailureEvent
from .types.pubsub import JavaScriptUDF
from .types.pubsub import ListSnapshotsRequest
from .types.pubsub import ListSnapshotsResponse
from .types.pubsub import ListSubscriptionsRequest
Expand All @@ -52,6 +53,7 @@
from .types.pubsub import ListTopicSubscriptionsRequest
from .types.pubsub import ListTopicSubscriptionsResponse
from .types.pubsub import MessageStoragePolicy
from .types.pubsub import MessageTransform
from .types.pubsub import ModifyAckDeadlineRequest
from .types.pubsub import ModifyPushConfigRequest
from .types.pubsub import PlatformLogsSettings
Expand Down Expand Up @@ -118,6 +120,7 @@
"GetTopicRequest",
"IngestionDataSourceSettings",
"IngestionFailureEvent",
"JavaScriptUDF",
"ListSchemaRevisionsRequest",
"ListSchemaRevisionsResponse",
"ListSchemasRequest",
Expand All @@ -133,6 +136,7 @@
"ListTopicsRequest",
"ListTopicsResponse",
"MessageStoragePolicy",
"MessageTransform",
"ModifyAckDeadlineRequest",
"ModifyPushConfigRequest",
"PlatformLogsSettings",
Expand Down
4 changes: 4 additions & 0 deletions google/pubsub_v1/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
GetTopicRequest,
IngestionDataSourceSettings,
IngestionFailureEvent,
JavaScriptUDF,
ListSnapshotsRequest,
ListSnapshotsResponse,
ListSubscriptionsRequest,
Expand All @@ -43,6 +44,7 @@
ListTopicSubscriptionsRequest,
ListTopicSubscriptionsResponse,
MessageStoragePolicy,
MessageTransform,
ModifyAckDeadlineRequest,
ModifyPushConfigRequest,
PlatformLogsSettings,
Expand Down Expand Up @@ -112,6 +114,7 @@
"GetTopicRequest",
"IngestionDataSourceSettings",
"IngestionFailureEvent",
"JavaScriptUDF",
"ListSnapshotsRequest",
"ListSnapshotsResponse",
"ListSubscriptionsRequest",
Expand All @@ -123,6 +126,7 @@
"ListTopicSubscriptionsRequest",
"ListTopicSubscriptionsResponse",
"MessageStoragePolicy",
"MessageTransform",
"ModifyAckDeadlineRequest",
"ModifyPushConfigRequest",
"PlatformLogsSettings",
Expand Down
138 changes: 136 additions & 2 deletions google/pubsub_v1/types/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"IngestionDataSourceSettings",
"PlatformLogsSettings",
"IngestionFailureEvent",
"JavaScriptUDF",
"MessageTransform",
"Topic",
"PubsubMessage",
"GetTopicRequest",
Expand Down Expand Up @@ -1085,6 +1087,119 @@ class ConfluentCloudFailureReason(proto.Message):
)


class JavaScriptUDF(proto.Message):
r"""User-defined JavaScript function that can transform or filter
a Pub/Sub message.
Attributes:
function_name (str):
Required. Name of the JavasScript function
that should applied to Pub/Sub messages.
code (str):
Required. JavaScript code that contains a function
``function_name`` with the below signature:
/*\*
- Transforms a Pub/Sub message.
- @return {(Object<string, (string \| Object<string,
string>)>|null)} - To
- filter a message, return ``null``. To transform a message
return a map
- with the following keys:
-
- (required) 'data' : {string}
-
- (optional) 'attributes' : {Object<string, string>}
- Returning empty ``attributes`` will remove all attributes
from the
- message.
-
- @param {(Object<string, (string \| Object<string,
string>)>} Pub/Sub
- message. Keys:
-
- (required) 'data' : {string}
-
- (required) 'attributes' : {Object<string, string>}
-
- @param {Object<string, any>} metadata - Pub/Sub message
metadata.
- Keys:
-
- (required) 'message_id' : {string}
-
- (optional) 'publish_time': {string}
YYYY-MM-DDTHH:MM:SSZ format
-
- (optional) 'ordering_key': {string} \*/
function <function_name>(message, metadata) { }
"""

function_name: str = proto.Field(
proto.STRING,
number=1,
)
code: str = proto.Field(
proto.STRING,
number=2,
)


class MessageTransform(proto.Message):
r"""All supported message transforms types.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
javascript_udf (google.pubsub_v1.types.JavaScriptUDF):
Optional. JavaScript User Defined Function. If multiple
JavaScriptUDF's are specified on a resource, each must have
a unique ``function_name``.
This field is a member of `oneof`_ ``transform``.
enabled (bool):
Optional. If set to true, the transform is enabled. If
false, the transform is disabled and will not be applied to
messages. Defaults to ``true``.
"""

javascript_udf: "JavaScriptUDF" = proto.Field(
proto.MESSAGE,
number=2,
oneof="transform",
message="JavaScriptUDF",
)
enabled: bool = proto.Field(
proto.BOOL,
number=3,
)


class Topic(proto.Message):
r"""A topic resource.
Expand Down Expand Up @@ -1137,6 +1252,10 @@ class Topic(proto.Message):
ingestion_data_source_settings (google.pubsub_v1.types.IngestionDataSourceSettings):
Optional. Settings for ingestion from a data
source into this topic.
message_transforms (MutableSequence[google.pubsub_v1.types.MessageTransform]):
Optional. Transforms to be applied to
messages published to the topic. Transforms are
applied in the order specified.
"""

class State(proto.Enum):
Expand Down Expand Up @@ -1200,6 +1319,11 @@ class State(proto.Enum):
number=10,
message="IngestionDataSourceSettings",
)
message_transforms: MutableSequence["MessageTransform"] = proto.RepeatedField(
proto.MESSAGE,
number=13,
message="MessageTransform",
)


class PubsubMessage(proto.Message):
Expand Down Expand Up @@ -1728,6 +1852,11 @@ class Subscription(proto.Message):
Output only. Information about the associated
Analytics Hub subscription. Only set if the
subscritpion is created by Analytics Hub.
message_transforms (MutableSequence[google.pubsub_v1.types.MessageTransform]):
Optional. Transforms to be applied to
messages before they are delivered to
subscribers. Transforms are applied in the order
specified.
"""

class State(proto.Enum):
Expand All @@ -1750,8 +1879,8 @@ class State(proto.Enum):
RESOURCE_ERROR = 2

class AnalyticsHubSubscriptionInfo(proto.Message):
r"""Information about an associated Analytics Hub subscription
(https://cloud.google.com/bigquery/docs/analytics-hub-manage-subscriptions).
r"""Information about an associated `Analytics Hub
subscription <https://cloud.google.com/bigquery/docs/analytics-hub-manage-subscriptions>`__.
Attributes:
listing (str):
Expand Down Expand Up @@ -1861,6 +1990,11 @@ class AnalyticsHubSubscriptionInfo(proto.Message):
number=23,
message=AnalyticsHubSubscriptionInfo,
)
message_transforms: MutableSequence["MessageTransform"] = proto.RepeatedField(
proto.MESSAGE,
number=25,
message="MessageTransform",
)


class RetryPolicy(proto.Message):
Expand Down
13 changes: 0 additions & 13 deletions owl-bot-staging/v1/.coveragerc

This file was deleted.

33 changes: 0 additions & 33 deletions owl-bot-staging/v1/.flake8

This file was deleted.

2 changes: 0 additions & 2 deletions owl-bot-staging/v1/MANIFEST.in

This file was deleted.

49 changes: 0 additions & 49 deletions owl-bot-staging/v1/README.rst

This file was deleted.

3 changes: 0 additions & 3 deletions owl-bot-staging/v1/docs/_static/custom.css

This file was deleted.

Loading

0 comments on commit 5e04a2a

Please sign in to comment.