document_service_request.proto 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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. syntax = "proto3";
  15. package google.cloud.contentwarehouse.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/contentwarehouse/v1/common.proto";
  19. import "google/cloud/contentwarehouse/v1/document.proto";
  20. import "google/cloud/contentwarehouse/v1/filters.proto";
  21. import "google/cloud/contentwarehouse/v1/histogram.proto";
  22. import "google/iam/v1/policy.proto";
  23. import "google/protobuf/field_mask.proto";
  24. option go_package = "google.golang.org/genproto/googleapis/cloud/contentwarehouse/v1;contentwarehouse";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "DocumentServiceRequestProto";
  27. option java_package = "com.google.cloud.contentwarehouse.v1";
  28. // Request Option for processing Cloud AI Document in CW Document.
  29. message CloudAIDocumentOption {
  30. // Whether to convert all the entities to properties.
  31. bool enable_entities_conversions = 1;
  32. // If set, only selected entities will be converted to properties.
  33. map<string, string> customized_entities_properties_conversions = 2;
  34. }
  35. // Request message for DocumentService.CreateDocument.
  36. message CreateDocumentRequest {
  37. // Required. The parent name.
  38. // Format: projects/{project_number}/locations/{location}.
  39. string parent = 1 [
  40. (google.api.field_behavior) = REQUIRED,
  41. (google.api.resource_reference) = {
  42. type: "contentwarehouse.googleapis.com/Location"
  43. }
  44. ];
  45. // Required. The document to create.
  46. Document document = 2 [(google.api.field_behavior) = REQUIRED];
  47. // The meta information collected about the end user, used to enforce access
  48. // control for the service.
  49. RequestMetadata request_metadata = 3;
  50. // Default document policy during creation. Conditions defined in the policy
  51. // will be ignored.
  52. google.iam.v1.Policy policy = 4;
  53. // Request Option for processing Cloud AI Document in CW Document.
  54. CloudAIDocumentOption cloud_ai_document_option = 5;
  55. // Field mask for creating Document fields. If mask path is empty,
  56. // it means all fields are masked.
  57. // For the `FieldMask` definition,
  58. // see
  59. // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
  60. google.protobuf.FieldMask create_mask = 6;
  61. }
  62. // Request message for DocumentService.GetDocument.
  63. message GetDocumentRequest {
  64. // Required. The name of the document to retrieve.
  65. // Format:
  66. // projects/{project_number}/locations/{location}/documents/{document_id} or
  67. // projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}.
  68. string name = 1 [
  69. (google.api.field_behavior) = REQUIRED,
  70. (google.api.resource_reference) = {
  71. type: "contentwarehouse.googleapis.com/Document"
  72. }
  73. ];
  74. // The meta information collected about the end user, used to enforce access
  75. // control for the service.
  76. RequestMetadata request_metadata = 2;
  77. }
  78. // Request message for DocumentService.UpdateDocument.
  79. message UpdateDocumentRequest {
  80. // Required. The name of the document to update.
  81. // Format:
  82. // projects/{project_number}/locations/{location}/documents/{document_id}
  83. // or
  84. // projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}.
  85. string name = 1 [
  86. (google.api.field_behavior) = REQUIRED,
  87. (google.api.resource_reference) = {
  88. type: "contentwarehouse.googleapis.com/Document"
  89. }
  90. ];
  91. // Required. The document to update.
  92. Document document = 2 [(google.api.field_behavior) = REQUIRED];
  93. // The meta information collected about the end user, used to enforce access
  94. // control for the service.
  95. RequestMetadata request_metadata = 3;
  96. // Request Option for processing Cloud AI Document in CW Document.
  97. CloudAIDocumentOption cloud_ai_document_option = 5;
  98. // Options for the update operation.
  99. UpdateOptions update_options = 6;
  100. }
  101. // Request message for DocumentService.DeleteDocument.
  102. message DeleteDocumentRequest {
  103. // Required. The name of the document to delete.
  104. // Format:
  105. // projects/{project_number}/locations/{location}/documents/{document_id}
  106. // or
  107. // projects/{project_number}/locations/{location}/documents/referenceId/{reference_id}.
  108. string name = 1 [
  109. (google.api.field_behavior) = REQUIRED,
  110. (google.api.resource_reference) = {
  111. type: "contentwarehouse.googleapis.com/Document"
  112. }
  113. ];
  114. // The meta information collected about the end user, used to enforce access
  115. // control for the service.
  116. RequestMetadata request_metadata = 2;
  117. }
  118. // Request message for DocumentService.SearchDocuments.
  119. message SearchDocumentsRequest {
  120. // Required. The parent, which owns this collection of documents.
  121. // Format: projects/{project_number}/locations/{location}.
  122. string parent = 1 [
  123. (google.api.field_behavior) = REQUIRED,
  124. (google.api.resource_reference) = {
  125. type: "contentwarehouse.googleapis.com/Location"
  126. }
  127. ];
  128. // The meta information collected about the end user, used to enforce access
  129. // control and improve the search quality of the service.
  130. RequestMetadata request_metadata = 3;
  131. // Query used to search against documents (keyword, filters, etc.).
  132. DocumentQuery document_query = 4;
  133. // An integer that specifies the current offset (that is, starting result
  134. // location, amongst the documents deemed by the API as relevant) in search
  135. // results. This field is only considered if [page_token][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token] is unset.
  136. //
  137. // The maximum allowed value is 5000. Otherwise an error is thrown.
  138. //
  139. // For example, 0 means to return results starting from the first matching
  140. // document, and 10 means to return from the 11th document. This can be used
  141. // for pagination, (for example, pageSize = 10 and offset = 10 means to return
  142. // from the second page).
  143. int32 offset = 5;
  144. // A limit on the number of documents returned in the search results.
  145. // Increasing this value above the default value of 10 can increase search
  146. // response time. The value can be between 1 and 100.
  147. int32 page_size = 6;
  148. // The token specifying the current offset within search results.
  149. // See [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token] for an explanation of how
  150. // to obtain the next set of query results.
  151. string page_token = 7;
  152. // The criteria determining how search results are sorted. For non-empty
  153. // query, default is `"relevance desc"`. For empty query, default is
  154. // `"upload_date desc"`.
  155. //
  156. // Supported options are:
  157. //
  158. // * `"relevance desc"`: By relevance descending, as determined by the API
  159. // algorithms.
  160. // * `"upload_date desc"`: By upload date descending.
  161. // * `"upload_date"`: By upload date ascending.
  162. // * `"update_date desc"`: By last updated date descending.
  163. // * `"update_date"`: By last updated date ascending.
  164. string order_by = 8;
  165. // An expression specifying a histogram request against matching
  166. // documents. Expression syntax is an aggregation function call with
  167. // histogram facets and other options.
  168. //
  169. // The following aggregation functions are supported:
  170. //
  171. // * `count(string_histogram_facet)`: Count the number of matching entities
  172. // for each distinct attribute value.
  173. //
  174. // Data types:
  175. //
  176. // * Histogram facet (aka filterable properties): Facet names with format
  177. // &lt;schema id&gt;.&lt;facet&gt;. Facets will have the
  178. // format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child
  179. // facet, then the parent hierarchy needs to be specified separated by
  180. // dots in the prefix after the schema id. Thus, the format for a multi-
  181. // level facet is: &lt;schema id&gt;.&lt;parent facet name&gt;.
  182. // &lt;child facet name&gt;. Example:
  183. // schema123.root_parent_facet.middle_facet.child_facet
  184. // * DocumentSchemaId: (with no schema id prefix) to get
  185. // histograms for each document type (returns the schema id path, e.g.
  186. // projects/12345/locations/us-west/documentSchemas/abc123).
  187. //
  188. // Example expression:
  189. //
  190. // * Document type counts:
  191. // count('DocumentSchemaId')
  192. //
  193. // * For schema id, abc123, get the counts for MORTGAGE_TYPE:
  194. // count('abc123.MORTGAGE_TYPE')
  195. repeated HistogramQuery histogram_queries = 9;
  196. // Optional. Controls if the search document request requires the return of a total size
  197. // of matched documents. See [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
  198. //
  199. // Enabling this flag may adversely impact performance. Hint: If this is
  200. // used with pagination, set this flag on the initial query but set this
  201. // to false on subsequent page calls (keep the total count locally).
  202. //
  203. // Defaults to false.
  204. bool require_total_size = 10;
  205. // Experimental, do not use.
  206. // The limit on the number of documents returned for the question-answering
  207. // feature. To enable the question-answering feature, set
  208. // [DocumentQuery].[is_nl_query][] to true.
  209. int32 qa_size_limit = 11;
  210. }
  211. // Request message for DocumentService.FetchAcl
  212. message FetchAclRequest {
  213. // Required. REQUIRED: The resource for which the policy is being requested.
  214. // Format for document:
  215. // projects/{project_number}/locations/{location}/documents/{document_id}.
  216. // Format for project: projects/{project_number}.
  217. string resource = 1 [(google.api.field_behavior) = REQUIRED];
  218. // The meta information collected about the end user, used to enforce access
  219. // control for the service.
  220. RequestMetadata request_metadata = 2;
  221. // For Get Project ACL only. Authorization check for end user will be ignored
  222. // when project_owner=true.
  223. bool project_owner = 3;
  224. }
  225. // Request message for DocumentService.SetAcl.
  226. message SetAclRequest {
  227. // Required. REQUIRED: The resource for which the policy is being requested.
  228. // Format for document:
  229. // projects/{project_number}/locations/{location}/documents/{document_id}.
  230. // Format for project: projects/{project_number}.
  231. string resource = 1 [(google.api.field_behavior) = REQUIRED];
  232. // Required. REQUIRED: The complete policy to be applied to the `resource`. The size of
  233. // the policy is limited to a few 10s of KB.
  234. google.iam.v1.Policy policy = 2 [(google.api.field_behavior) = REQUIRED];
  235. // The meta information collected about the end user, used to enforce access
  236. // control for the service.
  237. RequestMetadata request_metadata = 3;
  238. // For Set Project ACL only. Authorization check for end user will be ignored
  239. // when project_owner=true.
  240. bool project_owner = 4;
  241. }