1
- // Copyright 2024 Google LLC
1
+ // Copyright 2025 Google LLC
2
2
//
3
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
4
// you may not use this file except in compliance with the License.
@@ -26,9 +26,8 @@ import "google/protobuf/field_mask.proto";
26
26
import "google/protobuf/timestamp.proto" ;
27
27
import "google/pubsub/v1/schema.proto" ;
28
28
29
- option cc_enable_arenas = true ;
30
29
option csharp_namespace = "Google.Cloud.PubSub.V1" ;
31
- option go_package = "cloud.google.com/go/pubsub/apiv1/pubsubpb;pubsubpb" ;
30
+ option go_package = "cloud.google.com/go/pubsub/v2/ apiv1/pubsubpb;pubsubpb" ;
32
31
option java_multiple_files = true ;
33
32
option java_outer_classname = "PubsubProto" ;
34
33
option java_package = "com.google.pubsub.v1" ;
@@ -550,6 +549,10 @@ message IngestionFailureEvent {
550
549
// occurs, one or more Avro objects won't be ingested.
551
550
message AvroFailureReason {}
552
551
552
+ // Set when a Pub/Sub message fails to get published due to a schema
553
+ // validation violation.
554
+ message SchemaViolationReason {}
555
+
553
556
// Failure when ingesting from a Cloud Storage source.
554
557
message CloudStorageFailure {
555
558
// Optional. Name of the Cloud Storage bucket used for ingestion.
@@ -573,6 +576,10 @@ message IngestionFailureEvent {
573
576
// being published.
574
577
ApiViolationReason api_violation_reason = 6
575
578
[(google.api.field_behavior ) = OPTIONAL ];
579
+
580
+ // Optional. The Pub/Sub message failed schema validation.
581
+ SchemaViolationReason schema_violation_reason = 7
582
+ [(google.api.field_behavior ) = OPTIONAL ];
576
583
}
577
584
}
578
585
@@ -597,6 +604,10 @@ message IngestionFailureEvent {
597
604
// being published.
598
605
ApiViolationReason api_violation_reason = 5
599
606
[(google.api.field_behavior ) = OPTIONAL ];
607
+
608
+ // Optional. The Pub/Sub message failed schema validation.
609
+ SchemaViolationReason schema_violation_reason = 6
610
+ [(google.api.field_behavior ) = OPTIONAL ];
600
611
}
601
612
}
602
613
@@ -621,6 +632,10 @@ message IngestionFailureEvent {
621
632
// being published.
622
633
ApiViolationReason api_violation_reason = 5
623
634
[(google.api.field_behavior ) = OPTIONAL ];
635
+
636
+ // Optional. The Pub/Sub message failed schema validation.
637
+ SchemaViolationReason schema_violation_reason = 6
638
+ [(google.api.field_behavior ) = OPTIONAL ];
624
639
}
625
640
}
626
641
@@ -645,6 +660,29 @@ message IngestionFailureEvent {
645
660
// being published.
646
661
ApiViolationReason api_violation_reason = 5
647
662
[(google.api.field_behavior ) = OPTIONAL ];
663
+
664
+ // Optional. The Pub/Sub message failed schema validation.
665
+ SchemaViolationReason schema_violation_reason = 6
666
+ [(google.api.field_behavior ) = OPTIONAL ];
667
+ }
668
+ }
669
+
670
+ // Failure when ingesting from an AWS Kinesis source.
671
+ message AwsKinesisFailureReason {
672
+ // Optional. The stream ARN of the Kinesis stream being ingested from.
673
+ string stream_arn = 1 [(google.api.field_behavior ) = OPTIONAL ];
674
+
675
+ // Optional. The partition key of the message that failed to be ingested.
676
+ string partition_key = 2 [(google.api.field_behavior ) = OPTIONAL ];
677
+
678
+ // Optional. The sequence number of the message that failed to be ingested.
679
+ string sequence_number = 3 [(google.api.field_behavior ) = OPTIONAL ];
680
+
681
+ // Reason why ingestion failed for the specified message.
682
+ oneof reason {
683
+ // Optional. The Pub/Sub message failed schema validation.
684
+ SchemaViolationReason schema_violation_reason = 4
685
+ [(google.api.field_behavior ) = OPTIONAL ];
648
686
}
649
687
}
650
688
@@ -671,7 +709,69 @@ message IngestionFailureEvent {
671
709
// Optional. Failure when ingesting from Confluent Cloud.
672
710
ConfluentCloudFailureReason confluent_cloud_failure = 6
673
711
[(google.api.field_behavior ) = OPTIONAL ];
712
+
713
+ // Optional. Failure when ingesting from AWS Kinesis.
714
+ AwsKinesisFailureReason aws_kinesis_failure = 7
715
+ [(google.api.field_behavior ) = OPTIONAL ];
716
+ }
717
+ }
718
+
719
+ // User-defined JavaScript function that can transform or filter a Pub/Sub
720
+ // message.
721
+ message JavaScriptUDF {
722
+ // Required. Name of the JavasScript function that should applied to Pub/Sub
723
+ // messages.
724
+ string function_name = 1 [(google.api.field_behavior ) = REQUIRED ];
725
+
726
+ // Required. JavaScript code that contains a function `function_name` with the
727
+ // below signature:
728
+ //
729
+ // ```
730
+ // /**
731
+ // * Transforms a Pub/Sub message.
732
+ //
733
+ // * @return {(Object<string, (string | Object<string, string>)>|null)} - To
734
+ // * filter a message, return `null`. To transform a message return a map
735
+ // * with the following keys:
736
+ // * - (required) 'data' : {string}
737
+ // * - (optional) 'attributes' : {Object<string, string>}
738
+ // * Returning empty `attributes` will remove all attributes from the
739
+ // * message.
740
+ // *
741
+ // * @param {(Object<string, (string | Object<string, string>)>} Pub/Sub
742
+ // * message. Keys:
743
+ // * - (required) 'data' : {string}
744
+ // * - (required) 'attributes' : {Object<string, string>}
745
+ // *
746
+ // * @param {Object<string, any>} metadata - Pub/Sub message metadata.
747
+ // * Keys:
748
+ // * - (optional) 'message_id' : {string}
749
+ // * - (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
750
+ // * - (optional) 'ordering_key': {string}
751
+ // */
752
+ //
753
+ // function <function_name>(message, metadata) {
754
+ // }
755
+ // ```
756
+ string code = 2 [(google.api.field_behavior ) = REQUIRED ];
757
+ }
758
+
759
+ // All supported message transforms types.
760
+ message MessageTransform {
761
+ // The type of transform to apply to messages.
762
+ oneof transform {
763
+ // Optional. JavaScript User Defined Function. If multiple JavaScriptUDF's
764
+ // are specified on a resource, each must have a unique `function_name`.
765
+ JavaScriptUDF javascript_udf = 2 [(google.api.field_behavior ) = OPTIONAL ];
674
766
}
767
+
768
+ // Optional. This field is deprecated, use the `disabled` field to disable
769
+ // transforms.
770
+ bool enabled = 3 [deprecated = true , (google.api.field_behavior ) = OPTIONAL ];
771
+
772
+ // Optional. If true, the transform is disabled and will not be applied to
773
+ // messages. Defaults to `false`.
774
+ bool disabled = 4 [(google.api.field_behavior ) = OPTIONAL ];
675
775
}
676
776
677
777
// A topic resource.
@@ -680,6 +780,8 @@ message Topic {
680
780
type : "pubsub.googleapis.com/Topic"
681
781
pattern : "projects/{project}/topics/{topic}"
682
782
pattern : "_deleted-topic_"
783
+ plural : "topics"
784
+ singular : "topic"
683
785
};
684
786
685
787
// The state of the topic.
@@ -745,6 +847,11 @@ message Topic {
745
847
// Optional. Settings for ingestion from a data source into this topic.
746
848
IngestionDataSourceSettings ingestion_data_source_settings = 10
747
849
[(google.api.field_behavior ) = OPTIONAL ];
850
+
851
+ // Optional. Transforms to be applied to messages published to the topic.
852
+ // Transforms are applied in the order specified.
853
+ repeated MessageTransform message_transforms = 13
854
+ [(google.api.field_behavior ) = OPTIONAL ];
748
855
}
749
856
750
857
// A message that is published by publishers and consumed by subscribers. The
@@ -1064,7 +1171,7 @@ service Subscriber {
1064
1171
}
1065
1172
1066
1173
// Establishes a stream with the server, which sends messages down to the
1067
- // client. The client streams acknowledgements and ack deadline modifications
1174
+ // client. The client streams acknowledgments and ack deadline modifications
1068
1175
// back to the server. The server will close the stream and return the status
1069
1176
// on any error. The server may close the stream with status `UNAVAILABLE` to
1070
1177
// reassign server-side resources, in which case, the client should
@@ -1188,6 +1295,8 @@ message Subscription {
1188
1295
option (google.api.resource ) = {
1189
1296
type : "pubsub.googleapis.com/Subscription"
1190
1297
pattern : "projects/{project}/subscriptions/{subscription}"
1298
+ plural : "subscriptions"
1299
+ singular : "subscription"
1191
1300
};
1192
1301
1193
1302
// Possible states for a subscription.
@@ -1204,8 +1313,8 @@ message Subscription {
1204
1313
RESOURCE_ERROR = 2 ;
1205
1314
}
1206
1315
1207
- // Information about an associated Analytics Hub subscription
1208
- // (https://cloud.google.com/bigquery/docs/analytics-hub-manage-subscriptions).
1316
+ // Information about an associated [ Analytics Hub
1317
+ // subscription] (https://cloud.google.com/bigquery/docs/analytics-hub-manage-subscriptions).
1209
1318
message AnalyticsHubSubscriptionInfo {
1210
1319
// Optional. The name of the associated Analytics Hub listing resource.
1211
1320
// Pattern:
@@ -1328,8 +1437,8 @@ message Subscription {
1328
1437
//
1329
1438
// If not set, the default retry policy is applied. This generally implies
1330
1439
// that messages will be retried as soon as possible for healthy subscribers.
1331
- // RetryPolicy will be triggered on NACKs or acknowledgement deadline
1332
- // exceeded events for a given message.
1440
+ // RetryPolicy will be triggered on NACKs or acknowledgment deadline exceeded
1441
+ // events for a given message.
1333
1442
RetryPolicy retry_policy = 14 [(google.api.field_behavior ) = OPTIONAL ];
1334
1443
1335
1444
// Optional. Indicates whether the subscription is detached from its topic.
@@ -1344,7 +1453,7 @@ message Subscription {
1344
1453
// subscription:
1345
1454
//
1346
1455
// * The message sent to a subscriber is guaranteed not to be resent
1347
- // before the message's acknowledgement deadline expires.
1456
+ // before the message's acknowledgment deadline expires.
1348
1457
// * An acknowledged message will not be resent to a subscriber.
1349
1458
//
1350
1459
// Note that subscribers may still receive multiple copies of a message
@@ -1371,14 +1480,19 @@ message Subscription {
1371
1480
// Only set if the subscritpion is created by Analytics Hub.
1372
1481
AnalyticsHubSubscriptionInfo analytics_hub_subscription_info = 23
1373
1482
[(google.api.field_behavior ) = OUTPUT_ONLY ];
1483
+
1484
+ // Optional. Transforms to be applied to messages before they are delivered to
1485
+ // subscribers. Transforms are applied in the order specified.
1486
+ repeated MessageTransform message_transforms = 25
1487
+ [(google.api.field_behavior ) = OPTIONAL ];
1374
1488
}
1375
1489
1376
1490
// A policy that specifies how Pub/Sub retries message delivery.
1377
1491
//
1378
1492
// Retry delay will be exponential based on provided minimum and maximum
1379
1493
// backoffs. https://en.wikipedia.org/wiki/Exponential_backoff.
1380
1494
//
1381
- // RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded
1495
+ // RetryPolicy will be triggered on NACKs or acknowledgment deadline exceeded
1382
1496
// events for a given message.
1383
1497
//
1384
1498
// Retry Policy is implemented on a best effort basis. At times, the delay
@@ -1418,7 +1532,7 @@ message DeadLetterPolicy {
1418
1532
// value must be between 5 and 100.
1419
1533
//
1420
1534
// The number of delivery attempts is defined as 1 + (the sum of number of
1421
- // NACKs and number of times the acknowledgement deadline has been exceeded
1535
+ // NACKs and number of times the acknowledgment deadline has been exceeded
1422
1536
// for the message).
1423
1537
//
1424
1538
// A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
@@ -1680,7 +1794,7 @@ message CloudStorageConfig {
1680
1794
1681
1795
// Optional. The maximum duration that can elapse before a new Cloud Storage
1682
1796
// file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not
1683
- // exceed the subscription's acknowledgement deadline.
1797
+ // exceed the subscription's acknowledgment deadline.
1684
1798
google.protobuf.Duration max_duration = 6
1685
1799
[(google.api.field_behavior ) = OPTIONAL ];
1686
1800
@@ -1902,7 +2016,7 @@ message AcknowledgeRequest {
1902
2016
}
1903
2017
1904
2018
// Request for the `StreamingPull` streaming RPC method. This request is used to
1905
- // establish the initial stream as well as to stream acknowledgements and ack
2019
+ // establish the initial stream as well as to stream acknowledgments and ack
1906
2020
// deadline modifications from the client to the server.
1907
2021
message StreamingPullRequest {
1908
2022
// Required. The subscription for which to initialize the new stream. This
@@ -1916,12 +2030,11 @@ message StreamingPullRequest {
1916
2030
}
1917
2031
];
1918
2032
1919
- // Optional. List of acknowledgement IDs for acknowledging previously received
2033
+ // Optional. List of acknowledgment IDs for acknowledging previously received
1920
2034
// messages (received on this stream or a different stream). If an ack ID has
1921
2035
// expired, the corresponding message may be redelivered later. Acknowledging
1922
- // a message more than once will not result in an error. If the
1923
- // acknowledgement ID is malformed, the stream will be aborted with status
1924
- // `INVALID_ARGUMENT`.
2036
+ // a message more than once will not result in an error. If the acknowledgment
2037
+ // ID is malformed, the stream will be aborted with status `INVALID_ARGUMENT`.
1925
2038
repeated string ack_ids = 2 [(google.api.field_behavior ) = OPTIONAL ];
1926
2039
1927
2040
// Optional. The list of new ack deadlines for the IDs listed in
@@ -1938,7 +2051,7 @@ message StreamingPullRequest {
1938
2051
repeated int32 modify_deadline_seconds = 3
1939
2052
[(google.api.field_behavior ) = OPTIONAL ];
1940
2053
1941
- // Optional. List of acknowledgement IDs whose deadline will be modified based
2054
+ // Optional. List of acknowledgment IDs whose deadline will be modified based
1942
2055
// on the corresponding element in `modify_deadline_seconds`. This field can
1943
2056
// be used to indicate that more time is needed to process a message by the
1944
2057
// subscriber, or to make the message available for redelivery if the
@@ -1987,39 +2100,39 @@ message StreamingPullRequest {
1987
2100
// Response for the `StreamingPull` method. This response is used to stream
1988
2101
// messages from the server to the client.
1989
2102
message StreamingPullResponse {
1990
- // Acknowledgement IDs sent in one or more previous requests to acknowledge a
2103
+ // Acknowledgment IDs sent in one or more previous requests to acknowledge a
1991
2104
// previously received message.
1992
2105
message AcknowledgeConfirmation {
1993
- // Optional. Successfully processed acknowledgement IDs.
2106
+ // Optional. Successfully processed acknowledgment IDs.
1994
2107
repeated string ack_ids = 1 [(google.api.field_behavior ) = OPTIONAL ];
1995
2108
1996
- // Optional. List of acknowledgement IDs that were malformed or whose
1997
- // acknowledgement deadline has expired.
2109
+ // Optional. List of acknowledgment IDs that were malformed or whose
2110
+ // acknowledgment deadline has expired.
1998
2111
repeated string invalid_ack_ids = 2
1999
2112
[(google.api.field_behavior ) = OPTIONAL ];
2000
2113
2001
- // Optional. List of acknowledgement IDs that were out of order.
2114
+ // Optional. List of acknowledgment IDs that were out of order.
2002
2115
repeated string unordered_ack_ids = 3
2003
2116
[(google.api.field_behavior ) = OPTIONAL ];
2004
2117
2005
- // Optional. List of acknowledgement IDs that failed processing with
2118
+ // Optional. List of acknowledgment IDs that failed processing with
2006
2119
// temporary issues.
2007
2120
repeated string temporary_failed_ack_ids = 4
2008
2121
[(google.api.field_behavior ) = OPTIONAL ];
2009
2122
}
2010
2123
2011
- // Acknowledgement IDs sent in one or more previous requests to modify the
2124
+ // Acknowledgment IDs sent in one or more previous requests to modify the
2012
2125
// deadline for a specific message.
2013
2126
message ModifyAckDeadlineConfirmation {
2014
- // Optional. Successfully processed acknowledgement IDs.
2127
+ // Optional. Successfully processed acknowledgment IDs.
2015
2128
repeated string ack_ids = 1 [(google.api.field_behavior ) = OPTIONAL ];
2016
2129
2017
- // Optional. List of acknowledgement IDs that were malformed or whose
2018
- // acknowledgement deadline has expired.
2130
+ // Optional. List of acknowledgment IDs that were malformed or whose
2131
+ // acknowledgment deadline has expired.
2019
2132
repeated string invalid_ack_ids = 2
2020
2133
[(google.api.field_behavior ) = OPTIONAL ];
2021
2134
2022
- // Optional. List of acknowledgement IDs that failed processing with
2135
+ // Optional. List of acknowledgment IDs that failed processing with
2023
2136
// temporary issues.
2024
2137
repeated string temporary_failed_ack_ids = 3
2025
2138
[(google.api.field_behavior ) = OPTIONAL ];
@@ -2109,6 +2222,8 @@ message Snapshot {
2109
2222
option (google.api.resource ) = {
2110
2223
type : "pubsub.googleapis.com/Snapshot"
2111
2224
pattern : "projects/{project}/snapshots/{snapshot}"
2225
+ plural : "snapshots"
2226
+ singular : "snapshot"
2112
2227
};
2113
2228
2114
2229
// Optional. The name of the snapshot.
0 commit comments