Skip to content

Commit c9bd93c

Browse files
feat: Annotate some resource fields with their corresponding API types
feat: Add AwsKinesisFailureReason.ApiViolationReason feat: Add tags to Subscription, Topic, and CreateSnapshotRequest messages for use in CreateSubscription, CreateTopic, and CreateSnapshot requests respectively docs: A comment for field `received_messages` in message `.google.pubsub.v1.StreamingPullResponse` is changed PiperOrigin-RevId: 820071518 Source-Link: googleapis/googleapis@e938992 Source-Link: googleapis/googleapis-gen@825a3ca Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODI1YTNjYWEyNGYwYmYxNzBmMWM1NmVhNWYyY2Y3MzRmOGY5ZmM1MSJ9
1 parent 8ba0df2 commit c9bd93c

File tree

8 files changed

+613
-21
lines changed

8 files changed

+613
-21
lines changed

owl-bot-staging/v1/protos/google/pubsub/v1/pubsub.proto

Lines changed: 73 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ option java_outer_classname = "PubsubProto";
3333
option java_package = "com.google.pubsub.v1";
3434
option php_namespace = "Google\\Cloud\\PubSub\\V1";
3535
option ruby_package = "Google::Cloud::PubSub::V1";
36+
option (google.api.resource_definition) = {
37+
type: "cloudkms.googleapis.com/CryptoKey"
38+
pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
39+
};
40+
option (google.api.resource_definition) = {
41+
type: "analyticshub.googleapis.com/Listing"
42+
pattern: "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}"
43+
};
3644

