@google-cloud/discoveryengine 0.4.1 → 0.6.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 (37) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +8 -0
  3. package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +43 -10
  4. package/build/protos/google/cloud/discoveryengine/v1beta/completion_service.proto +116 -0
  5. package/build/protos/google/cloud/discoveryengine/v1beta/document.proto +45 -3
  6. package/build/protos/google/cloud/discoveryengine/v1beta/document_service.proto +46 -12
  7. package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +26 -8
  8. package/build/protos/google/cloud/discoveryengine/v1beta/purge_config.proto +86 -0
  9. package/build/protos/google/cloud/discoveryengine/v1beta/recommendation_service.proto +15 -14
  10. package/build/protos/google/cloud/discoveryengine/v1beta/schema.proto +58 -0
  11. package/build/protos/google/cloud/discoveryengine/v1beta/schema_service.proto +259 -0
  12. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +546 -0
  13. package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +31 -25
  14. package/build/protos/protos.d.ts +5965 -1866
  15. package/build/protos/protos.js +39781 -1
  16. package/build/protos/protos.json +3963 -1
  17. package/build/src/index.d.ts +10 -1
  18. package/build/src/index.js +10 -1
  19. package/build/src/v1beta/completion_service_client.d.ts +455 -0
  20. package/build/src/v1beta/completion_service_client.js +659 -0
  21. package/build/src/v1beta/completion_service_client_config.json +43 -0
  22. package/build/src/v1beta/document_service_client.d.ts +174 -18
  23. package/build/src/v1beta/document_service_client.js +177 -6
  24. package/build/src/v1beta/document_service_client_config.json +5 -0
  25. package/build/src/v1beta/index.d.ts +3 -0
  26. package/build/src/v1beta/index.js +7 -1
  27. package/build/src/v1beta/recommendation_service_client.d.ts +108 -14
  28. package/build/src/v1beta/recommendation_service_client.js +128 -0
  29. package/build/src/v1beta/schema_service_client.d.ts +798 -0
  30. package/build/src/v1beta/schema_service_client.js +1122 -0
  31. package/build/src/v1beta/schema_service_client_config.json +63 -0
  32. package/build/src/v1beta/search_service_client.d.ts +851 -0
  33. package/build/src/v1beta/search_service_client.js +1070 -0
  34. package/build/src/v1beta/search_service_client_config.json +43 -0
  35. package/build/src/v1beta/user_event_service_client.d.ts +93 -0
  36. package/build/src/v1beta/user_event_service_client.js +128 -0
  37. package/package.json +8 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.6.0](https://github.com/googleapis/google-cloud-node/compare/discoveryengine-v0.5.0...discoveryengine-v0.6.0) (2023-05-04)
4
+
5
+
6
+ ### Features
7
+
8
+ * [discoveryengine] add document purge API ([#4219](https://github.com/googleapis/google-cloud-node/issues/4219)) ([454fa79](https://github.com/googleapis/google-cloud-node/commit/454fa7943ddf664bc54a67e654d7e8a39ea55fed))
9
+
10
+ ## [0.5.0](https://github.com/googleapis/google-cloud-node/compare/discoveryengine-v0.4.1...discoveryengine-v0.5.0) (2023-04-24)
11
+
12
+
13
+ ### Features
14
+
15
+ * [discoveryengine] add search, autocomplete and schema services ([#4201](https://github.com/googleapis/google-cloud-node/issues/4201)) ([de00e1d](https://github.com/googleapis/google-cloud-node/commit/de00e1d88877dd674dfd20b78a3de4476d65eb29))
16
+
3
17
  ## [0.4.1](https://github.com/googleapis/google-cloud-node/compare/discoveryengine-v0.4.0...discoveryengine-v0.4.1) (2023-04-13)
4
18
 
5
19
 
package/README.md CHANGED
@@ -125,13 +125,21 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
125
125
 
126
126
  | Sample | Source Code | Try it |
127
127
  | --------------------------- | --------------------------------- | ------ |
128
+ | Completion_service.complete_query | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/completion_service.complete_query.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/completion_service.complete_query.js,samples/README.md) |
128
129
  | Document_service.create_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.create_document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.create_document.js,samples/README.md) |
129
130
  | Document_service.delete_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.delete_document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.delete_document.js,samples/README.md) |
130
131
  | Document_service.get_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.get_document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.get_document.js,samples/README.md) |
131
132
  | Document_service.import_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.import_documents.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.import_documents.js,samples/README.md) |
