1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
|
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.contentwarehouse.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/resource.proto";
import "google/cloud/contentwarehouse/v1/common.proto";
import "google/cloud/contentwarehouse/v1/document.proto";
import "google/cloud/contentwarehouse/v1/document_service_request.proto";
import "google/cloud/contentwarehouse/v1/histogram.proto";
import "google/cloud/contentwarehouse/v1/rule_engine.proto";
import "google/iam/v1/policy.proto";
import "google/protobuf/empty.proto";
option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse";
option java_multiple_files = true;
option java_outer_classname = "DocumentServiceProto";
option java_package = "com.google.cloud.contentwarehouse.v1";
// This service lets you manage document.
service DocumentService {
option (google.api.default_host) = "contentwarehouse.googleapis.com";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
// Creates a document.
rpc CreateDocument(CreateDocumentRequest) returns (CreateDocumentResponse) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/documents"
body: "*"
};
option (google.api.method_signature) = "parent,document";
}
// Gets a document. Returns NOT_FOUND if the document does not exist.
rpc GetDocument(GetDocumentRequest) returns (Document) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/documents/*}:get"
body: "*"
additional_bindings {
post: "/v1/{name=projects/*/locations/*/documents/referenceId/*}:get"
body: "*"
}
};
option (google.api.method_signature) = "name";
}
// Updates a document. Returns INVALID_ARGUMENT if the name of the document
// is non-empty and does not equal the existing name.
rpc UpdateDocument(UpdateDocumentRequest) returns (UpdateDocumentResponse) {
option (google.api.http) = {
patch: "/v1/{name=projects/*/locations/*/documents/*}"
body: "*"
additional_bindings {
patch: "/v1/{name=projects/*/locations/*/documents/referenceId/*}"
body: "*"
}
};
option (google.api.method_signature) = "document";
}
// Deletes a document. Returns NOT_FOUND if the document does not exist.
rpc DeleteDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/documents/*}:delete"
body: "*"
additional_bindings {
post: "/v1/{name=projects/*/locations/*/documents/referenceId/*}:delete"
body: "*"
}
};
option (google.api.method_signature) = "name";
}
// Searches for documents using provided [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
// This call only returns documents that the caller has permission to search
// against.
rpc SearchDocuments(SearchDocumentsRequest) returns (SearchDocumentsResponse) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/documents:search"
body: "*"
};
option (google.api.method_signature) = "parent";
}
// Gets the access control policy for a resource. Returns NOT_FOUND error if
// the resource does not exist. Returns an empty policy if the resource exists
// but does not have a policy set.
rpc FetchAcl(FetchAclRequest) returns (FetchAclResponse) {
option (google.api.http) = {
post: "/v1/{resource=projects/*/locations/*/documents/*}:fetchAcl"
body: "*"
additional_bindings {
post: "/v1/{resource=projects/*}:fetchAcl"
body: "*"
}
};
option (google.api.method_signature) = "resource";
}
// Sets the access control policy for a resource. Replaces any existing
// policy.
rpc SetAcl(SetAclRequest) returns (SetAclResponse) {
option (google.api.http) = {
post: "/v1/{resource=projects/*/locations/*/documents/*}:setAcl"
body: "*"
additional_bindings {
post: "/v1/{resource=projects/*}:setAcl"
body: "*"
}
};
option (google.api.method_signature) = "resource,policy";
}
}
// Response message for DocumentService.CreateDocument.
message CreateDocumentResponse {
// Document created after executing create request.
Document document = 1;
// Output from Rule Engine recording the rule evaluator and action executor's
// output.
//
// Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
RuleEngineOutput rule_engine_output = 2;
// Additional information for the API invocation, such as the request tracking
// id.
ResponseMetadata metadata = 3;
}
// Response message for DocumentService.UpdateDocument.
message UpdateDocumentResponse {
// Updated document after executing update request.
Document document = 1;
// Output from Rule Engine recording the rule evaluator and action executor's
// output.
//
// Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
RuleEngineOutput rule_engine_output = 2;
// Additional information for the API invocation, such as the request tracking
// id.
ResponseMetadata metadata = 3;
}
// Additional result info for the question-answering feature.
message QAResult {
// A text span in the search text snippet that represents a highlighted
// section (answer context, highly relevant sentence, etc.).
message Highlight {
// Start index of the highlight.
int32 start_index = 1;
// End index of the highlight, exclusive.
int32 end_index = 2;
}
// Highlighted sections in the snippet.
repeated Highlight highlights = 1;
// The calibrated confidence score for this document, in the range
// [0., 1.]. This represents the confidence level for whether the returned
// document and snippet answers the user's query.
float confidence_score = 2;
}
// Response message for DocumentService.SearchDocuments.
message SearchDocumentsResponse {
// Document entry with metadata inside [SearchDocumentsResponse][google.cloud.contentwarehouse.v1.SearchDocumentsResponse]
message MatchingDocument {
// Document that matches the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
// This document only contains indexed metadata information.
Document document = 1;
// Contains snippets of text from the document full raw text that most
// closely match a search query's keywords, if available. All HTML tags in
// the original fields are stripped when returned in this field, and
// matching query keywords are enclosed in HTML bold tags.
//
// If the question-answering feature is enabled, this field will instead
// contain a snippet that answers the user's natural-language query. No HTML
// bold tags will be present, and highlights in the answer snippet can be
// found in [QAResult.highlights][google.cloud.contentwarehouse.v1.QAResult.highlights].
string search_text_snippet = 2;
// Experimental.
// Additional result info if the question-answering feature is enabled.
QAResult qa_result = 3;
}
// The document entities that match the specified [SearchDocumentsRequest][google.cloud.contentwarehouse.v1.SearchDocumentsRequest].
repeated MatchingDocument matching_documents = 1;
// The token that specifies the starting position of the next page of results.
// This field is empty if there are no more results.
string next_page_token = 2;
// The total number of matched documents which is available only if the client
// set [SearchDocumentsRequest.require_total_size][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.require_total_size] to `true`. Otherwise, the
// value will be `-1`.
int32 total_size = 3;
// Additional information for the API invocation, such as the request tracking
// id.
ResponseMetadata metadata = 4;
// The histogram results that match with the specified
// [SearchDocumentsRequest.histogram_queries][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.histogram_queries].
repeated HistogramQueryResult histogram_query_results = 6;
}
// Response message for DocumentService.FetchAcl.
message FetchAclResponse {
// The IAM policy.
google.iam.v1.Policy policy = 1;
// Additional information for the API invocation, such as the request tracking
// id.
ResponseMetadata metadata = 2;
}
// Response message for DocumentService.SetAcl.
message SetAclResponse {
// The policy will be attached to a resource (e.g. projecct, document).
google.iam.v1.Policy policy = 1;
// Additional information for the API invocation, such as the request tracking
// id.
ResponseMetadata metadata = 2;
}
|