Skip to content

Commit f61a64a

Browse files
feat: add cloud storage subscription fields (#1724)
* feat: add cloud storage subscription fields PiperOrigin-RevId: 531202368 Source-Link: googleapis/googleapis@8a4cc94 Source-Link: googleapis/googleapis-gen@ec60ad7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWM2MGFkNzYzNTZkODhlOTlmYTQ4NDRmYmQ5MGZkY2NhNzI4ZjVjYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent e528233 commit f61a64a

File tree

7 files changed

+1403
-18
lines changed

7 files changed

+1403
-18
lines changed

protos/google/pubsub/v1/pubsub.proto

+80-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -647,9 +647,9 @@ service Subscriber {
647647
}
648648
}
649649

650-
// A subscription resource. If none of `push_config` or `bigquery_config` is
651-
// set, then the subscriber will pull and ack messages using API methods. At
652-
// most one of these fields may be set.
650+
// A subscription resource. If none of `push_config`, `bigquery_config`, or
651+
// `cloud_storage_config` is set, then the subscriber will pull and ack messages
652+
// using API methods. At most one of these fields may be set.
653653
message Subscription {
654654
option (google.api.resource) = {
655655
type: "pubsub.googleapis.com/Subscription"
@@ -694,6 +694,10 @@ message Subscription {
694694
// used to configure it.
695695
BigQueryConfig bigquery_config = 18;
696696

697+
// If delivery to Google Cloud Storage is used with this subscription, this
698+
// field is used to configure it.
699+
CloudStorageConfig cloud_storage_config = 22;
700+
697701
// The approximate amount of time (on a best-effort basis) Pub/Sub waits for
698702
// the subscriber to acknowledge receipt before resending the message. In the
699703
// interval after the message is delivered and before it is acknowledged, it
@@ -885,9 +889,9 @@ message PushConfig {
885889
message OidcToken {
886890
// [Service account
887891
// email](https://cloud.google.com/iam/docs/service-accounts)
888-
// to be used for generating the OIDC token. The caller (for
889-
// CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must
890-
// have the iam.serviceAccounts.actAs permission for the service account.
892+
// used for generating the OIDC token. For more information
893+
// on setting up authentication, see
894+
// [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
891895
string service_account_email = 1;
892896

893897
// Audience to be used when generating OIDC token. The audience claim
@@ -990,6 +994,75 @@ message BigQueryConfig {
990994
State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
991995
}
992996

997+
// Configuration for a Cloud Storage subscription.
998+
message CloudStorageConfig {
999+
// Configuration for writing message data in text format.
1000+
// Message payloads will be written to files as raw text, separated by a
1001+
// newline.
1002+
message TextConfig {}
1003+
1004+
// Configuration for writing message data in Avro format.
1005+
// Message payloads and metadata will be written to files as an Avro binary.
1006+
message AvroConfig {
1007+
// When true, write the subscription name, message_id, publish_time,
1008+
// attributes, and ordering_key as additional fields in the output.
1009+
bool write_metadata = 1;
1010+
}
1011+
1012+
// Possible states for a Cloud Storage subscription.
1013+
enum State {
1014+
// Default value. This value is unused.
1015+
STATE_UNSPECIFIED = 0;
1016+
1017+
// The subscription can actively send messages to Cloud Storage.
1018+
ACTIVE = 1;
1019+
1020+
// Cannot write to the Cloud Storage bucket because of permission denied
1021+
// errors.
1022+
PERMISSION_DENIED = 2;
1023+
1024+
// Cannot write to the Cloud Storage bucket because it does not exist.
1025+
NOT_FOUND = 3;
1026+
}
1027+
1028+
// Required. User-provided name for the Cloud Storage bucket.
1029+
// The bucket must be created by the user. The bucket name must be without
1030+
// any prefix like "gs://". See the [bucket naming
1031+
// requirements] (https://cloud.google.com/storage/docs/buckets#naming).
1032+
string bucket = 1 [(google.api.field_behavior) = REQUIRED];
1033+
1034+
// User-provided prefix for Cloud Storage filename. See the [object naming
1035+
// requirements](https://cloud.google.com/storage/docs/objects#naming).
1036+
string filename_prefix = 2;
1037+
1038+
// User-provided suffix for Cloud Storage filename. See the [object naming
1039+
// requirements](https://cloud.google.com/storage/docs/objects#naming).
1040+
string filename_suffix = 3;
1041+
1042+
// Defaults to text format.
1043+
oneof output_format {
1044+
// If set, message data will be written to Cloud Storage in text format.
1045+
TextConfig text_config = 4;
1046+
1047+
// If set, message data will be written to Cloud Storage in Avro format.
1048+
AvroConfig avro_config = 5;
1049+
}
1050+
1051+
// The maximum duration that can elapse before a new Cloud Storage file is
1052+
// created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
1053+
// the subscription's acknowledgement deadline.
1054+
google.protobuf.Duration max_duration = 6;
1055+
1056+
// The maximum bytes that can be written to a Cloud Storage file before a new
1057+
// file is created. Min 1 KB, max 10 GiB. The max_bytes limit may be exceeded
1058+
// in cases where messages are larger than the limit.
1059+
int64 max_bytes = 7;
1060+
1061+
// Output only. An output-only field that indicates whether or not the
1062+
// subscription can receive messages.
1063+
State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
1064+
}
1065+
9931066
// A message and its corresponding acknowledgment ID.
9941067
message ReceivedMessage {
9951068
// This ID can be used to acknowledge the received message.

protos/google/pubsub/v1/schema.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)