132
133
  | Document_service.list_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.list_documents.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.list_documents.js,samples/README.md) |
134
+ | Document_service.purge_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.purge_documents.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.purge_documents.js,samples/README.md) |
133
135
  | Document_service.update_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.update_document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/document_service.update_document.js,samples/README.md) |
134
136
  | Recommendation_service.recommend | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/recommendation_service.recommend.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/recommendation_service.recommend.js,samples/README.md) |
137
+ | Schema_service.create_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.create_schema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.create_schema.js,samples/README.md) |
138
+ | Schema_service.delete_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.delete_schema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.delete_schema.js,samples/README.md) |
139
+ | Schema_service.get_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.get_schema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.get_schema.js,samples/README.md) |
140
+ | Schema_service.list_schemas | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.list_schemas.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.list_schemas.js,samples/README.md) |
141
+ | Schema_service.update_schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.update_schema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/schema_service.update_schema.js,samples/README.md) |
142
+ | Search_service.search | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/search_service.search.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/search_service.search.js,samples/README.md) |
135
143
  | User_event_service.collect_user_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/user_event_service.collect_user_event.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/user_event_service.collect_user_event.js,samples/README.md) |
136
144
  | User_event_service.import_user_events | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/user_event_service.import_user_events.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/user_event_service.import_user_events.js,samples/README.md) |
137
145
  | User_event_service.write_user_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-discoveryengine/samples/generated/v1beta/user_event_service.write_user_event.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-discoveryengine/samples/generated/v1beta/user_event_service.write_user_event.js,samples/README.md) |
@@ -42,28 +42,59 @@ option (google.api.resource_definition) = {
42
42
  pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}"
43
43
  };
44
44
 
45
+ // A floating point interval.
46
+ message Interval {
47
+ // The lower bound of the interval. If neither of the min fields are
48
+ // set, then the lower bound is negative infinity.
49
+ //
50
+ // This field must be not larger than max.
51
+ // Otherwise, an `INVALID_ARGUMENT` error is returned.
52
+ oneof min {
53
+ // Inclusive lower bound.
54
+ double minimum = 1;
55
+
56
+ // Exclusive lower bound.
57
+ double exclusive_minimum = 2;
58
+ }
59
+
60
+ // The upper bound of the interval. If neither of the max fields are
61
+ // set, then the upper bound is positive infinity.
62
+ //
63
+ // This field must be not smaller than min.
64
+ // Otherwise, an `INVALID_ARGUMENT` error is returned.
65
+ oneof max {
66
+ // Inclusive upper bound.
67
+ double maximum = 3;
68
+
69
+ // Exclusive upper bound.
70
+ double exclusive_maximum = 4;
71
+ }
72
+ }
73
+
45
74
  // A custom attribute that is not explicitly modeled in a resource, e.g.
46
75
  // [UserEvent][google.cloud.discoveryengine.v1beta.UserEvent].
47
76
  message CustomAttribute {
48
77
  // The textual values of this custom attribute. For example, `["yellow",
49
78
  // "green"]` when the key is "color".
50
79
  //
51
- // Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
80
+ // Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is
52
81
  // returned.
53
82
  //
54
83
  // Exactly one of
55
- // [text][google.cloud.discoveryengine.v1beta.CustomAttribute.text] or
56
- // [numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
57
- // should be set. Otherwise, an INVALID_ARGUMENT error is returned.
84
+ // [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
85
+ // or
86
+ // [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
87
+ // should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
58
88
  repeated string text = 1;
59
89
 
60
90
  // The numerical values of this custom attribute. For example, `[2.3, 15.4]`
61
91
  // when the key is "lengths_cm".
62
92
  //
63
93
  // Exactly one of
64
- // [text][google.cloud.discoveryengine.v1beta.CustomAttribute.text] or
65
- // [numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
66
- // should be set. Otherwise, an INVALID_ARGUMENT error is returned.
94
+ // [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
95
+ // or
96
+ // [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
97
+ // should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
67
98
  repeated double numbers = 2;
68
99
  }
69
100
 
