Skip to content

Commit 95410d7

Browse files
Google APIscopybara-github
authored andcommitted
feat: add additional resource path with collections
feat: document schema id is no longer required docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 518297793
1 parent 2f07969 commit 95410d7

8 files changed

Lines changed: 95 additions & 35 deletions

File tree

google/cloud/discoveryengine/v1beta/common.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta";
2929
option (google.api.resource_definition) = {
3030
type: "discoveryengine.googleapis.com/Branch"
3131
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}"
32+
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}"
3233
};
3334
option (google.api.resource_definition) = {
3435
type: "discoveryengine.googleapis.com/DataStore"
3536
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}"
37+
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}"
3638
};
3739
option (google.api.resource_definition) = {
3840
type: "discoveryengine.googleapis.com/ServingConfig"
3941
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}"
42+
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}"
4043
};
4144

4245
// A custom attribute that is not explicitly modeled in a resource, e.g.

google/cloud/discoveryengine/v1beta/discoveryengine_v1beta.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ types:
1717

1818
documentation:
1919
summary: Discovery Engine API.
20+
rules:
21+
- selector: google.longrunning.Operations.ListOperations
22+
description: |-
23+
Lists operations that match the specified filter in the request. If
24+
the server doesn't support this method, it returns `UNIMPLEMENTED`.
2025
2126
backend:
2227
rules:
@@ -36,15 +41,23 @@ backend:
3641
http:
3742
rules:
3843
- selector: google.longrunning.Operations.GetOperation
39-
get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}'
44+
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}'
4045
additional_bindings:
46+
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}'
47+
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}'
48+
- get: '/v1beta/{name=projects/*/locations/*/collections/*/operations/*}'
49+
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/operations/*}'
4150
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*/operations/*}'
4251
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/operations/*}'
4352
- get: '/v1beta/{name=projects/*/locations/*/operations/*}'
4453
- get: '/v1beta/{name=projects/*/operations/*}'
4554
- selector: google.longrunning.Operations.ListOperations
46-
get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations'
55+
get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations'
4756
additional_bindings:
57+
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations'
58+
- get: '/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*}/operations'
59+
- get: '/v1beta/{name=projects/*/locations/*/collections/*}/operations'
60+
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*}/operations'
4861
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*/models/*}/operations'
4962
- get: '/v1beta/{name=projects/*/locations/*/dataStores/*}/operations'
5063
- get: '/v1beta/{name=projects/*/locations/*}/operations'

google/cloud/discoveryengine/v1beta/document.proto

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ message Document {
3535
option (google.api.resource) = {
3636
type: "discoveryengine.googleapis.com/Document"
3737
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}"
38+
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}"
3839
};
3940

4041
// Data representation. One of
@@ -53,7 +54,7 @@ message Document {
5354

5455
// Immutable. The full resource name of the document.
5556
// Format:
56-
// `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.
57+
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.
5758
//
5859
// This field must be a UTF-8 encoded string with a length limit of 1024
5960
// characters.
@@ -65,8 +66,8 @@ message Document {
6566
// standard with a length limit of 63 characters.
6667
string id = 2 [(google.api.field_behavior) = IMMUTABLE];
6768

68-
// Required. The identifier of the schema located in the same data store.
69-
string schema_id = 3 [(google.api.field_behavior) = REQUIRED];
69+
// The identifier of the schema located in the same data store.
70+
string schema_id = 3;
7071

7172
// The identifier of the parent document. Currently supports at most two level
7273
// document hierarchy.

google/cloud/discoveryengine/v1beta/document_service.proto

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ service DocumentService {
4646
rpc GetDocument(GetDocumentRequest) returns (Document) {
4747
option (google.api.http) = {
4848
get: "/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}"
49+
additional_bindings {
50+
get: "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}"
51+
}
4952
};
5053
option (google.api.method_signature) = "name";
5154
}
@@ -54,6 +57,9 @@ service DocumentService {
5457
rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) {
5558
option (google.api.http) = {
5659
get: "/v1beta/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents"
60+
additional_bindings {
61+
get: "/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents"
62+
}
5763
};
5864
option (google.api.method_signature) = "parent";
5965
}
@@ -63,6 +69,10 @@ service DocumentService {
6369
option (google.api.http) = {
6470
post: "/v1beta/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents"
6571
body: "document"
72+
additional_bindings {
73+
post: "/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents"
74+
body: "document"
75+
}
6676
};
6777
option (google.api.method_signature) = "parent,document,document_id";
6878
}
@@ -72,13 +82,20 @@ service DocumentService {
7282
option (google.api.http) = {
7383
patch: "/v1beta/{document.name=projects/*/locations/*/dataStores/*/branches/*/documents/*}"
7484
body: "document"
85+
additional_bindings {
86+
patch: "/v1beta/{document.name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}"
87+
body: "document"
88+
}
7589
};
7690
}
7791

7892
// Deletes a [Document][google.cloud.discoveryengine.v1beta.Document].
7993
rpc DeleteDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) {
8094
option (google.api.http) = {
8195
delete: "/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}"
96+
additional_bindings {
97+
delete: "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}"
98+
}
8299
};
83100
option (google.api.method_signature) = "name";
84101
}
@@ -95,6 +112,10 @@ service DocumentService {
95112
option (google.api.http) = {
96113
post: "/v1beta/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:import"
97114
body: "*"
115+
additional_bindings {
116+
post: "/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:import"
117+
body: "*"
118+
}
98119
};
99120
option (google.longrunning.operation_info) = {
100121
response_type: "google.cloud.discoveryengine.v1beta.ImportDocumentsResponse"
@@ -109,7 +130,7 @@ service DocumentService {
109130
message GetDocumentRequest {
110131
// Required. Full resource name of
111132
// [Document][google.cloud.discoveryengine.v1beta.Document], such as
112-
// `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
133+
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
113134
//
114135
// If the caller does not have permission to access the
115136
// [Document][google.cloud.discoveryengine.v1beta.Document], regardless of
@@ -130,7 +151,7 @@ message GetDocumentRequest {
130151
// method.
131152
message ListDocumentsRequest {
132153
// Required. The parent branch resource name, such as
133-
// `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`.
154+
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
134155
// Use `default_branch` as the branch ID, to list documents under the default
135156
// branch.
136157
//
@@ -183,7 +204,7 @@ message ListDocumentsResponse {
183204
// method.
184205
message CreateDocumentRequest {
185206
// Required. The parent resource name, such as
186-
// `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`.
207+
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
187208
string parent = 1 [
188209
(google.api.field_behavior) = REQUIRED,
189210
(google.api.resource_reference) = {
@@ -244,7 +265,7 @@ message UpdateDocumentRequest {
244265
message DeleteDocumentRequest {
245266
// Required. Full resource name of
246267
// [Document][google.cloud.discoveryengine.v1beta.Document], such as
247-
// `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
268+
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
248269
//
249270
// If the caller does not have permission to delete the
250271
// [Document][google.cloud.discoveryengine.v1beta.Document], regardless of

google/cloud/discoveryengine/v1beta/import_config.proto

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ option objc_class_prefix = "DISCOVERYENGINE";
3333
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta";
3434
option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta";
3535

36-
// Google Cloud Storage location for input content.
37-
// format.
36+
// Cloud Storage location for input content.
3837
message GcsSource {
39-
// Required. Google Cloud Storage URIs to input files. URI can be up to
38+
// Required. Cloud Storage URIs to input files. URI can be up to
4039
// 2000 characters long. URIs can match the full object path (for example,
4140
// `gs://bucket/directory/object.json`) or a pattern matching one or more
4241
// files, such as `gs://bucket/directory/*.json`. A request can
@@ -45,16 +44,18 @@ message GcsSource {
4544

4645
// The schema to use when parsing the data from the source.
4746
//
48-
// Supported values for imports:
49-
//
50-
// * `user_event` (default): One JSON
51-
// [UserEvent][google.cloud.discoveryengine.v1beta.UserEvent] per line.
47+
// Supported values for document imports:
5248
//
5349
// * `document` (default): One JSON
5450
// [Document][google.cloud.discoveryengine.v1beta.Document] per line. Each
5551
// document must
5652
// have a valid
5753
// [Document.id][google.cloud.discoveryengine.v1beta.Document.id].
54+
//
55+
// Supported values for user even imports:
56+
//
57+
// * `user_event` (default): One JSON
58+
// [UserEvent][google.cloud.discoveryengine.v1beta.UserEvent] per line.
5859
string data_schema = 2;
5960
}
6061

@@ -102,7 +103,7 @@ message BigQuerySource {
102103
message ImportErrorConfig {
103104
// Required. Errors destination.
104105
oneof destination {
105-
// Google Cloud Storage prefix for import errors. This must be an empty,
106+
// Cloud Storage prefix for import errors. This must be an empty,
106107
// existing Cloud Storage directory. Import errors will be written to
107108
// sharded files in this directory, one per line, as a JSON-encoded
108109
// `google.rpc.Status` message.
@@ -123,15 +124,15 @@ message ImportUserEventsRequest {
123124
// Required. The Inline source for the input content for UserEvents.
124125
InlineSource inline_source = 2 [(google.api.field_behavior) = REQUIRED];
125126

126-
// Required. Google Cloud Storage location for the input content.
127+
// Required. Cloud Storage location for the input content.
127128
GcsSource gcs_source = 3 [(google.api.field_behavior) = REQUIRED];
128129

129130
// Required. BigQuery input source.
130131
BigQuerySource bigquery_source = 4 [(google.api.field_behavior) = REQUIRED];
131132
}
132133

133134
// Required. Parent DataStore resource name, of the form
134-
// `projects/{project}/locations/{location}/dataStores/{data_store}`
135+
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
135136
string parent = 1 [
136137
(google.api.field_behavior) = REQUIRED,
137138
(google.api.resource_reference) = {
@@ -226,15 +227,15 @@ message ImportDocumentsRequest {
226227
// The Inline source for the input content for documents.
227228
InlineSource inline_source = 2;
228229

229-
// Google Cloud Storage location for the input content.
230+
// Cloud Storage location for the input content.
230231
GcsSource gcs_source = 3;
231232

232233
// BigQuery input source.
233234
BigQuerySource bigquery_source = 4;
234235
}
235236

236237
// Required. The parent branch resource name, such as
237-
// `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`.
238+
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
238239
// Requires create/update permission.
239240
string parent = 1 [
240241
(google.api.field_behavior) = REQUIRED,

google/cloud/discoveryengine/v1beta/recommendation_service.proto

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,18 @@ service RecommendationService {
4444
option (google.api.http) = {
4545
post: "/v1beta/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:recommend"
4646
body: "*"
47+
additional_bindings {
48+
post: "/v1beta/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:recommend"
49+
body: "*"
50+
}
4751
};
4852
}
4953
}
5054

5155
// Request message for Recommend method.
5256
message RecommendRequest {
5357
// Required. Full resource name of the format:
54-
// projects/*/locations/global/dataStores/*/servingConfigs/*
58+
// projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*
5559
//
5660
// Before you can request recommendations from your model, you must create at
5761
// least one serving config for it.
@@ -152,8 +156,8 @@ message RecommendRequest {
152156
// key with multiple resources.
153157
// * Keys must start with a lowercase letter or international character.
154158
//
155-
// See [Google Cloud
156-
// Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
159+
// See [Requirements for
160+
// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
157161
// for more details.
158162
map<string, string> user_labels = 8;
159163
}

google/cloud/discoveryengine/v1beta/user_event.proto

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,26 @@ option objc_class_prefix = "DISCOVERYENGINE";
3131
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta";
3232
option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta";
3333

34-
// UserEvent captures all metadata information DiscoveryEngine API needs to know
35-
// about how end users interact with customers' website.
34+
// UserEvent captures all metadata information Discovery Engine API needs to
35+
// know about how end users interact with customers' website.
3636
message UserEvent {
3737
// Required. User event type. Allowed values are:
3838
//
3939
// Generic values:
40+
//
4041
// * `search`: Search for Documents.
4142
// * `view-item`: Detailed page view of a Document.
4243
// * `view-item-list`: View of a panel or ordered list of Documents.
4344
// * `view-home-page`: View of the home page.
4445
// * `view-category-page`: View of a category page, e.g. Home > Men > Jeans
4546
//
4647
// Retail-related values:
48+
//
4749
// * `add-to-cart`: Add an item(s) to cart, e.g. in Retail online shopping
4850
// * `purchase`: Purchase an item(s)
4951
//
5052
// Media-related values:
53+
//
5154
// * `media-play`: Start/resume watching a video, playing a song, etc.
5255
// * `media-complete`: Finished or stopped midway through a video, song, etc.
5356
string event_type = 1 [(google.api.field_behavior) = REQUIRED];
@@ -96,7 +99,8 @@ message UserEvent {
9699
// 128 bytes. A session is an aggregation of an end user behavior in a time
97100
// span.
98101
//
99-
// A general guideline to populate the sesion_id:
102+
// A general guideline to populate the session_id:
103+
//
100104
// 1. If user has no activity for 30 min, a new session_id should be assigned.
101105
// 2. The session_id should be unique across users, suggest use uuid or add
102106
// [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1beta.UserEvent.user_pseudo_id]
@@ -199,7 +203,7 @@ message UserEvent {
199203
// If you provide custom attributes for ingested user events, also include
200204
// them in the user events that you associate with prediction requests. Custom
201205
// attribute formatting must be consistent between imported events and events
202-
// provided with prediction requests. This lets the DiscoveryEngine API use
206+
// provided with prediction requests. This lets the Discovery Engine API use
203207
// those custom attributes when training models and serving predictions, which
204208
// helps improve recommendation quality.
205209
//
@@ -377,19 +381,20 @@ message DocumentInfo {
377381
// A required descriptor of the associated Document.
378382
//
379383
// * If [id][google.cloud.discoveryengine.v1beta.DocumentInfo.id] is
380-
// specified, then the default values for <location>, <data_store_id>, and
381-
// <branch_id> are used when annotating with the stored Document.
384+
// specified, then the default values for {location}, {collection_id},
385+
// {data_store_id}, and {branch_id} are used when annotating with the stored
386+
// Document.
382387
//
383388
// * If [name][google.cloud.discoveryengine.v1beta.DocumentInfo.name] is
384389
// specified, then the provided values (default values allowed) for
385-
// <location>, <data_store_id>, and <branch_id> are used when annotating with
386-
// the stored Document.
390+
// {location}, {collection_id}, {data_store_id}, and {branch_id} are used when
391+
// annotating with the stored Document.
387392
oneof document_descriptor {
388393
// Required. The Document resource ID.
389394
string id = 1 [(google.api.field_behavior) = REQUIRED];
390395

391396
// Required. The Document resource full name, of the form:
392-
// projects/<project_id>/locations/<location>/dataStores/<data_store_id>/branches/<branch_id>/documents/<document_id>
397+
// projects/{project\_id}/locations/{location}/collections/{collection\_id}/dataStores/{data\_store\_id}/branches/{branch\_id}/documents/{document\_id}
393398
string name = 2 [
394399
(google.api.field_behavior) = REQUIRED,
395400
(google.api.resource_reference) = {
@@ -404,6 +409,7 @@ message DocumentInfo {
404409
// are involved in a `add-to-cart` event.
405410
//
406411
// Required for events of the following event types:
412+
//
407413
// * `add-to-cart`
408414
// * `purchase`
409415
optional int32 quantity = 3;

0 commit comments

Comments
 (0)