@google-cloud/discoveryengine 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +26 -0
  3. package/build/protos/google/cloud/discoveryengine/v1alpha/common.proto +155 -0
  4. package/build/protos/google/cloud/discoveryengine/v1alpha/completion_service.proto +134 -0
  5. package/build/protos/google/cloud/discoveryengine/v1alpha/conversation.proto +138 -0
  6. package/build/protos/google/cloud/discoveryengine/v1alpha/conversational_search_service.proto +306 -0
  7. package/build/protos/google/cloud/discoveryengine/v1alpha/document.proto +121 -0
  8. package/build/protos/google/cloud/discoveryengine/v1alpha/document_service.proto +318 -0
  9. package/build/protos/google/cloud/discoveryengine/v1alpha/import_config.proto +343 -0
  10. package/build/protos/google/cloud/discoveryengine/v1alpha/purge_config.proto +159 -0
  11. package/build/protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto +221 -0
  12. package/build/protos/google/cloud/discoveryengine/v1alpha/schema.proto +312 -0
  13. package/build/protos/google/cloud/discoveryengine/v1alpha/schema_service.proto +260 -0
  14. package/build/protos/google/cloud/discoveryengine/v1alpha/search_service.proto +851 -0
  15. package/build/protos/google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto +152 -0
  16. package/build/protos/google/cloud/discoveryengine/v1alpha/user_event.proto +475 -0
  17. package/build/protos/google/cloud/discoveryengine/v1alpha/user_event_service.proto +154 -0
  18. package/build/protos/protos.d.ts +12587 -7
  19. package/build/protos/protos.js +34918 -3126
  20. package/build/protos/protos.json +3458 -5
  21. package/build/src/index.d.ts +3 -1
  22. package/build/src/index.js +4 -1
  23. package/build/src/v1alpha/completion_service_client.d.ts +603 -0
  24. package/build/src/v1alpha/completion_service_client.js +843 -0
  25. package/build/src/v1alpha/completion_service_client_config.json +43 -0
  26. package/build/src/v1alpha/conversational_search_service_client.d.ts +998 -0
  27. package/build/src/v1alpha/conversational_search_service_client.js +1275 -0
  28. package/build/src/v1alpha/conversational_search_service_client_config.json +68 -0
  29. package/build/src/v1alpha/document_service_client.d.ts +1140 -0
  30. package/build/src/v1alpha/document_service_client.js +1393 -0
  31. package/build/src/v1alpha/document_service_client_config.json +82 -0
  32. package/build/src/v1alpha/index.d.ts +8 -0
  33. package/build/src/v1alpha/index.js +37 -0
  34. package/build/src/v1alpha/recommendation_service_client.d.ts +735 -0
  35. package/build/src/v1alpha/recommendation_service_client.js +938 -0
  36. package/build/src/v1alpha/recommendation_service_client_config.json +43 -0
  37. package/build/src/v1alpha/schema_service_client.d.ts +935 -0
  38. package/build/src/v1alpha/schema_service_client.js +1327 -0
  39. package/build/src/v1alpha/schema_service_client_config.json +63 -0
  40. package/build/src/v1alpha/search_service_client.d.ts +1208 -0
  41. package/build/src/v1alpha/search_service_client.js +1432 -0
  42. package/build/src/v1alpha/search_service_client_config.json +43 -0
  43. package/build/src/v1alpha/site_search_engine_service_client.d.ts +704 -0
  44. package/build/src/v1alpha/site_search_engine_service_client.js +1087 -0
  45. package/build/src/v1alpha/site_search_engine_service_client_config.json +30 -0
  46. package/build/src/v1alpha/user_event_service_client.d.ts +853 -0
  47. package/build/src/v1alpha/user_event_service_client.js +1174 -0
  48. package/build/src/v1alpha/user_event_service_client_config.json +67 -0
  49. package/package.json +3 -3