@@ -79,18 +110,20 @@ message UserInfo {
79
110
  // model quality.
80
111
  //
81
112
  // The field must be a UTF-8 encoded string with a length limit of 128
82
- // characters. Otherwise, an INVALID_ARGUMENT error is returned.
113
+ // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
83
114
  string user_id = 1;
84
115
 
85
116
  // User agent as included in the HTTP header. Required for getting
86
117
  // [SearchResponse.sponsored_results][].
87
118
  //
88
119
  // The field must be a UTF-8 encoded string with a length limit of 1,000
89
- // characters. Otherwise, an INVALID_ARGUMENT error is returned.
120
+ // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
90
121
  //
91
122
  // This should not be set when using the client side event reporting with
92
123
  // GTM or JavaScript tag in
93
124
  // [UserEventService.CollectUserEvent][google.cloud.discoveryengine.v1beta.UserEventService.CollectUserEvent]
94
- // or if [direct_user_request][] is set.
125
+ // or if
126
+ // [UserEvent.direct_user_request][google.cloud.discoveryengine.v1beta.UserEvent.direct_user_request]
127
+ // is set.
95
128
  string user_agent = 2;
96
129
  }
@@ -0,0 +1,116 @@
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.v1beta;
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
+
24
+ option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta";
25
+ option go_package = "cloud.google.com/go/discoveryengine/apiv1beta/discoveryenginepb;discoveryenginepb";
26
+ option java_multiple_files = true;
27
+ option java_outer_classname = "CompletionServiceProto";
28
+ option java_package = "com.google.cloud.discoveryengine.v1beta";
29
+ option objc_class_prefix = "DISCOVERYENGINE";
30
+ option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta";
31
+ option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta";
32
+
33
+ // Service for Auto-Completion.
34
+ service CompletionService {
35
+ option (google.api.default_host) = "discoveryengine.googleapis.com";
36
+ option (google.api.oauth_scopes) =
37
+ "https://www.googleapis.com/auth/cloud-platform";
38
+
39
+ // Completes the specified user input with keyword suggestions.
40
+ rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) {
41
+ option (google.api.http) = {
42
+ get: "/v1beta/{data_store=projects/*/locations/*/dataStores/*}:completeQuery"
43
+ additional_bindings {
44
+ get: "/v1beta/{data_store=projects/*/locations/*/collections/*/dataStores/*}:completeQuery"
45
+ }
46
+ };
47
+ }
48
+ }
49
+
50
+ // Request message for
51
+ // [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1beta.CompletionService.CompleteQuery]
52
+ // method.
53
+ message CompleteQueryRequest {
54
+ // Required. The parent data store resource name for which the completion is
55
+ // performed, such as
56
+ // `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.
57
+ string data_store = 1 [
58
+ (google.api.field_behavior) = REQUIRED,
59
+ (google.api.resource_reference) = {
60
+ type: "discoveryengine.googleapis.com/DataStore"
61
+ }
62
+ ];
63
+
64
+ // Required. The typeahead input used to fetch suggestions. Maximum length is
65
+ // 128 characters.
66
+ string query = 2 [(google.api.field_behavior) = REQUIRED];
67
+
68
+ // Selects data model of query suggestions for serving. Currently supported
69
+ // values:
70
+ //
71
+ // * `document` - Using suggestions generated from user-imported documents.
72
+ // * `search-history` - Using suggestions generated from the past history of
73
+ // [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
74
+ // API calls. Do not use it when there is no traffic for Search API.
75
+ // * `user-event` - Using suggestions generated from user-imported search
76
+ // events.
77
+ //
78
+ // Default values:
79
+ //
80
+ // * `document` is the default model for regular dataStores.
81
+ // * `search-history` is the default model for
82
+ // [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH]
83
+ // dataStores.
84
+ string query_model = 3;
85
+
86
+ // A unique identifier for tracking visitors. For example, this could be
87
+ // implemented with an HTTP cookie, which should be able to uniquely identify
88
+ // a visitor on a single device. This unique identifier should not change if
89
+ // the visitor logs in or out of the website.
90
+ //
91
+ // This field should NOT have a fixed value such as `unknown_visitor`.
92
+ //
93
+ // This should be the same identifier as
94
+ // [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1beta.UserEvent.user_pseudo_id]
95
+ // and
96
+ // [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1beta.SearchRequest.user_pseudo_id].
97
+ //
98
+ // The field must be a UTF-8 encoded string with a length limit of 128
99
+ // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
100
+ string user_pseudo_id = 4;
101
+ }
102
+
103
+ // Response message for
104
+ // [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1beta.CompletionService.CompleteQuery]
105
+ // method.
106
+ message CompleteQueryResponse {
107
+ // Suggestions as search queries.
108
+ message QuerySuggestion {
109
+ // The suggestion for the query.
110
+ string suggestion = 1;
111
+ }
112
+
113
+ // Results of the matched query suggestions. The result list is ordered and
114
+ // the first result is a top suggestion.
115
+ repeated QuerySuggestion query_suggestions = 1;
116
+ }
@@ -38,17 +38,49 @@ message Document {
38
38
  pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}"
