document_service.proto 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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.discoveryengine.v1beta;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/cloud/discoveryengine/v1beta/document.proto";
  21. import "google/cloud/discoveryengine/v1beta/import_config.proto";
  22. import "google/longrunning/operations.proto";
  23. import "google/protobuf/empty.proto";
  24. option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta";
  25. option go_package = "google.golang.org/genproto/googleapis/cloud/discoveryengine/v1beta;discoveryengine";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "DocumentServiceProto";
  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. // Service for ingesting
  33. // [Document][google.cloud.discoveryengine.v1beta.Document] information of the
  34. // customer's website.
  35. service DocumentService {
  36. option (google.api.default_host) = "discoveryengine.googleapis.com";
  37. option (google.api.oauth_scopes) =
  38. "https://www.googleapis.com/auth/cloud-platform";
  39. // Gets a [Document][google.cloud.discoveryengine.v1beta.Document].
  40. rpc GetDocument(GetDocumentRequest) returns (Document) {
  41. option (google.api.http) = {
  42. get: "/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}"
  43. };
  44. option (google.api.method_signature) = "name";
  45. }
  46. // Gets a list of [Document][google.cloud.discoveryengine.v1beta.Document]s.
  47. rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) {
  48. option (google.api.http) = {
  49. get: "/v1beta/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents"
  50. };
  51. option (google.api.method_signature) = "parent";
  52. }
  53. // Creates a [Document][google.cloud.discoveryengine.v1beta.Document].
  54. rpc CreateDocument(CreateDocumentRequest) returns (Document) {
  55. option (google.api.http) = {
  56. post: "/v1beta/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents"
  57. body: "document"
  58. };
  59. option (google.api.method_signature) = "parent,document,document_id";
  60. }
  61. // Updates a [Document][google.cloud.discoveryengine.v1beta.Document].
  62. rpc UpdateDocument(UpdateDocumentRequest) returns (Document) {
  63. option (google.api.http) = {
  64. patch: "/v1beta/{document.name=projects/*/locations/*/dataStores/*/branches/*/documents/*}"
  65. body: "document"
  66. };
  67. }
  68. // Deletes a [Document][google.cloud.discoveryengine.v1beta.Document].
  69. rpc DeleteDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) {
  70. option (google.api.http) = {
  71. delete: "/v1beta/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}"
  72. };
  73. option (google.api.method_signature) = "name";
  74. }
  75. // Bulk import of multiple
  76. // [Document][google.cloud.discoveryengine.v1beta.Document]s. Request
  77. // processing may be synchronous. Non-existing items will be created.
  78. //
  79. // Note: It is possible for a subset of the
  80. // [Document][google.cloud.discoveryengine.v1beta.Document]s to be
  81. // successfully updated.
  82. rpc ImportDocuments(ImportDocumentsRequest)
  83. returns (google.longrunning.Operation) {
  84. option (google.api.http) = {
  85. post: "/v1beta/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:import"
  86. body: "*"
  87. };
  88. option (google.longrunning.operation_info) = {
  89. response_type: "google.cloud.discoveryengine.v1beta.ImportDocumentsResponse"
  90. metadata_type: "google.cloud.discoveryengine.v1beta.ImportDocumentsMetadata"
  91. };
  92. }
  93. }
  94. // Request message for
  95. // [DocumentService.GetDocument][google.cloud.discoveryengine.v1beta.DocumentService.GetDocument]
  96. // method.
  97. message GetDocumentRequest {
  98. // Required. Full resource name of
  99. // [Document][google.cloud.discoveryengine.v1beta.Document], such as
  100. // `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
  101. //
  102. // If the caller does not have permission to access the
  103. // [Document][google.cloud.discoveryengine.v1beta.Document], regardless of
  104. // whether or not it exists, a PERMISSION_DENIED error is returned.
  105. //
  106. // If the requested [Document][google.cloud.discoveryengine.v1beta.Document]
  107. // does not exist, a NOT_FOUND error is returned.
  108. string name = 1 [
  109. (google.api.field_behavior) = REQUIRED,
  110. (google.api.resource_reference) = {
  111. type: "discoveryengine.googleapis.com/Document"
  112. }
  113. ];
  114. }
  115. // Request message for
  116. // [DocumentService.ListDocuments][google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments]
  117. // method.
  118. message ListDocumentsRequest {
  119. // Required. The parent branch resource name, such as
  120. // `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`.
  121. // Use `default_branch` as the branch ID, to list documents under the default
  122. // branch.
  123. //
  124. // If the caller does not have permission to list [Documents][]s under this
  125. // branch, regardless of whether or not this branch exists, a
  126. // PERMISSION_DENIED error is returned.
  127. string parent = 1 [
  128. (google.api.field_behavior) = REQUIRED,
  129. (google.api.resource_reference) = {
  130. type: "discoveryengine.googleapis.com/Branch"
  131. }
  132. ];
  133. // Maximum number of [Document][google.cloud.discoveryengine.v1beta.Document]s
  134. // to return. If unspecified, defaults to 100. The maximum allowed value is
  135. // 1000. Values above 1000 will be coerced to 1000.
  136. //
  137. // If this field is negative, an INVALID_ARGUMENT error is returned.
  138. int32 page_size = 2;
  139. // A page token
  140. // [ListDocumentsResponse.next_page_token][google.cloud.discoveryengine.v1beta.ListDocumentsResponse.next_page_token],
  141. // received from a previous
  142. // [DocumentService.ListDocuments][google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments]
  143. // call. Provide this to retrieve the subsequent page.
  144. //
  145. // When paginating, all other parameters provided to
  146. // [DocumentService.ListDocuments][google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments]
  147. // must match the call that provided the page token. Otherwise, an
  148. // INVALID_ARGUMENT error is returned.
  149. string page_token = 3;
  150. }
  151. // Response message for
  152. // [DocumentService.ListDocuments][google.cloud.discoveryengine.v1beta.DocumentService.ListDocuments]
  153. // method.
  154. message ListDocumentsResponse {
  155. // The [Document][google.cloud.discoveryengine.v1beta.Document]s.
  156. repeated Document documents = 1;
  157. // A token that can be sent as
  158. // [ListDocumentsRequest.page_token][google.cloud.discoveryengine.v1beta.ListDocumentsRequest.page_token]
  159. // to retrieve the next page. If this field is omitted, there are no
  160. // subsequent pages.
  161. string next_page_token = 2;
  162. }
  163. // Request message for
  164. // [DocumentService.CreateDocument][google.cloud.discoveryengine.v1beta.DocumentService.CreateDocument]
  165. // method.
  166. message CreateDocumentRequest {
  167. // Required. The parent resource name, such as
  168. // `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`.
  169. string parent = 1 [
  170. (google.api.field_behavior) = REQUIRED,
  171. (google.api.resource_reference) = {
  172. type: "discoveryengine.googleapis.com/Branch"
  173. }
  174. ];
  175. // Required. The [Document][google.cloud.discoveryengine.v1beta.Document] to
  176. // create.
  177. Document document = 2 [(google.api.field_behavior) = REQUIRED];
  178. // Required. The ID to use for the
  179. // [Document][google.cloud.discoveryengine.v1beta.Document], which will become
  180. // the final component of the
  181. // [Document.name][google.cloud.discoveryengine.v1beta.Document.name].
  182. //
  183. // If the caller does not have permission to create the
  184. // [Document][google.cloud.discoveryengine.v1beta.Document], regardless of
  185. // whether or not it exists, a PERMISSION_DENIED error is returned.
  186. //
  187. // This field must be unique among all
  188. // [Document][google.cloud.discoveryengine.v1beta.Document]s with the same
  189. // [parent][google.cloud.discoveryengine.v1beta.CreateDocumentRequest.parent].
  190. // Otherwise, an ALREADY_EXISTS error is returned.
  191. //
  192. // This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
  193. // standard with a length limit of 63 characters. Otherwise, an
  194. // INVALID_ARGUMENT error is returned.
  195. string document_id = 3 [(google.api.field_behavior) = REQUIRED];
  196. }
  197. // Request message for
  198. // [DocumentService.UpdateDocument][google.cloud.discoveryengine.v1beta.DocumentService.UpdateDocument]
  199. // method.
  200. message UpdateDocumentRequest {
  201. // Required. The document to update/create.
  202. //
  203. // If the caller does not have permission to update the
  204. // [Document][google.cloud.discoveryengine.v1beta.Document], regardless of
  205. // whether or not it exists, a PERMISSION_DENIED error is returned.
  206. //
  207. // If the [Document][google.cloud.discoveryengine.v1beta.Document] to update
  208. // does not exist and
  209. // [allow_missing][google.cloud.discoveryengine.v1beta.UpdateDocumentRequest.allow_missing]
  210. // is not set, a NOT_FOUND error is returned.
  211. Document document = 1 [(google.api.field_behavior) = REQUIRED];
  212. // If set to true, and the
  213. // [Document][google.cloud.discoveryengine.v1beta.Document] is not found, a
  214. // new [Document][google.cloud.discoveryengine.v1beta.Document] will be
  215. // created.
  216. bool allow_missing = 2;
  217. }
  218. // Request message for
  219. // [DocumentService.DeleteDocument][google.cloud.discoveryengine.v1beta.DocumentService.DeleteDocument]
  220. // method.
  221. message DeleteDocumentRequest {
  222. // Required. Full resource name of
  223. // [Document][google.cloud.discoveryengine.v1beta.Document], such as
  224. // `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
  225. //
  226. // If the caller does not have permission to delete the
  227. // [Document][google.cloud.discoveryengine.v1beta.Document], regardless of
  228. // whether or not it exists, a PERMISSION_DENIED error is returned.
  229. //
  230. // If the [Document][google.cloud.discoveryengine.v1beta.Document] to delete
  231. // does not exist, a NOT_FOUND error is returned.
  232. string name = 1 [
  233. (google.api.field_behavior) = REQUIRED,
  234. (google.api.resource_reference) = {
  235. type: "discoveryengine.googleapis.com/Document"
  236. }
  237. ];
  238. }