@@ -0,0 +1,152 @@
1
+ // Copyright 2022 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.cloud.discoveryengine.v1alpha;
18
+
19
+ import "google/api/annotations.proto";
20
+ import "google/api/client.proto";
21
+ import "google/api/field_behavior.proto";
22
+ import "google/api/resource.proto";
23
+ import "google/longrunning/operations.proto";
24
+ import "google/protobuf/timestamp.proto";
25
+
26
+ option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha";
27
+ option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb";
28
+ option java_multiple_files = true;
29
+ option java_outer_classname = "SiteSearchEngineServiceProto";
30
+ option java_package = "com.google.cloud.discoveryengine.v1alpha";
31
+ option objc_class_prefix = "DISCOVERYENGINE";
32
+ option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha";
33
+ option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha";
34
+
35
+ // Service for managing site search related resources.
36
+ service SiteSearchEngineService {
37
+ option (google.api.default_host) = "discoveryengine.googleapis.com";
38
+ option (google.api.oauth_scopes) =
39
+ "https://www.googleapis.com/auth/cloud-platform";
40
+
41
+ // Request on-demand recrawl for a list of URIs.
42
+ rpc RecrawlUris(RecrawlUrisRequest) returns (google.longrunning.Operation) {
43
+ option (google.api.http) = {
44
+ post: "/v1alpha/{site_search_engine=projects/*/locations/*/dataStores/*/siteSearchEngine}:recrawlUris"
45
+ body: "*"
46
+ additional_bindings {
47
+ post: "/v1alpha/{site_search_engine=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}:recrawlUris"
48
+ body: "*"
49
+ }
50
+ };
51
+ option (google.longrunning.operation_info) = {
52
+ response_type: "google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse"
53
+ metadata_type: "google.cloud.discoveryengine.v1alpha.RecrawlUrisMetadata"
54
+ };
55
+ }
56
+ }
57
+
58
+ // Request message for
59
+ // [SiteSearchEngineService.RecrawlUris][google.cloud.discoveryengine.v1alpha.SiteSearchEngineService.RecrawlUris]
60
+ // method.
61
+ message RecrawlUrisRequest {
62
+ // Required. Full resource name of the
63
+ // [SiteSearchEngine][google.cloud.discoveryengine.v1alpha.SiteSearchEngine],
64
+ // such as
65
+ // `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`.
66
+ string site_search_engine = 1 [
67
+ (google.api.field_behavior) = REQUIRED,
68
+ (google.api.resource_reference) = {
69
+ type: "discoveryengine.googleapis.com/SiteSearchEngine"
70
+ }
71
+ ];
72
+
73
+ // Required. List of URIs to crawl. At most 10K URIs are supported, otherwise
74
+ // an INVALID_ARGUMENT error is thrown. Each URI should match at least one
75
+ // [TargetSite][google.cloud.discoveryengine.v1alpha.TargetSite] in
76
+ // `site_search_engine`.
77
+ repeated string uris = 2 [(google.api.field_behavior) = REQUIRED];
78
+ }
79
+
80
+ // Response message for
81
+ // [SiteSearchEngineService.RecrawlUris][google.cloud.discoveryengine.v1alpha.SiteSearchEngineService.RecrawlUris]
82
+ // method.
83
+ message RecrawlUrisResponse {
84
+ // Details about why a particular URI failed to be crawled. Each FailureInfo
85
+ // contains one FailureReason per CorpusType.
86
+ message FailureInfo {
87
+ // Details about why crawling failed for a particular CorpusType, e.g.
88
+ // DESKTOP and MOBILE crawling may fail for different reasons.
89
+ message FailureReason {
90
+ // CorpusType for the failed crawling operation.
91
+ enum CorpusType {
92
+ // Default value.
93
+ CORPUS_TYPE_UNSPECIFIED = 0;
94
+
95
+ // Denotes a crawling attempt for the desktop version of a page.
96
+ DESKTOP = 1;
97
+
98
+ // Denotes a crawling attempt for the mobile version of a page.
99
+ MOBILE = 2;
100
+ }
101
+
102
+ // DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED.
103
+ CorpusType corpus_type = 1;
104
+
105
+ // Reason why the URI was not crawled.
106
+ string error_message = 2;
107
+ }
108
+
109
+ // URI that failed to be crawled.
110
+ string uri = 1;
111
+
112
+ // List of failure reasons by corpus type (e.g. desktop, mobile).
113
+ repeated FailureReason failure_reasons = 2;
114
+ }
115
+
116
+ // Details for a sample of up to 10 `failed_uris`.
117
+ repeated FailureInfo failure_samples = 1;
118
+
119
+ // URIs that were not crawled before the LRO terminated.
120
+ repeated string failed_uris = 2;
121
+ }
122
+
123
+ // Metadata related to the progress of the
124
+ // [SiteSearchEngineService.RecrawlUris][google.cloud.discoveryengine.v1alpha.SiteSearchEngineService.RecrawlUris]
125
+ // operation. This will be returned by the google.longrunning.Operation.metadata
126
+ // field.
127
+ message RecrawlUrisMetadata {
128
+ // Operation create time.
129
+ google.protobuf.Timestamp create_time = 1;
130
+
131
+ // Operation last update time. If the operation is done, this is also the
132
+ // finish time.
133
+ google.protobuf.Timestamp update_time = 2;
134
+
135
+ // Unique URIs in the request that don't match any TargetSite in the
136
+ // DataStore, only match TargetSites that haven't been fully indexed, or match
137
+ // a TargetSite with type EXCLUDE.
138
+ repeated string invalid_uris = 3;
139
+
140
+ // Total number of unique URIs in the request that are not in invalid_uris.
141
+ int32 valid_uris_count = 4;
142
+
143
+ // Total number of URIs that have been crawled so far.
144
+ int32 success_count = 5;
145
+
146
+ // Total number of URIs that have yet to be crawled.
147
+ int32 pending_count = 6;
148
+
149
+ // Total number of URIs that were rejected due to insufficient indexing
150
+ // resources.
151
+ int32 quota_exceeded_count = 7;
152
+ }
@@ -0,0 +1,475 @@
1
+ // Copyright 2022 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.cloud.discoveryengine.v1alpha;
18
+
19
+ import "google/api/field_behavior.proto";
20
+ import "google/api/resource.proto";
21
+ import "google/cloud/discoveryengine/v1alpha/common.proto";
22
+ import "google/protobuf/duration.proto";
23
+ import "google/protobuf/timestamp.proto";
24
+
25
+ option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha";
26
+ option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb";
27
+ option java_multiple_files = true;
28
+ option java_outer_classname = "UserEventProto";
29
+ option java_package = "com.google.cloud.discoveryengine.v1alpha";
30
+ option objc_class_prefix = "DISCOVERYENGINE";
31
+ option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha";
32
+ option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha";
33
+
34
+ // UserEvent captures all metadata information Discovery Engine API needs to
35
+ // know about how end users interact with customers' website.
36
+ message UserEvent {
37
+ // Required. User event type. Allowed values are:
38
+ //
39
+ // Generic values:
40
+ //
41
+ // * `search`: Search for Documents.
42
+ // * `view-item`: Detailed page view of a Document.
43
+ // * `view-item-list`: View of a panel or ordered list of Documents.
44
+ // * `view-home-page`: View of the home page.
45
+ // * `view-category-page`: View of a category page, e.g. Home > Men > Jeans
46
+ //
47
+ // Retail-related values:
48
+ //
49
+ // * `add-to-cart`: Add an item(s) to cart, e.g. in Retail online shopping
50
+ // * `purchase`: Purchase an item(s)
51
+ //
52
+ // Media-related values:
53
+ //
54
+ // * `media-play`: Start/resume watching a video, playing a song, etc.
55
+ // * `media-complete`: Finished or stopped midway through a video, song, etc.
56
+ string event_type = 1 [(google.api.field_behavior) = REQUIRED];
57
+
58
+ // Required. A unique identifier for tracking visitors.
59
+ //
60
+ // For example, this could be implemented with an HTTP cookie, which should be
61
+ // able to uniquely identify a visitor on a single device. This unique
62
+ // identifier should not change if the visitor log in/out of the website.
63
+ //
64
+ // Do not set the field to the same fixed ID for different users. This mixes
65
+ // the event history of those users together, which results in degraded model
66
+ // quality.
67
+ //
68
+ // The field must be a UTF-8 encoded string with a length limit of 128
69
+ // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
70
+ //
71
+ // The field should not contain PII or user-data. We recommend to use Google
72
+ // Analytics [Client
73
+ // ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId)
74
+ // for this field.
75
+ string user_pseudo_id = 2 [(google.api.field_behavior) = REQUIRED];
76
+
77
+ // Only required for
78
+ // [UserEventService.ImportUserEvents][google.cloud.discoveryengine.v1alpha.UserEventService.ImportUserEvents]
79
+ // method. Timestamp of when the user event happened.
80
+ google.protobuf.Timestamp event_time = 3;
81
+
82
+ // Information about the end user.
83
+ UserInfo user_info = 4;
84
+
85
+ // Should set to true if the request is made directly from the end user, in
86
+ // which case the
87
+ // [UserEvent.user_info.user_agent][google.cloud.discoveryengine.v1alpha.UserInfo.user_agent]
88
+ // can be populated from the HTTP request.
89
+ //
90
+ // This flag should be set only if the API request is made directly from the
91
+ // end user such as a mobile app (and not if a gateway or a server is
92
+ // processing and pushing the user events).
93
+ //
94
+ // This should not be set when using the JavaScript tag in
95
+ // [UserEventService.CollectUserEvent][google.cloud.discoveryengine.v1alpha.UserEventService.CollectUserEvent].
96
+ bool direct_user_request = 5;
97
+
98
+ // A unique identifier for tracking a visitor session with a length limit of
99
+ // 128 bytes. A session is an aggregation of an end user behavior in a time
100
+ // span.
101
+ //
102
+ // A general guideline to populate the session_id:
103
+ //
104
+ // 1. If user has no activity for 30 min, a new session_id should be assigned.
105
+ // 2. The session_id should be unique across users, suggest use uuid or add
106
+ // [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1alpha.UserEvent.user_pseudo_id]
107
+ // as prefix.
108
+ string session_id = 6;
109
+
110
+ // Page metadata such as categories and other critical information for certain
111
+ // event types such as `view-category-page`.
112
+ PageInfo page_info = 7;
113
+
114
+ // Token to attribute an API response to user action(s) to trigger the event.
115
+ //
116
+ // Highly recommended for user events that are the result of
117
+ // [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
118
+ // This field enables accurate attribution of recommendation model
119
+ // performance.
120
+ //
121
+ // The value must be one of:
122
+ //
123
+ // * [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token] for events that are the result of
124
+ // [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].
125
+ // * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1alpha.SearchResponse.attribution_token] for events that are the result of
126
+ // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].
127
+ //
128
+ // This token enables us to accurately attribute page view or conversion
129
+ // completion back to the event and the particular predict response containing
130
+ // this clicked/purchased product. If user clicks on product K in the
131
+ // recommendation results, pass
132
+ // [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
133
+ // as a URL parameter to product K's page. When recording events on product
134
+ // K's page, log the
135
+ // [RecommendResponse.attribution_token][google.cloud.discoveryengine.v1alpha.RecommendResponse.attribution_token]
136
+ // to this field.
137
+ string attribution_token = 8;
138
+
139
+ // The filter syntax consists of an expression language for constructing a
140
+ // predicate from one or more fields of the documents being filtered.
141
+ //
142
+ // One example is for `search` events, the associated
143
+ // [SearchRequest][google.cloud.discoveryengine.v1alpha.SearchRequest] may
144
+ // contain a filter expression in
145
+ // [SearchRequest.filter][google.cloud.discoveryengine.v1alpha.SearchRequest.filter]
146
+ // conforming to https://google.aip.dev/160#filtering.
147
+ //
148
+ // Similarly, for `view-item-list` events that are generated from a
149
+ // [RecommendationService.RecommendRequest][], this field may be populated
150
+ // directly from [RecommendationService.RecommendRequest.filter][] conforming
151
+ // to https://google.aip.dev/160#filtering.
152
+ //
153
+ // The value must be a UTF-8 encoded string with a length limit of 1,000
154
+ // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
155
+ string filter = 9;
156
+
157
+ // List of [Document][google.cloud.discoveryengine.v1alpha.Document]s
158
+ // associated with this user event.
159
+ //
160
+ // This field is optional except for the following event types:
161
+ //
162
+ // * `view-item`
163
+ // * `add-to-cart`
164
+ // * `purchase`
165
+ // * `media-play`
166
+ // * `media-complete`
167
+ //
168
+ // In a `search` event, this field represents the documents returned to the
169
+ // end user on the current page (the end user may have not finished browsing
170
+ // the whole page yet). When a new page is returned to the end user, after
171
+ // pagination/filtering/ordering even for the same query, a new `search` event
172
+ // with different
173
+ // [UserEvent.documents][google.cloud.discoveryengine.v1alpha.UserEvent.documents]
174
+ // is desired.
175
+ repeated DocumentInfo documents = 10;
176
+
177
+ // Panel metadata associated with this user event.
178
+ PanelInfo panel = 11;
179
+
180
+ // [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search]
181
+ // details related to the event.
182
+ //
183
+ // This field should be set for `search` event.
184
+ SearchInfo search_info = 12;
185
+
186
+ // [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery]
187
+ // details related to the event.
188
+ //
189
+ // This field should be set for `search` event when autocomplete function is
190
+ // enabled and the user clicks a suggestion for search.
191
+ CompletionInfo completion_info = 13;
192
+
193
+ // The transaction metadata (if any) associated with this user event.
194
+ TransactionInfo transaction_info = 14;
195
+
196
+ // A list of identifiers for the independent experiment groups this user event
197
+ // belongs to. This is used to distinguish between user events associated with
198
+ // different experiment setups on the customer end.
199
+ repeated string tag_ids = 15;
200
+
201
+ // The promotion IDs if this is an event associated with promotions.
202
+ // Currently, this field is restricted to at most one ID.
203
+ repeated string promotion_ids = 16;
204
+
205
+ // Extra user event features to include in the recommendation model.
206
+ // These attributes must NOT contain data that needs to be parsed or processed
207
+ // further, e.g. JSON or other encodings.
208
+ //
209
+ // If you provide custom attributes for ingested user events, also include
210
+ // them in the user events that you associate with prediction requests. Custom
211
+ // attribute formatting must be consistent between imported events and events
212
+ // provided with prediction requests. This lets the Discovery Engine API use
213
+ // those custom attributes when training models and serving predictions, which
214
+ // helps improve recommendation quality.
215
+ //
216
+ // This field needs to pass all below criteria, otherwise an
217
+ // `INVALID_ARGUMENT` error is returned:
218
+ //
219
+ // * The key must be a UTF-8 encoded string with a length limit of 5,000
220
+ // characters.
221
+ // * For text attributes, at most 400 values are allowed. Empty values are not
222
+ // allowed. Each value must be a UTF-8 encoded string with a length limit of
223
+ // 256 characters.
224
+ // * For number attributes, at most 400 values are allowed.
225
+ //
226
+ // For product recommendations, an example of extra user information is
227
+ // `traffic_channel`, which is how a user arrives at the site. Users can
228
+ // arrive
229
+ // at the site by coming to the site directly, coming through Google
230
+ // search, or in other ways.
231
+ map<string, CustomAttribute> attributes = 17;
232
+
233
+ // Media-specific info.
234
+ MediaInfo media_info = 18;
235
+ }
236
+
237
+ // Detailed page information.
238
+ message PageInfo {
239
+ // A unique ID of a web page view.
240
+ //
241
+ // This should be kept the same for all user events triggered from the same
242
+ // pageview. For example, an item detail page view could trigger multiple
243
+ // events as the user is browsing the page. The `pageview_id` property should
244
+ // be kept the same for all these events so that they can be grouped together
245
+ // properly.
246
+ //
247
+ // When using the client side event reporting with JavaScript pixel and Google
248
+ // Tag Manager, this value is filled in automatically.
249
+ string pageview_id = 1;
250
+
251
+ // The most specific category associated with a category page.
252
+ //
253
+ // To represent full path of category, use '>' sign to separate different
254
+ // hierarchies. If '>' is part of the category name, please replace it with
255
+ // other character(s).
256
+ //
257
+ // Category pages include special pages such as sales or promotions. For
258
+ // instance, a special sale page may have the category hierarchy:
259
+ // `"pageCategory" : "Sales > 2017 Black Friday Deals"`.
260
+ //
261
+ // Required for `view-category-page` events. Other event types should not set
262
+ // this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
263
+ string page_category = 2;
264
+
265
+ // Complete URL (window.location.href) of the user's current page.
266
+ //
267
+ // When using the client side event reporting with JavaScript pixel and Google
268
+ // Tag Manager, this value is filled in automatically. Maximum length 5,000
269
+ // characters.
270
+ string uri = 3;
271
+
272
+ // The referrer URL of the current page.
273
+ //
274
+ // When using the client side event reporting with JavaScript pixel and Google
275
+ // Tag Manager, this value is filled in automatically. However, some browser
276
+ // privacy restrictions may cause this field to be empty.
277
+ string referrer_uri = 4;
278
+ }
279
+
280
+ // Detailed search information.
281
+ message SearchInfo {
282
+ // The user's search query.
283
+ //
284
+ // See
285
+ // [SearchRequest.query][google.cloud.discoveryengine.v1alpha.SearchRequest.query]
286
+ // for definition.
287
+ //
288
+ // The value must be a UTF-8 encoded string with a length limit of 5,000
289
+ // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
290
+ //
291
+ // At least one of
292
+ // [search_query][google.cloud.discoveryengine.v1alpha.SearchInfo.search_query]
293
+ // or
294
+ // [PageInfo.page_category][google.cloud.discoveryengine.v1alpha.PageInfo.page_category]
295
+ // is required for `search` events. Other event types should not set this
296
+ // field. Otherwise, an `INVALID_ARGUMENT` error is returned.
297
+ string search_query = 1;
298
+
299
+ // The order in which products are returned, if applicable.
300
+ //
301
+ // See
302
+ // [SearchRequest.order_by][google.cloud.discoveryengine.v1alpha.SearchRequest.order_by]
303
+ // for definition and syntax.
304
+ //
305
+ // The value must be a UTF-8 encoded string with a length limit of 1,000
306
+ // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
307
+ //
308
+ // This can only be set for `search` events. Other event types should not set
309
+ // this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
310
+ string order_by = 2;
311
+
312
+ // An integer that specifies the current offset for pagination (the 0-indexed
313
+ // starting location, amongst the products deemed by the API as relevant).
314
+ //
315
+ // See
316
+ // [SearchRequest.offset][google.cloud.discoveryengine.v1alpha.SearchRequest.offset]
317
+ // for definition.
318
+ //
319
+ // If this field is negative, an `INVALID_ARGUMENT` is returned.
320
+ //
321
+ // This can only be set for `search` events. Other event types should not set
322
+ // this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
323
+ optional int32 offset = 3;
324
+ }
325
+
326
+ // Detailed completion information including completion attribution token and
327
+ // clicked completion info.
328
+ message CompletionInfo {
329
+ // End user selected
330
+ // [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion].
331
+ string selected_suggestion = 1;
332
+
333
+ // End user selected
334
+ // [CompleteQueryResponse.QuerySuggestion.suggestion][google.cloud.discoveryengine.v1alpha.CompleteQueryResponse.QuerySuggestion.suggestion]
335
+ // position, starting from 0.
336
+ int32 selected_position = 2;
337
+ }
338
+
339
+ // A transaction represents the entire purchase transaction.
340
+ message TransactionInfo {
341
+ // Required. Total non-zero value associated with the transaction. This value
342
+ // may include shipping, tax, or other adjustments to the total value that you
343
+ // want to include.
344
+ optional float value = 1 [(google.api.field_behavior) = REQUIRED];
345
+
346
+ // Required. Currency code. Use three-character ISO-4217 code.
347
+ string currency = 2 [(google.api.field_behavior) = REQUIRED];
348
+
349
+ // The transaction ID with a length limit of 128 characters.
350
+ string transaction_id = 3;
351
+
352
+ // All the taxes associated with the transaction.
353
+ optional float tax = 4;
354
+
355
+ // All the costs associated with the products. These can be manufacturing
356
+ // costs, shipping expenses not borne by the end user, or any other costs,
357
+ // such that:
358
+ //
359
+ // * Profit =
360
+ // [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
361
+ // [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
362
+ // [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
363
+ optional float cost = 5;
364
+
365
+ // The total discount(s) value applied to this transaction.
366
+ // This figure should be excluded from
367
+ // [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
368
+ //
369
+ // For example, if a user paid
370
+ // [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
371
+ // amount, then nominal (pre-discount) value of the transaction is the sum of
372
+ // [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]
373
+ // and
374
+ // [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
375
+ //
376
+ // This means that profit is calculated the same way, regardless of the
377
+ // discount value, and that
378
+ // [TransactionInfo.discount_value][google.cloud.discoveryengine.v1alpha.TransactionInfo.discount_value]
379
+ // can be larger than
380
+ // [TransactionInfo.value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value]:
381
+ //
382
+ // * Profit =
383
+ // [value][google.cloud.discoveryengine.v1alpha.TransactionInfo.value] -
384
+ // [tax][google.cloud.discoveryengine.v1alpha.TransactionInfo.tax] -
385
+ // [cost][google.cloud.discoveryengine.v1alpha.TransactionInfo.cost]
386
+ optional float discount_value = 6;
387
+ }
388
+
389
+ // Detailed document information associated with a user event.
390
+ message DocumentInfo {
391
+ // A required descriptor of the associated
392
+ // [Document][google.cloud.discoveryengine.v1alpha.Document].
393
+ //
394
+ // * If [id][google.cloud.discoveryengine.v1alpha.DocumentInfo.id] is
395
+ // specified, then the default values for
396
+ // `{location}`, `{collection_id}`, `{data_store_id}`, and `{branch_id}` are
397
+ // used when annotating with the stored Document.
398
+ //
399
+ // * If [name][google.cloud.discoveryengine.v1alpha.DocumentInfo.name] is
400
+ // specified, then the provided values (default values allowed) for
401
+ // `{location}`, `{collection_id}`, `{data_store_id}`, and
402
+ // `{branch_id}` are used when annotating with the stored Document.
403
+ oneof document_descriptor {
404
+ // The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
405
+ // ID.
406
+ string id = 1;
407
+
408
+ // The [Document][google.cloud.discoveryengine.v1alpha.Document] resource
409
+ // full name, of the form:
410
+ // `projects/{project_id}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
411
+ string name = 2 [(google.api.resource_reference) = {
412
+ type: "discoveryengine.googleapis.com/Document"
413
+ }];
414
+
415
+ // The [Document][google.cloud.discoveryengine.v1alpha.Document] URI - only
416
+ // allowed for website data stores.
417
+ string uri = 6;
418
+ }
419
+
420
+ // Quantity of the Document associated with the user event. Defaults to 1.
421
+ //
422
+ // For example, this field will be 2 if two quantities of the same Document
423
+ // are involved in a `add-to-cart` event.
424
+ //
425
+ // Required for events of the following event types:
426
+ //
427
+ // * `add-to-cart`
428
+ // * `purchase`
429
+ optional int32 quantity = 3;
430
+
431
+ // The promotion IDs associated with this Document.
432
+ // Currently, this field is restricted to at most one ID.
433
+ repeated string promotion_ids = 4;
434
+ }
435
+
436
+ // Detailed panel information associated with a user event.
437
+ message PanelInfo {
438
+ // Required. The panel ID.
439
+ string panel_id = 2 [(google.api.field_behavior) = REQUIRED];
440
+
441
+ // The display name of the panel.
442
+ string display_name = 3;
443
+
444
+ // The ordered position of the panel, if shown to the user with other panels.
445
+ // If set, then
446
+ // [total_panels][google.cloud.discoveryengine.v1alpha.PanelInfo.total_panels]
447
+ // must also be set.
448
+ optional int32 panel_position = 4;
449
+
450
+ // The total number of panels, including this one, shown to the user.
451
+ // Must be set if
452
+ // [panel_position][google.cloud.discoveryengine.v1alpha.PanelInfo.panel_position]
453
+ // is set.
454
+ optional int32 total_panels = 5;
455
+ }
456
+
457
+ // Media-specific user event information.
458
+ message MediaInfo {
459
+ // The media progress time in seconds, if applicable.
460
+ // For example, if the end user has finished 90 seconds of a playback video,
461
+ // then
462
+ // [MediaInfo.media_progress_duration.seconds][google.protobuf.Duration.seconds]
463
+ // should be set to 90.
464
+ google.protobuf.Duration media_progress_duration = 1;
465
+
466
+ // Media progress should be computed using only the
467
+ // [media_progress_duration][google.cloud.discoveryengine.v1alpha.MediaInfo.media_progress_duration]
468
+ // relative to the media total length.
469
+ //
470
+ // This value must be between `[0, 1.0]` inclusive.
471
+ //
472
+ // If this is not a playback or the progress cannot be computed (e.g. ongoing
473
+ // livestream), this field should be unset.
474
+ optional float media_progress_percentage = 2;
475
+ }