39
39
  };
40
40
 
41
+ // Unstructured data linked to this document.
42
+ message Content {
43
+ oneof content {
44
+ // The content represented as a stream of bytes. The maximum length is
45
+ // 1,000,000 bytes (1 MB / ~0.95 MiB).
46
+ //
47
+ // Note: As with all `bytes` fields, this field is represented as pure
48
+ // binary in Protocol Buffers and base64-encoded string in JSON. For
49
+ // example, `abc123!?$*&()'-=@~` should be represented as
50
+ // `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See
51
+ // https://developers.google.com/protocol-buffers/docs/proto3#json.
52
+ bytes raw_bytes = 2;
53
+
54
+ // The URI of the content. Only Cloud Storage URIs (e.g.
55
+ // `gs://bucket-name/path/to/file`) are supported. The maximum file size
56
+ // is 100 MB.
57
+ string uri = 3;
58
+ }
59
+
60
+ // The MIME type of the content. Supported types:
61
+ //
62
+ // * `application/pdf` (PDF)
63
+ // * `text/html` (HTML)
64
+ //
65
+ // See https://www.iana.org/assignments/media-types/media-types.xhtml.
66
+ string mime_type = 1;
67
+ }
68
+
41
69
  // Data representation. One of
42
70
  // [struct_data][google.cloud.discoveryengine.v1beta.Document.struct_data] or
43
71
  // [json_data][google.cloud.discoveryengine.v1beta.Document.json_data] should
44
- // be provided otherwise an INVALID_ARGUMENT error is thrown.
72
+ // be provided otherwise an `INVALID_ARGUMENT` error is thrown.
45
73
  oneof data {
46
74
  // The structured JSON data for the document. It should conform to the
47
- // registered [schema][] or an INVALID_ARGUMENT error is thrown.
75
+ // registered
76
+ // [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an
77
+ // `INVALID_ARGUMENT` error is thrown.
48
78
  google.protobuf.Struct struct_data = 4;
49
79
 
50
80
  // The JSON string representation of the document. It should conform to the
51
- // registered [schema][] or an INVALID_ARGUMENT error is thrown.
81
+ // registered
82
+ // [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an
83
+ // `INVALID_ARGUMENT` error is thrown.
52
84
  string json_data = 5;
53
85
  }
54
86
 
@@ -69,10 +101,20 @@ message Document {
69
101
  // The identifier of the schema located in the same data store.
70
102
  string schema_id = 3;
71
103
 
104
+ // The unstructured data linked to this document. Content must be set if this
105
+ // document is under a
106
+ // `CONTENT_REQUIRED` data store.
107
+ Content content = 10;
108
+
72
109
  // The identifier of the parent document. Currently supports at most two level
73
110
  // document hierarchy.
74
111
  //
75
112
  // Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
76
113
  // standard with a length limit of 63 characters.
77
114
  string parent_document_id = 7;
115
+
116
+ // Output only. This field is OUTPUT_ONLY.
117
+ // It contains derived data that are not in the original input document.
118
+ google.protobuf.Struct derived_struct_data = 6
119
+ [(google.api.field_behavior) = OUTPUT_ONLY];
78
120
  }
@@ -22,6 +22,7 @@ import "google/api/field_behavior.proto";
22
22
  import "google/api/resource.proto";
23
23
  import "google/cloud/discoveryengine/v1beta/document.proto";
24
24
  import "google/cloud/discoveryengine/v1beta/import_config.proto";
25
+ import "google/cloud/discoveryengine/v1beta/purge_config.proto";
25
26
  import "google/longrunning/operations.proto";
26
27
  import "google/protobuf/empty.proto";
27
28
 