3745
// The service that an application uses to manipulate topics, and to send
3846
// messages to a topic.
@@ -415,7 +423,10 @@ message IngestionDataSourceSettings {
415423

416424
// Required. The name of the topic in the Amazon MSK cluster that Pub/Sub
417425
// will import from.
418-
string topic = 3 [(google.api.field_behavior) = REQUIRED];
426+
string topic = 3 [
427+
(google.api.field_behavior) = REQUIRED,
428+
(google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
429+
];
419430

420431
// Required. AWS role ARN to be used for Federated Identity authentication
421432
// with Amazon MSK. Check the Pub/Sub docs for how to set up this role and
@@ -712,12 +723,21 @@ message IngestionFailureEvent {
712723
// the Pub/Sub message.
713724
MessageTransformationFailureReason message_transformation_failure_reason =
714725
5 [(google.api.field_behavior) = OPTIONAL];
726+
727+
// Optional. The message failed to be published due to an API violation.
728+
// This is only set when the size of the data field of the Kinesis record
729+
// is zero.
730+
ApiViolationReason api_violation_reason = 6
731+
[(google.api.field_behavior) = OPTIONAL];
715732
}
716733
}
717734

718735
// Required. Name of the import topic. Format is:
719736
// projects/{project_name}/topics/{topic_name}.
720-
string topic = 1 [(google.api.field_behavior) = REQUIRED];
737+
string topic = 1 [
738+
(google.api.field_behavior) = REQUIRED,
739+
(google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
740+
];
721741

722742
// Required. Error details explaining why ingestion to Pub/Sub has failed.
723743
string error_message = 2 [(google.api.field_behavior) = REQUIRED];
@@ -849,7 +869,12 @@ message Topic {
849869
// protect access to messages published on this topic.
850870
//
851871
// The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
852-
string kms_key_name = 5 [(google.api.field_behavior) = OPTIONAL];
872+
string kms_key_name = 5 [
873+
(google.api.field_behavior) = OPTIONAL,
874+
(google.api.resource_reference) = {
875+
type: "cloudkms.googleapis.com/CryptoKey"
876+
}
877+
];
853878

854879
// Optional. Settings for validating messages published against a schema.
855880
SchemaSettings schema_settings = 6 [(google.api.field_behavior) = OPTIONAL];
@@ -881,6 +906,16 @@ message Topic {
881906
// Transforms are applied in the order specified.
882907
repeated MessageTransform message_transforms = 13
883908
[(google.api.field_behavior) = OPTIONAL];
909+
910+
// Optional. Input only. Immutable. Tag keys/values directly bound to this
911+
// resource. For example:
912+
// "123/environment": "production",
913+
// "123/costCenter": "marketing"
914+
map<string, string> tags = 14 [
915+
(google.api.field_behavior) = INPUT_ONLY,
916+
(google.api.field_behavior) = IMMUTABLE,
917+
(google.api.field_behavior) = OPTIONAL
918+
];
884919
}
885920

886921
// A message that is published by publishers and consumed by subscribers. The
@@ -1054,7 +1089,10 @@ message ListTopicSnapshotsRequest {
10541089
// Response for the `ListTopicSnapshots` method.
10551090
message ListTopicSnapshotsResponse {
10561091
// Optional. The names of the snapshots that match the request.
1057-
repeated string snapshots = 1 [(google.api.field_behavior) = OPTIONAL];
1092+
repeated string snapshots = 1 [
1093+
(google.api.field_behavior) = OPTIONAL,
1094+
(google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" }
1095+
];
10581096

10591097
// Optional. If not empty, indicates that there may be more snapshots that
10601098
// match the request; this value should be passed in a new
@@ -1348,7 +1386,12 @@ message Subscription {
13481386
// Optional. The name of the associated Analytics Hub listing resource.
13491387
// Pattern:
13501388
// "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}"
1351-
string listing = 1 [(google.api.field_behavior) = OPTIONAL];
1389+
string listing = 1 [
1390+
(google.api.field_behavior) = OPTIONAL,
1391+
(google.api.resource_reference) = {
1392+
type: "analyticshub.googleapis.com/Listing"
1393+
}
1394+
];
13521395

13531396
// Optional. The name of the associated Analytics Hub subscription resource.
13541397
// Pattern:
@@ -1514,6 +1557,16 @@ message Subscription {
15141557
// subscribers. Transforms are applied in the order specified.
15151558
repeated MessageTransform message_transforms = 25
15161559
[(google.api.field_behavior) = OPTIONAL];
1560+
1561+
// Optional. Input only. Immutable. Tag keys/values directly bound to this
1562+
// resource. For example:
1563+
// "123/environment": "production",
1564+
// "123/costCenter": "marketing"
1565+
map<string, string> tags = 26 [
1566+
(google.api.field_behavior) = INPUT_ONLY,
1567+
(google.api.field_behavior) = IMMUTABLE,
1568+
(google.api.field_behavior) = OPTIONAL
1569+
];
15171570
}
15181571

15191572
// A policy that specifies how Pub/Sub retries message delivery.
@@ -1555,7 +1608,10 @@ message DeadLetterPolicy {
15551608
// The operation will fail if the topic does not exist.
15561609
// Users should ensure that there is a subscription attached to this topic
15571610
// since messages published to a topic with no subscriptions are lost.
1558-
string dead_letter_topic = 1 [(google.api.field_behavior) = OPTIONAL];
1611+
string dead_letter_topic = 1 [
1612+
(google.api.field_behavior) = OPTIONAL,
1613+
(google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
1614+
];
15591615

15601616
// Optional. The maximum number of delivery attempts for any message. The
15611617
// value must be between 5 and 100.
@@ -2183,7 +2239,7 @@ message StreamingPullResponse {
21832239
bool message_ordering_enabled = 2 [(google.api.field_behavior) = OPTIONAL];
21842240
}
21852241

2186-
// Optional. Received Pub/Sub messages. This will not be empty.
2242+
// Optional. Received Pub/Sub messages.
21872243
repeated ReceivedMessage received_messages = 1
21882244
[(google.api.field_behavior) = OPTIONAL];
21892245

@@ -2234,6 +2290,16 @@ message CreateSnapshotRequest {
22342290
// Optional. See [Creating and managing
22352291
// labels](https://cloud.google.com/pubsub/docs/labels).
22362292
map<string, string> labels = 3 [(google.api.field_behavior) = OPTIONAL];
2293+
2294+
// Optional. Input only. Immutable. Tag keys/values directly bound to this
2295+
// resource. For example:
2296+
// "123/environment": "production",
2297+
// "123/costCenter": "marketing"
2298+
map<string, string> tags = 4 [
2299+
(google.api.field_behavior) = INPUT_ONLY,
2300+
(google.api.field_behavior) = IMMUTABLE,
2301+
(google.api.field_behavior) = OPTIONAL
2302+
];
22372303
}
22382304

22392305
// Request for the UpdateSnapshot method.

owl-bot-staging/v1/protos/protos.d.ts

Lines changed: 25 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)