Skip to content

Commit d89bb8a

Browse files
Google APIscopybara-github
authored andcommitted
docs: Add the IDENTIFIER field behavior annotation to fields of Cloud Pub/Sub methods that represent a specific identity and need to be sourced with additional care
PiperOrigin-RevId: 840763233
1 parent fe58211 commit d89bb8a

1 file changed

Lines changed: 37 additions & 20 deletions

File tree

google/pubsub/v1/pubsub.proto

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -847,13 +847,16 @@ message Topic {
847847
INGESTION_RESOURCE_ERROR = 2;
848848
}
849849

850-
// Required. The name of the topic. It must have the format
850+
// Required. Identifier. The name of the topic. It must have the format
851851
// `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
852852
// and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
853853
// underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
854854
// signs (`%`). It must be between 3 and 255 characters in length, and it
855855
// must not start with `"goog"`.
856-
string name = 1 [(google.api.field_behavior) = REQUIRED];
856+
string name = 1 [
857+
(google.api.field_behavior) = REQUIRED,
858+
(google.api.field_behavior) = IDENTIFIER
859+
];
857860

858861
// Optional. See [Creating and managing labels]
859862
// (https://cloud.google.com/pubsub/docs/labels).
@@ -960,10 +963,11 @@ message PubsubMessage {
960963

961964
// Request for the GetTopic method.
962965
message GetTopicRequest {
963-
// Required. The name of the topic to get.
966+
// Required. Identifier. The name of the topic to get.
964967
// Format is `projects/{project}/topics/{topic}`.
965968
string topic = 1 [
966969
(google.api.field_behavior) = REQUIRED,
970+
(google.api.field_behavior) = IDENTIFIER,
967971
(google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
968972
];
969973
}
@@ -984,10 +988,11 @@ message UpdateTopicRequest {
984988

985989
// Request for the Publish method.
986990
message PublishRequest {
987-
// Required. The messages in the request will be published on this topic.
988-
// Format is `projects/{project}/topics/{topic}`.
991+
// Required. Identifier. The messages in the request will be published on this
992+
// topic. Format is `projects/{project}/topics/{topic}`.
989993
string topic = 1 [
990994
(google.api.field_behavior) = REQUIRED,
995+
(google.api.field_behavior) = IDENTIFIER,
991996
(google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
992997
];
993998

@@ -1005,10 +1010,11 @@ message PublishResponse {
10051010

10061011
// Request for the `ListTopics` method.
10071012
message ListTopicsRequest {
1008-
// Required. The name of the project in which to list topics.
1013+
// Required. Identifier. The name of the project in which to list topics.
10091014
// Format is `projects/{project-id}`.
10101015
string project = 1 [
10111016
(google.api.field_behavior) = REQUIRED,
1017+
(google.api.field_behavior) = IDENTIFIER,
10121018
(google.api.resource_reference) = {
10131019
type: "cloudresourcemanager.googleapis.com/Project"
10141020
}
@@ -1102,10 +1108,11 @@ message ListTopicSnapshotsResponse {
11021108

11031109
// Request for the `DeleteTopic` method.
11041110
message DeleteTopicRequest {
1105-
// Required. Name of the topic to delete.
1111+
// Required. Identifier. Name of the topic to delete.
11061112
// Format is `projects/{project}/topics/{topic}`.
11071113
string topic = 1 [
11081114
(google.api.field_behavior) = REQUIRED,
1115+
(google.api.field_behavior) = IDENTIFIER,
11091116
(google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
11101117
];
11111118
}
@@ -1399,13 +1406,16 @@ message Subscription {
13991406
string subscription = 2 [(google.api.field_behavior) = OPTIONAL];
14001407
}
14011408

1402-
// Required. The name of the subscription. It must have the format
1409+
// Required. Identifier. The name of the subscription. It must have the format
14031410
// `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
14041411
// start with a letter, and contain only letters (`[A-Za-z]`), numbers
14051412
// (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
14061413
// plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
14071414
// in length, and it must not start with `"goog"`.
1408-
string name = 1 [(google.api.field_behavior) = REQUIRED];
1415+
string name = 1 [
1416+
(google.api.field_behavior) = REQUIRED,
1417+
(google.api.field_behavior) = IDENTIFIER
1418+
];
14091419

14101420
// Required. The name of the topic from which this subscription is receiving
14111421
// messages. Format is `projects/{project}/topics/{topic}`. The value of this
@@ -1934,10 +1944,11 @@ message ReceivedMessage {
19341944

19351945
// Request for the GetSubscription method.
19361946
message GetSubscriptionRequest {
1937-
// Required. The name of the subscription to get.
1947+
// Required. Identifier. The name of the subscription to get.
19381948
// Format is `projects/{project}/subscriptions/{sub}`.
19391949
string subscription = 1 [
19401950
(google.api.field_behavior) = REQUIRED,
1951+
(google.api.field_behavior) = IDENTIFIER,
19411952
(google.api.resource_reference) = {
19421953
type: "pubsub.googleapis.com/Subscription"
19431954
}
@@ -1957,10 +1968,11 @@ message UpdateSubscriptionRequest {
19571968

19581969
// Request for the `ListSubscriptions` method.
19591970
message ListSubscriptionsRequest {
1960-
// Required. The name of the project in which to list subscriptions.
1961-
// Format is `projects/{project-id}`.
1971+
// Required. Identifier. The name of the project in which to list
1972+
// subscriptions. Format is `projects/{project-id}`.
19621973
string project = 1 [
19631974
(google.api.field_behavior) = REQUIRED,
1975+
(google.api.field_behavior) = IDENTIFIER,
19641976
(google.api.resource_reference) = {
19651977
type: "cloudresourcemanager.googleapis.com/Project"
19661978
}
@@ -1989,10 +2001,11 @@ message ListSubscriptionsResponse {
19892001

19902002
// Request for the DeleteSubscription method.
19912003
message DeleteSubscriptionRequest {
1992-
// Required. The subscription to delete.
2004+
// Required. Identifier. The subscription to delete.
19932005
// Format is `projects/{project}/subscriptions/{sub}`.
19942006
string subscription = 1 [
19952007
(google.api.field_behavior) = REQUIRED,
2008+
(google.api.field_behavior) = IDENTIFIER,
19962009
(google.api.resource_reference) = {
19972010
type: "pubsub.googleapis.com/Subscription"
19982011
}
@@ -2260,14 +2273,15 @@ message StreamingPullResponse {
22602273

22612274
// Request for the `CreateSnapshot` method.
22622275
message CreateSnapshotRequest {
2263-
// Required. User-provided name for this snapshot. If the name is not provided
2264-
// in the request, the server will assign a random name for this snapshot on
2265-
// the same project as the subscription. Note that for REST API requests, you
2266-
// must specify a name. See the [resource name
2276+
// Required. Identifier. User-provided name for this snapshot. If the name is
2277+
// not provided in the request, the server will assign a random name for this
2278+
// snapshot on the same project as the subscription. Note that for REST API
2279+
// requests, you must specify a name. See the [resource name
22672280
// rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
22682281
// Format is `projects/{project}/snapshots/{snap}`.
22692282
string name = 1 [
22702283
(google.api.field_behavior) = REQUIRED,
2284+
(google.api.field_behavior) = IDENTIFIER,
22712285
(google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" }
22722286
];
22732287

@@ -2356,20 +2370,22 @@ message Snapshot {
23562370

23572371
// Request for the GetSnapshot method.
23582372
message GetSnapshotRequest {
2359-
// Required. The name of the snapshot to get.
2373+
// Required. Identifier. The name of the snapshot to get.
23602374
// Format is `projects/{project}/snapshots/{snap}`.
23612375
string snapshot = 1 [
23622376
(google.api.field_behavior) = REQUIRED,
2377+
(google.api.field_behavior) = IDENTIFIER,
23632378
(google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" }
23642379
];
23652380
}
23662381

23672382
// Request for the `ListSnapshots` method.
23682383
message ListSnapshotsRequest {
2369-
// Required. The name of the project in which to list snapshots.
2384+
// Required. Identifier. The name of the project in which to list snapshots.
23702385
// Format is `projects/{project-id}`.
23712386
string project = 1 [
23722387
(google.api.field_behavior) = REQUIRED,
2388+
(google.api.field_behavior) = IDENTIFIER,
23732389
(google.api.resource_reference) = {
23742390
type: "cloudresourcemanager.googleapis.com/Project"
23752391
}
@@ -2397,10 +2413,11 @@ message ListSnapshotsResponse {
23972413

23982414
// Request for the `DeleteSnapshot` method.
23992415
message DeleteSnapshotRequest {
2400-
// Required. The name of the snapshot to delete.
2416+
// Required. Identifier. The name of the snapshot to delete.
24012417
// Format is `projects/{project}/snapshots/{snap}`.
24022418
string snapshot = 1 [
24032419
(google.api.field_behavior) = REQUIRED,
2420+
(google.api.field_behavior) = IDENTIFIER,
24042421
(google.api.resource_reference) = { type: "pubsub.googleapis.com/Snapshot" }
24052422
];
24062423
}

0 commit comments

Comments
 (0)