Skip to content

Commit 2d653bf

Browse files
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 Source-Link: googleapis/googleapis@d89bb8a Source-Link: googleapis/googleapis-gen@c7c9072 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzdjOTA3Mjc0ZDYxNjRjZGY4NmVkY2Y4ZGU3MGYzZGI1NzJiMDBhNiJ9
1 parent 56ecbe2 commit 2d653bf

File tree

4 files changed

+76
-59
lines changed

4 files changed

+76
-59
lines changed

owl-bot-staging/v1/protos/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
}

owl-bot-staging/v1/protos/protos.json

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

owl-bot-staging/v1/src/v1/publisher_client.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ export class PublisherClient {
384384
* @param {Object} request
385385
* The request object that will be sent.
386386
* @param {string} request.name
387-
* Required. The name of the topic. It must have the format
387+
* Required. Identifier. The name of the topic. It must have the format
388388
* `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
389389
* and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
390390
* underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
@@ -620,8 +620,8 @@ export class PublisherClient {
620620
* @param {Object} request
621621
* The request object that will be sent.
622622
* @param {string} request.topic
623-
* Required. The messages in the request will be published on this topic.
624-
* Format is `projects/{project}/topics/{topic}`.
623+
* Required. Identifier. The messages in the request will be published on this
624+
* topic. Format is `projects/{project}/topics/{topic}`.
625625
* @param {number[]} request.messages
626626
* Required. The messages to publish.
627627
* @param {object} [options]
@@ -715,7 +715,7 @@ export class PublisherClient {
715715
* @param {Object} request
716716
* The request object that will be sent.
717717
* @param {string} request.topic
718-
* Required. The name of the topic to get.
718+
* Required. Identifier. The name of the topic to get.
719719
* Format is `projects/{project}/topics/{topic}`.
720720
* @param {object} [options]
721721
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
@@ -812,7 +812,7 @@ export class PublisherClient {
812812
* @param {Object} request
813813
* The request object that will be sent.
814814
* @param {string} request.topic
815-
* Required. Name of the topic to delete.
815+
* Required. Identifier. Name of the topic to delete.
816816
* Format is `projects/{project}/topics/{topic}`.
817817
* @param {object} [options]
818818
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
@@ -1002,7 +1002,7 @@ export class PublisherClient {
10021002
* @param {Object} request
10031003
* The request object that will be sent.
10041004
* @param {string} request.project
1005-
* Required. The name of the project in which to list topics.
1005+
* Required. Identifier. The name of the project in which to list topics.
10061006
* Format is `projects/{project-id}`.
10071007
* @param {number} [request.pageSize]
10081008
* Optional. Maximum number of topics to return.
@@ -1103,7 +1103,7 @@ export class PublisherClient {
11031103
* @param {Object} request
11041104
* The request object that will be sent.
11051105
* @param {string} request.project
1106-
* Required. The name of the project in which to list topics.
1106+
* Required. Identifier. The name of the project in which to list topics.
11071107
* Format is `projects/{project-id}`.
11081108
* @param {number} [request.pageSize]
11091109
* Optional. Maximum number of topics to return.
@@ -1153,7 +1153,7 @@ export class PublisherClient {
11531153
* @param {Object} request
11541154
* The request object that will be sent.
11551155
* @param {string} request.project
1156-
* Required. The name of the project in which to list topics.
1156+
* Required. Identifier. The name of the project in which to list topics.
11571157
* Format is `projects/{project-id}`.
11581158
* @param {number} [request.pageSize]
11591159
* Optional. Maximum number of topics to return.

0 commit comments

Comments
 (0)