Skip to content

Commit 8ab13e1

Browse files
feat: Add MessageTransformationFailureReason to IngestionFailureEvent (#1427)
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent e081beb commit 8ab13e1

File tree

2 files changed

+71
-3
lines changed

2 files changed

+71
-3
lines changed

google/pubsub_v1/types/pubsub.py

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,12 @@ class SchemaViolationReason(proto.Message):
861861
862862
"""
863863

864+
class MessageTransformationFailureReason(proto.Message):
865+
r"""Set when a Pub/Sub message fails to get published due to a
866+
message transformation error.
867+
868+
"""
869+
864870
class CloudStorageFailure(proto.Message):
865871
r"""Failure when ingesting from a Cloud Storage source.
866872
@@ -897,6 +903,11 @@ class CloudStorageFailure(proto.Message):
897903
Optional. The Pub/Sub message failed schema
898904
validation.
899905
906+
This field is a member of `oneof`_ ``reason``.
907+
message_transformation_failure_reason (google.pubsub_v1.types.IngestionFailureEvent.MessageTransformationFailureReason):
908+
Optional. Failure encountered when applying a
909+
message transformation to the Pub/Sub message.
910+
900911
This field is a member of `oneof`_ ``reason``.
901912
"""
902913

@@ -932,6 +943,12 @@ class CloudStorageFailure(proto.Message):
932943
message="IngestionFailureEvent.SchemaViolationReason",
933944
)
934945
)
946+
message_transformation_failure_reason: "IngestionFailureEvent.MessageTransformationFailureReason" = proto.Field(
947+
proto.MESSAGE,
948+
number=8,
949+
oneof="reason",
950+
message="IngestionFailureEvent.MessageTransformationFailureReason",
951+
)
935952

936953
class AwsMskFailureReason(proto.Message):
937954
r"""Failure when ingesting from an Amazon MSK source.
@@ -965,6 +982,11 @@ class AwsMskFailureReason(proto.Message):
965982
Optional. The Pub/Sub message failed schema
966983
validation.
967984
985+
This field is a member of `oneof`_ ``reason``.
986+
message_transformation_failure_reason (google.pubsub_v1.types.IngestionFailureEvent.MessageTransformationFailureReason):
987+
Optional. Failure encountered when applying a
988+
message transformation to the Pub/Sub message.
989+
968990
This field is a member of `oneof`_ ``reason``.
969991
"""
970992

@@ -998,6 +1020,12 @@ class AwsMskFailureReason(proto.Message):
9981020
message="IngestionFailureEvent.SchemaViolationReason",
9991021
)
10001022
)
1023+
message_transformation_failure_reason: "IngestionFailureEvent.MessageTransformationFailureReason" = proto.Field(
1024+
proto.MESSAGE,
1025+
number=7,
1026+
oneof="reason",
1027+
message="IngestionFailureEvent.MessageTransformationFailureReason",
1028+
)
10011029

10021030
class AzureEventHubsFailureReason(proto.Message):
10031031
r"""Failure when ingesting from an Azure Event Hubs source.
@@ -1031,6 +1059,11 @@ class AzureEventHubsFailureReason(proto.Message):
10311059
Optional. The Pub/Sub message failed schema
10321060
validation.
10331061
1062+
This field is a member of `oneof`_ ``reason``.
1063+
message_transformation_failure_reason (google.pubsub_v1.types.IngestionFailureEvent.MessageTransformationFailureReason):
1064+
Optional. Failure encountered when applying a
1065+
message transformation to the Pub/Sub message.
1066+
10341067
This field is a member of `oneof`_ ``reason``.
10351068
"""
10361069

@@ -1064,6 +1097,12 @@ class AzureEventHubsFailureReason(proto.Message):
10641097
message="IngestionFailureEvent.SchemaViolationReason",
10651098
)
10661099
)
1100+
message_transformation_failure_reason: "IngestionFailureEvent.MessageTransformationFailureReason" = proto.Field(
1101+
proto.MESSAGE,
1102+
number=7,
1103+
oneof="reason",
1104+
message="IngestionFailureEvent.MessageTransformationFailureReason",
1105+
)
10671106

10681107
class ConfluentCloudFailureReason(proto.Message):
10691108
r"""Failure when ingesting from a Confluent Cloud source.
@@ -1097,6 +1136,11 @@ class ConfluentCloudFailureReason(proto.Message):
10971136
Optional. The Pub/Sub message failed schema
10981137
validation.
10991138
1139+
This field is a member of `oneof`_ ``reason``.
1140+
message_transformation_failure_reason (google.pubsub_v1.types.IngestionFailureEvent.MessageTransformationFailureReason):
1141+
Optional. Failure encountered when applying a
1142+
message transformation to the Pub/Sub message.
1143+
11001144
This field is a member of `oneof`_ ``reason``.
11011145
"""
11021146

@@ -1130,10 +1174,21 @@ class ConfluentCloudFailureReason(proto.Message):
11301174
message="IngestionFailureEvent.SchemaViolationReason",
11311175
)
11321176
)
1177+
message_transformation_failure_reason: "IngestionFailureEvent.MessageTransformationFailureReason" = proto.Field(
1178+
proto.MESSAGE,
1179+
number=7,
1180+
oneof="reason",
1181+
message="IngestionFailureEvent.MessageTransformationFailureReason",
1182+
)
11331183

11341184
class AwsKinesisFailureReason(proto.Message):
11351185
r"""Failure when ingesting from an AWS Kinesis source.
11361186
1187+
This message has `oneof`_ fields (mutually exclusive fields).
1188+
For each oneof, at most one member field can be set at the same time.
1189+
Setting any member of the oneof automatically clears all other
1190+
members.
1191+
11371192
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
11381193
11391194
Attributes:
@@ -1150,6 +1205,11 @@ class AwsKinesisFailureReason(proto.Message):
11501205
Optional. The Pub/Sub message failed schema
11511206
validation.
11521207
1208+
This field is a member of `oneof`_ ``reason``.
1209+
message_transformation_failure_reason (google.pubsub_v1.types.IngestionFailureEvent.MessageTransformationFailureReason):
1210+
Optional. Failure encountered when applying a
1211+
message transformation to the Pub/Sub message.
1212+
11531213
This field is a member of `oneof`_ ``reason``.
11541214
"""
11551215

@@ -1173,6 +1233,12 @@ class AwsKinesisFailureReason(proto.Message):
11731233
message="IngestionFailureEvent.SchemaViolationReason",
11741234
)
11751235
)
1236+
message_transformation_failure_reason: "IngestionFailureEvent.MessageTransformationFailureReason" = proto.Field(
1237+
proto.MESSAGE,
1238+
number=5,
1239+
oneof="reason",
1240+
message="IngestionFailureEvent.MessageTransformationFailureReason",
1241+
)
11761242

11771243
topic: str = proto.Field(
11781244
proto.STRING,
@@ -3091,10 +3157,12 @@ class StreamingPullResponse(proto.Message):
30913157
will not be empty.
30923158
acknowledge_confirmation (google.pubsub_v1.types.StreamingPullResponse.AcknowledgeConfirmation):
30933159
Optional. This field will only be set if
3094-
``enable_exactly_once_delivery`` is set to ``true``.
3160+
``enable_exactly_once_delivery`` is set to ``true`` and is
3161+
not guaranteed to be populated.
30953162
modify_ack_deadline_confirmation (google.pubsub_v1.types.StreamingPullResponse.ModifyAckDeadlineConfirmation):
30963163
Optional. This field will only be set if
3097-
``enable_exactly_once_delivery`` is set to ``true``.
3164+
``enable_exactly_once_delivery`` is set to ``true`` and is
3165+
not guaranteed to be populated.
30983166
subscription_properties (google.pubsub_v1.types.StreamingPullResponse.SubscriptionProperties):
30993167
Optional. Properties associated with this
31003168
subscription.

samples/generated_samples/snippet_metadata_google.pubsub.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-pubsub",
11-
"version": "2.30.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)