• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15syntax = "proto3";
16
17package google.cloud.discoveryengine.v1alpha;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/cloud/discoveryengine/v1alpha/data_store.proto";
24import "google/cloud/discoveryengine/v1alpha/document_processing_config.proto";
25import "google/longrunning/operations.proto";
26import "google/protobuf/empty.proto";
27import "google/protobuf/field_mask.proto";
28import "google/protobuf/timestamp.proto";
29
30option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha";
31option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb";
32option java_multiple_files = true;
33option java_outer_classname = "DataStoreServiceProto";
34option java_package = "com.google.cloud.discoveryengine.v1alpha";
35option objc_class_prefix = "DISCOVERYENGINE";
36option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha";
37option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha";
38
39// Service for managing
40// [DataStore][google.cloud.discoveryengine.v1alpha.DataStore] configuration.
41service DataStoreService {
42  option (google.api.default_host) = "discoveryengine.googleapis.com";
43  option (google.api.oauth_scopes) =
44      "https://www.googleapis.com/auth/cloud-platform";
45
46  // Creates a [DataStore][google.cloud.discoveryengine.v1alpha.DataStore].
47  //
48  // DataStore is for storing
49  // [Documents][google.cloud.discoveryengine.v1alpha.Document]. To serve these
50  // documents for Search, or Recommendation use case, an
51  // [Engine][google.cloud.discoveryengine.v1alpha.Engine] needs to be created
52  // separately.
53  rpc CreateDataStore(CreateDataStoreRequest)
54      returns (google.longrunning.Operation) {
55    option (google.api.http) = {
56      post: "/v1alpha/{parent=projects/*/locations/*}/dataStores"
57      body: "data_store"
58      additional_bindings {
59        post: "/v1alpha/{parent=projects/*/locations/*/collections/*}/dataStores"
60        body: "data_store"
61      }
62    };
63    option (google.api.method_signature) = "parent,data_store,data_store_id";
64    option (google.longrunning.operation_info) = {
65      response_type: "google.cloud.discoveryengine.v1alpha.DataStore"
66      metadata_type: "google.cloud.discoveryengine.v1alpha.CreateDataStoreMetadata"
67    };
68  }
69
70  // Gets a [DataStore][google.cloud.discoveryengine.v1alpha.DataStore].
71  rpc GetDataStore(GetDataStoreRequest) returns (DataStore) {
72    option (google.api.http) = {
73      get: "/v1alpha/{name=projects/*/locations/*/dataStores/*}"
74      additional_bindings {
75        get: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*}"
76      }
77    };
78    option (google.api.method_signature) = "name";
79  }
80
81  // Lists all the [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]s
82  // associated with the project.
83  rpc ListDataStores(ListDataStoresRequest) returns (ListDataStoresResponse) {
84    option (google.api.http) = {
85      get: "/v1alpha/{parent=projects/*/locations/*}/dataStores"
86      additional_bindings {
87        get: "/v1alpha/{parent=projects/*/locations/*/collections/*}/dataStores"
88      }
89    };
90    option (google.api.method_signature) = "parent";
91  }
92
93  // Deletes a [DataStore][google.cloud.discoveryengine.v1alpha.DataStore].
94  rpc DeleteDataStore(DeleteDataStoreRequest)
95      returns (google.longrunning.Operation) {
96    option (google.api.http) = {
97      delete: "/v1alpha/{name=projects/*/locations/*/dataStores/*}"
98      additional_bindings {
99        delete: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*}"
100      }
101    };
102    option (google.api.method_signature) = "name";
103    option (google.longrunning.operation_info) = {
104      response_type: "google.protobuf.Empty"
105      metadata_type: "google.cloud.discoveryengine.v1alpha.DeleteDataStoreMetadata"
106    };
107  }
108
109  // Updates a [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]
110  rpc UpdateDataStore(UpdateDataStoreRequest) returns (DataStore) {
111    option (google.api.http) = {
112      patch: "/v1alpha/{data_store.name=projects/*/locations/*/dataStores/*}"
113      body: "data_store"
114      additional_bindings {
115        patch: "/v1alpha/{data_store.name=projects/*/locations/*/collections/*/dataStores/*}"
116        body: "data_store"
117      }
118    };
119    option (google.api.method_signature) = "data_store,update_mask";
120  }
121
122  // Gets a
123  // [DocumentProcessingConfig][google.cloud.discoveryengine.v1alpha.DocumentProcessingConfig].
124  rpc GetDocumentProcessingConfig(GetDocumentProcessingConfigRequest)
125      returns (DocumentProcessingConfig) {
126    option (google.api.http) = {
127      get: "/v1alpha/{name=projects/*/locations/*/dataStores/*/documentProcessingConfig}"
128      additional_bindings {
129        get: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/documentProcessingConfig}"
130      }
131    };
132    option (google.api.method_signature) = "name";
133  }
134
135  // Updates the
136  // [DocumentProcessingConfig][google.cloud.discoveryengine.v1alpha.DocumentProcessingConfig].
137  // [DocumentProcessingConfig][google.cloud.discoveryengine.v1alpha.DocumentProcessingConfig]
138  // is a singleon resource of
139  // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]. It's empty
140  // when [DataStore][google.cloud.discoveryengine.v1alpha.DataStore] is
141  // created. The first call to this method will set up
142  // [DocumentProcessingConfig][google.cloud.discoveryengine.v1alpha.DocumentProcessingConfig].
143  rpc UpdateDocumentProcessingConfig(UpdateDocumentProcessingConfigRequest)
144      returns (DocumentProcessingConfig) {
145    option (google.api.http) = {
146      patch: "/v1alpha/{document_processing_config.name=projects/*/locations/*/dataStores/*/documentProcessingConfig}"
147      body: "document_processing_config"
148      additional_bindings {
149        patch: "/v1alpha/{document_processing_config.name=projects/*/locations/*/collections/*/dataStores/*/documentProcessingConfig}"
150        body: "document_processing_config"
151      }
152    };
153    option (google.api.method_signature) =
154        "document_processing_config,update_mask";
155  }
156}
157
158// Request for
159// [DataStoreService.CreateDataStore][google.cloud.discoveryengine.v1alpha.DataStoreService.CreateDataStore]
160// method.
161message CreateDataStoreRequest {
162  // Required. The parent resource name, such as
163  // `projects/{project}/locations/{location}/collections/{collection}`.
164  string parent = 1 [
165    (google.api.field_behavior) = REQUIRED,
166    (google.api.resource_reference) = {
167      type: "discoveryengine.googleapis.com/Collection"
168    }
169  ];
170
171  // Required. The [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]
172  // to create.
173  DataStore data_store = 2 [(google.api.field_behavior) = REQUIRED];
174
175  // Required. The ID to use for the
176  // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore], which will
177  // become the final component of the
178  // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]'s resource
179  // name.
180  //
181  // This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
182  // standard with a length limit of 63 characters. Otherwise, an
183  // INVALID_ARGUMENT error is returned.
184  string data_store_id = 3 [(google.api.field_behavior) = REQUIRED];
185
186  // A boolean flag indicating whether user want to directly create an advanced
187  // data store for site search.
188  // If the data store is not configured as site
189  // search (GENERIC vertical and PUBLIC_WEBSITE content_config), this flag will
190  // be ignored.
191  bool create_advanced_site_search = 4;
192}
193
194// Request message for
195// [DataStoreService.GetDataStore][google.cloud.discoveryengine.v1alpha.DataStoreService.GetDataStore]
196// method.
197message GetDataStoreRequest {
198  // Required. Full resource name of
199  // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore], such as
200  // `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
201  //
202  // If the caller does not have permission to access the
203  // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore], regardless of
204  // whether or not it exists, a PERMISSION_DENIED error is returned.
205  //
206  // If the requested
207  // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore] does not exist,
208  // a NOT_FOUND error is returned.
209  string name = 1 [
210    (google.api.field_behavior) = REQUIRED,
211    (google.api.resource_reference) = {
212      type: "discoveryengine.googleapis.com/DataStore"
213    }
214  ];
215}
216
217// Metadata related to the progress of the
218// [DataStoreService.CreateDataStore][google.cloud.discoveryengine.v1alpha.DataStoreService.CreateDataStore]
219// operation. This will be returned by the google.longrunning.Operation.metadata
220// field.
221message CreateDataStoreMetadata {
222  // Operation create time.
223  google.protobuf.Timestamp create_time = 1;
224
225  // Operation last update time. If the operation is done, this is also the
226  // finish time.
227  google.protobuf.Timestamp update_time = 2;
228}
229
230// Request message for
231// [DataStoreService.ListDataStores][google.cloud.discoveryengine.v1alpha.DataStoreService.ListDataStores]
232// method.
233message ListDataStoresRequest {
234  // Required. The parent branch resource name, such as
235  // `projects/{project}/locations/{location}/collections/{collection_id}`.
236  //
237  // If the caller does not have permission to list
238  // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]s under this
239  // location, regardless of whether or not this data store exists, a
240  // PERMISSION_DENIED error is returned.
241  string parent = 1 [
242    (google.api.field_behavior) = REQUIRED,
243    (google.api.resource_reference) = {
244      type: "discoveryengine.googleapis.com/Collection"
245    }
246  ];
247
248  // Maximum number of
249  // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]s to return. If
250  // unspecified, defaults to 10. The maximum allowed value is 50. Values above
251  // 50 will be coerced to 50.
252  //
253  // If this field is negative, an INVALID_ARGUMENT is returned.
254  int32 page_size = 2;
255
256  // A page token
257  // [ListDataStoresResponse.next_page_token][google.cloud.discoveryengine.v1alpha.ListDataStoresResponse.next_page_token],
258  // received from a previous
259  // [DataStoreService.ListDataStores][google.cloud.discoveryengine.v1alpha.DataStoreService.ListDataStores]
260  // call. Provide this to retrieve the subsequent page.
261  //
262  // When paginating, all other parameters provided to
263  // [DataStoreService.ListDataStores][google.cloud.discoveryengine.v1alpha.DataStoreService.ListDataStores]
264  // must match the call that provided the page token. Otherwise, an
265  // INVALID_ARGUMENT error is returned.
266  string page_token = 3;
267
268  // Filter by solution type. For example: filter =
269  // 'solution_type:SOLUTION_TYPE_SEARCH'
270  string filter = 4;
271}
272
273// Response message for
274// [DataStoreService.ListDataStores][google.cloud.discoveryengine.v1alpha.DataStoreService.ListDataStores]
275// method.
276message ListDataStoresResponse {
277  // All the customer's
278  // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]s.
279  repeated DataStore data_stores = 1;
280
281  // A token that can be sent as
282  // [ListDataStoresRequest.page_token][google.cloud.discoveryengine.v1alpha.ListDataStoresRequest.page_token]
283  // to retrieve the next page. If this field is omitted, there are no
284  // subsequent pages.
285  string next_page_token = 2;
286}
287
288// Request message for
289// [DataStoreService.DeleteDataStore][google.cloud.discoveryengine.v1alpha.DataStoreService.DeleteDataStore]
290// method.
291message DeleteDataStoreRequest {
292  // Required. Full resource name of
293  // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore], such as
294  // `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
295  //
296  // If the caller does not have permission to delete the
297  // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore], regardless of
298  // whether or not it exists, a PERMISSION_DENIED error is returned.
299  //
300  // If the [DataStore][google.cloud.discoveryengine.v1alpha.DataStore] to
301  // delete does not exist, a NOT_FOUND error is returned.
302  string name = 1 [
303    (google.api.field_behavior) = REQUIRED,
304    (google.api.resource_reference) = {
305      type: "discoveryengine.googleapis.com/DataStore"
306    }
307  ];
308}
309
310// Request message for
311// [DataStoreService.UpdateDataStore][google.cloud.discoveryengine.v1alpha.DataStoreService.UpdateDataStore]
312// method.
313message UpdateDataStoreRequest {
314  // Required. The [DataStore][google.cloud.discoveryengine.v1alpha.DataStore]
315  // to update.
316  //
317  // If the caller does not have permission to update the
318  // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore], regardless of
319  // whether or not it exists, a PERMISSION_DENIED error is returned.
320  //
321  // If the [DataStore][google.cloud.discoveryengine.v1alpha.DataStore] to
322  // update does not exist, a NOT_FOUND error is returned.
323  DataStore data_store = 1 [(google.api.field_behavior) = REQUIRED];
324
325  // Indicates which fields in the provided
326  // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore] to update.
327  //
328  // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
329  // is returned.
330  google.protobuf.FieldMask update_mask = 2;
331}
332
333// Metadata related to the progress of the
334// [DataStoreService.DeleteDataStore][google.cloud.discoveryengine.v1alpha.DataStoreService.DeleteDataStore]
335// operation. This will be returned by the google.longrunning.Operation.metadata
336// field.
337message DeleteDataStoreMetadata {
338  // Operation create time.
339  google.protobuf.Timestamp create_time = 1;
340
341  // Operation last update time. If the operation is done, this is also the
342  // finish time.
343  google.protobuf.Timestamp update_time = 2;
344}
345
346// Request for
347// [DataStoreService.GetDocumentProcessingConfig][google.cloud.discoveryengine.v1alpha.DataStoreService.GetDocumentProcessingConfig]
348// method.
349message GetDocumentProcessingConfigRequest {
350  // Required. Full DocumentProcessingConfig resource name. Format:
351  // `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/documentProcessingConfig`
352  string name = 1 [
353    (google.api.field_behavior) = REQUIRED,
354    (google.api.resource_reference) = {
355      type: "discoveryengine.googleapis.com/DocumentProcessingConfig"
356    }
357  ];
358}
359
360// Request for
361// [DataStoreService.UpdateDocumentProcessingConfig][google.cloud.discoveryengine.v1alpha.DataStoreService.UpdateDocumentProcessingConfig]
362// method.
363message UpdateDocumentProcessingConfigRequest {
364  // Required. The
365  // [DocumentProcessingConfig][google.cloud.discoveryengine.v1alpha.DocumentProcessingConfig]
366  // to update.
367  //
368  // If the caller does not have permission to update the
369  // [DocumentProcessingConfig][google.cloud.discoveryengine.v1alpha.DocumentProcessingConfig],
370  // then a PERMISSION_DENIED error is returned.
371  //
372  // If the
373  // [DocumentProcessingConfig][google.cloud.discoveryengine.v1alpha.DocumentProcessingConfig]
374  // to update does not exist, a NOT_FOUND error is returned.
375  DocumentProcessingConfig document_processing_config = 1
376      [(google.api.field_behavior) = REQUIRED];
377
378  // Indicates which fields in the provided
379  // [DocumentProcessingConfig][google.cloud.discoveryengine.v1alpha.DocumentProcessingConfig]
380  // to update. The following are the only supported fields:
381  //
382  // * [DocumentProcessingConfig.ocr_config][google.cloud.discoveryengine.v1alpha.DocumentProcessingConfig.ocr_config]
383  //
384  // If not set, all supported fields are updated.
385  google.protobuf.FieldMask update_mask = 2;
386}
387