@@ -122,6 +123,39 @@ service DocumentService {
122
123
  metadata_type: "google.cloud.discoveryengine.v1beta.ImportDocumentsMetadata"
123
124
  };
124
125
  }
126
+
127
+ // Permanently deletes all selected
128
+ // [Document][google.cloud.discoveryengine.v1beta.Document]s in a branch.
129
+ //
130
+ // This process is asynchronous. Depending on the number of
131
+ // [Document][google.cloud.discoveryengine.v1beta.Document]s to be deleted,
132
+ // this operation can take hours to complete. Before the delete operation
133
+ // completes, some [Document][google.cloud.discoveryengine.v1beta.Document]s
134
+ // might still be returned by
135
+ // [DocumentService.GetDocument][google.cloud.discoveryengine.v1beta.DocumentService.GetDocument]
136
+ // or
137
+ // [DocumentService.ListDocuments][google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments].
138
+ //
139
+ // To get a list of the
140
+ // [Document][google.cloud.discoveryengine.v1beta.Document]s to be deleted,
141
+ // set
142
+ // [PurgeDocumentsRequest.force][google.cloud.discoveryengine.v1beta.PurgeDocumentsRequest.force]
143
+ // to false.
144
+ rpc PurgeDocuments(PurgeDocumentsRequest)
145
+ returns (google.longrunning.Operation) {
146
+ option (google.api.http) = {
147
+ post: "/v1beta/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:purge"
148
+ body: "*"
149
+ additional_bindings {
150
+ post: "/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:purge"
151
+ body: "*"
152
+ }
153
+ };
154
+ option (google.longrunning.operation_info) = {
155
+ response_type: "google.cloud.discoveryengine.v1beta.PurgeDocumentsResponse"
156
+ metadata_type: "google.cloud.discoveryengine.v1beta.PurgeDocumentsMetadata"
157
+ };
158
+ }
125
159
  }
126
160
 
127
161
  // Request message for
@@ -134,10 +168,10 @@ message GetDocumentRequest {
134
168
  //
135
169
  // If the caller does not have permission to access the
136
170
  // [Document][google.cloud.discoveryengine.v1beta.Document], regardless of
137
- // whether or not it exists, a PERMISSION_DENIED error is returned.
171
+ // whether or not it exists, a `PERMISSION_DENIED` error is returned.
138
172
  //
139
173
  // If the requested [Document][google.cloud.discoveryengine.v1beta.Document]
140
- // does not exist, a NOT_FOUND error is returned.
174
+ // does not exist, a `NOT_FOUND` error is returned.
141
175
  string name = 1 [
142
176
  (google.api.field_behavior) = REQUIRED,
143
177
  (google.api.resource_reference) = {
@@ -157,7 +191,7 @@ message ListDocumentsRequest {
157
191
  //
158
192
  // If the caller does not have permission to list [Documents][]s under this
159
193
  // branch, regardless of whether or not this branch exists, a
160
- // PERMISSION_DENIED error is returned.
194
+ // `PERMISSION_DENIED` error is returned.
161
195
  string parent = 1 [
162
196
  (google.api.field_behavior) = REQUIRED,
163
197
  (google.api.resource_reference) = {
@@ -169,7 +203,7 @@ message ListDocumentsRequest {
169
203
  // to return. If unspecified, defaults to 100. The maximum allowed value is
170
204
  // 1000. Values above 1000 will be coerced to 1000.
171
205
  //
172
- // If this field is negative, an INVALID_ARGUMENT error is returned.
206
+ // If this field is negative, an `INVALID_ARGUMENT` error is returned.
173
207
  int32 page_size = 2;
174
208
 
175
209
  // A page token
@@ -181,7 +215,7 @@ message ListDocumentsRequest {
181
215
  // When paginating, all other parameters provided to
182
216
  // [DocumentService.ListDocuments][google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments]
183
217
  // must match the call that provided the page token. Otherwise, an
184
- // INVALID_ARGUMENT error is returned.
218
+ // `INVALID_ARGUMENT` error is returned.
185
219
  string page_token = 3;
186
220
  }
187
221
 
@@ -223,16 +257,16 @@ message CreateDocumentRequest {
223
257
  //
224
258
  // If the caller does not have permission to create the
225
259
  // [Document][google.cloud.discoveryengine.v1beta.Document], regardless of
226
- // whether or not it exists, a PERMISSION_DENIED error is returned.
260
+ // whether or not it exists, a `PERMISSION_DENIED` error is returned.
227
261
  //
228
262
  // This field must be unique among all
229
263
  // [Document][google.cloud.discoveryengine.v1beta.Document]s with the same
230
264
  // [parent][google.cloud.discoveryengine.v1beta.CreateDocumentRequest.parent].
231
- // Otherwise, an ALREADY_EXISTS error is returned.
265
+ // Otherwise, an `ALREADY_EXISTS` error is returned.
232
266
  //
233
267
  // This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
234
268
  // standard with a length limit of 63 characters. Otherwise, an
235
- // INVALID_ARGUMENT error is returned.
269
+ // `INVALID_ARGUMENT` error is returned.
236
270
  string document_id = 3 [(google.api.field_behavior) = REQUIRED];
237
271
  }
238
272
 
@@ -244,12 +278,12 @@ message UpdateDocumentRequest {
244
278
  //
245
279
  // If the caller does not have permission to update the
246
280
  // [Document][google.cloud.discoveryengine.v1beta.Document], regardless of
247
- // whether or not it exists, a PERMISSION_DENIED error is returned.
281
+ // whether or not it exists, a `PERMISSION_DENIED` error is returned.
248
282
  //
249
283
  // If the [Document][google.cloud.discoveryengine.v1beta.Document] to update
250
284
  // does not exist and
251
285
  // [allow_missing][google.cloud.discoveryengine.v1beta.UpdateDocumentRequest.allow_missing]
252
- // is not set, a NOT_FOUND error is returned.
286
+ // is not set, a `NOT_FOUND` error is returned.
253
287
  Document document = 1 [(google.api.field_behavior) = REQUIRED];
254
288
 
255
289
  // If set to true, and the
@@ -269,10 +303,10 @@ message DeleteDocumentRequest {
269
303
  //
270
304
  // If the caller does not have permission to delete the
271
305
  // [Document][google.cloud.discoveryengine.v1beta.Document], regardless of
272
- // whether or not it exists, a PERMISSION_DENIED error is returned.
306
+ // whether or not it exists, a `PERMISSION_DENIED` error is returned.
273
307
  //
274
308
  // If the [Document][google.cloud.discoveryengine.v1beta.Document] to delete
275
- // does not exist, a NOT_FOUND error is returned.
309
+ // does not exist, a `NOT_FOUND` error is returned.
276
310
  string name = 1 [
277
311
  (google.api.field_behavior) = REQUIRED,
278
312
  (google.api.resource_reference) = {
@@ -38,8 +38,11 @@ message GcsSource {
38
38
  // Required. Cloud Storage URIs to input files. URI can be up to
39
39
  // 2000 characters long. URIs can match the full object path (for example,
40
40
  // `gs://bucket/directory/object.json`) or a pattern matching one or more
41
- // files, such as `gs://bucket/directory/*.json`. A request can
42
- // contain at most 100 files, and each file can be up to 2 GB.
41
+ // files, such as `gs://bucket/directory/*.json`.
42
+ //
43
+ // A request can contain at most 100 files (or 100,000 files if `data_schema`
44
+ // is `content`). Each file can be up to 2 GB (or 100 MB if `data_schema` is
45
+ // `content`).
43
46
  repeated string input_uris = 1 [(google.api.field_behavior) = REQUIRED];
44
47
 
45
48
  // The schema to use when parsing the data from the source.
@@ -51,6 +54,12 @@ message GcsSource {
51
54
  // document must
52
55
  // have a valid
53
56
  // [Document.id][google.cloud.discoveryengine.v1beta.Document.id].
57
+ // * `content`: Unstructured data (e.g. PDF, HTML). Each file matched by
58
+ // `input_uris` will become a document, with the ID set to the first 128
59
+ // bits of SHA256(URI) encoded as a hex string.
60
+ // * `custom`: One custom data JSON per row in arbitrary format that conforms
61
+ // the defined [Schema][google.cloud.discoveryengine.v1beta.Schema] of the
62
+ // data store. This can only be used by the GENERIC Data Store vertical.
54
63
  //
55
64
  // Supported values for user even imports:
56
65
  //
@@ -88,14 +97,23 @@ message BigQuerySource {
88
97
 
89
98
  // The schema to use when parsing the data from the source.
90
99
  //
91
- // Supported values for imports:
100
+ // Supported values for user event imports:
92
101
  //
93
- // * `user_event` (default): One JSON
94
- // [UserEvent][google.cloud.discoveryengine.v1beta.UserEvent] per line.
102
+ // * `user_event` (default): One
103
+ // [UserEvent][google.cloud.discoveryengine.v1beta.UserEvent] per row.
95
104
  //
96
- // * `document` (default): One JSON
97
- // [Document][google.cloud.discoveryengine.v1beta.Document] per line. Each
98
- // document must have a valid [document.id][].
105
+ // Supported values for document imports:
106
+ //
107
+ // * `document` (default): One
108
+ // [Document][google.cloud.discoveryengine.v1beta.Document] format per
109
+ // row. Each document must have a valid
110
+ // [Document.id][google.cloud.discoveryengine.v1beta.Document.id] and one of
111
+ // [Document.json_data][google.cloud.discoveryengine.v1beta.Document.json_data]
112
+ // or
113
+ // [Document.struct_data][google.cloud.discoveryengine.v1beta.Document.struct_data].
114
+ // * `custom`: One custom data per row in arbitrary format that conforms the
115
+ // defined [Schema][google.cloud.discoveryengine.v1beta.Schema] of the data
116
+ // store. This can only be used by the GENERIC Data Store vertical.
99
117
  string data_schema = 6;
100
118
  }
101
119
 
@@ -0,0 +1,86 @@
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.v1beta;
18
+
19
+ import "google/api/field_behavior.proto";
20
+ import "google/api/resource.proto";
21
+ import "google/protobuf/timestamp.proto";
22
+
23
+ option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta";
24
+ option go_package = "cloud.google.com/go/discoveryengine/apiv1beta/discoveryenginepb;discoveryenginepb";
25
+ option java_multiple_files = true;
26
+ option java_outer_classname = "PurgeConfigProto";
27
+ option java_package = "com.google.cloud.discoveryengine.v1beta";
28
+ option objc_class_prefix = "DISCOVERYENGINE";
29
+ option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta";
30
+ option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta";
31
+
32
+ // Request message for
33
+ // [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1beta.DocumentService.PurgeDocuments]
34
+ // method.
35
+ message PurgeDocumentsRequest {
36
+ // Required. The parent resource name, such as
37
+ // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
38
+ string parent = 1 [
39
+ (google.api.field_behavior) = REQUIRED,
40
+ (google.api.resource_reference) = {
41
+ type: "discoveryengine.googleapis.com/Branch"
42
+ }
43
+ ];
44
+
45
+ // Required. Filter matching documents to purge. Only currently supported
46
+ // value is
47
+ // `*` (all items).
48
+ string filter = 2 [(google.api.field_behavior) = REQUIRED];
49
+
50
+ // Actually performs the purge. If `force` is set to false, return the
51
+ // expected purge count without deleting any documents.
52
+ bool force = 3;
53
+ }
54
+
55
+ // Response message for
56
+ // [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1beta.DocumentService.PurgeDocuments]
57
+ // method. If the long running operation is successfully done, then this message
58
+ // is returned by the google.longrunning.Operations.response field.
59
+ message PurgeDocumentsResponse {
60
+ // The total count of documents purged as a result of the operation.
61
+ int64 purge_count = 1;
62
+
63
+ // A sample of document names that will be deleted. Only populated if `force`
64
+ // is set to false. A max of 100 names will be returned and the names are
65
+ // chosen at random.
66
+ repeated string purge_sample = 2 [(google.api.resource_reference) = {
67
+ type: "discoveryengine.googleapis.com/Document"
68
+ }];
69
+ }
70
+
71
+ // Metadata related to the progress of the PurgeDocuments operation.
72
+ // This will be returned by the google.longrunning.Operation.metadata field.
73
+ message PurgeDocumentsMetadata {
74
+ // Operation create time.
75
+ google.protobuf.Timestamp create_time = 1;
76
+
77
+ // Operation last update time. If the operation is done, this is also the
78
+ // finish time.
79
+ google.protobuf.Timestamp update_time = 2;
80
+
81
+ // Count of entries that were deleted successfully.
82
+ int64 success_count = 3;
83
+
84
+ // Count of entries that encountered errors while processing.
85
+ int64 failure_count = 4;
86
+ }