xref: /aosp_15_r20/external/googleapis/google/cloud/discoveryengine/v1alpha/chunk_service.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
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/chunk.proto";
24
25option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha";
26option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb";
27option java_multiple_files = true;
28option java_outer_classname = "ChunkServiceProto";
29option java_package = "com.google.cloud.discoveryengine.v1alpha";
30option objc_class_prefix = "DISCOVERYENGINE";
31option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha";
32option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha";
33
34// Service for displaying processed
35// [Chunk][google.cloud.discoveryengine.v1alpha.Chunk] information of the
36// customer's unstructured data.
37service ChunkService {
38  option (google.api.default_host) = "discoveryengine.googleapis.com";
39  option (google.api.oauth_scopes) =
40      "https://www.googleapis.com/auth/cloud-platform";
41
42  // Gets a [Document][google.cloud.discoveryengine.v1alpha.Document].
43  rpc GetChunk(GetChunkRequest) returns (Chunk) {
44    option (google.api.http) = {
45      get: "/v1alpha/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*/chunks/*}"
46      additional_bindings {
47        get: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*/chunks/*}"
48      }
49    };
50    option (google.api.method_signature) = "name";
51  }
52
53  // Gets a list of [Chunk][google.cloud.discoveryengine.v1alpha.Chunk]s.
54  rpc ListChunks(ListChunksRequest) returns (ListChunksResponse) {
55    option (google.api.http) = {
56      get: "/v1alpha/{parent=projects/*/locations/*/dataStores/*/branches/*/documents/*}/chunks"
57      additional_bindings {
58        get: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}/chunks"
59      }
60    };
61    option (google.api.method_signature) = "parent";
62  }
63}
64
65// Request message for
66// [ChunkService.GetChunk][google.cloud.discoveryengine.v1alpha.ChunkService.GetChunk]
67// method.
68message GetChunkRequest {
69  // Required. Full resource name of
70  // [Chunk][google.cloud.discoveryengine.v1alpha.Chunk], such as
71  // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}`.
72  //
73  // If the caller does not have permission to access the
74  // [Chunk][google.cloud.discoveryengine.v1alpha.Chunk], regardless of whether
75  // or not it exists, a `PERMISSION_DENIED` error is returned.
76  //
77  // If the requested [Chunk][google.cloud.discoveryengine.v1alpha.Chunk] does
78  // not exist, a `NOT_FOUND` error is returned.
79  string name = 1 [
80    (google.api.field_behavior) = REQUIRED,
81    (google.api.resource_reference) = {
82      type: "discoveryengine.googleapis.com/Chunk"
83    }
84  ];
85}
86
87// Request message for
88// [ChunkService.ListChunks][google.cloud.discoveryengine.v1alpha.ChunkService.ListChunks]
89// method.
90message ListChunksRequest {
91  // Required. The parent document resource name, such as
92  // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
93  //
94  // If the caller does not have permission to list
95  // [Chunk][google.cloud.discoveryengine.v1alpha.Chunk]s under this document,
96  // regardless of whether or not this document exists, a `PERMISSION_DENIED`
97  // error is returned.
98  string parent = 1 [
99    (google.api.field_behavior) = REQUIRED,
100    (google.api.resource_reference) = {
101      type: "discoveryengine.googleapis.com/Document"
102    }
103  ];
104
105  // Maximum number of [Chunk][google.cloud.discoveryengine.v1alpha.Chunk]s to
106  // return. If unspecified, defaults to 100. The maximum allowed value is 1000.
107  // Values above 1000 will be coerced to 1000.
108  //
109  // If this field is negative, an `INVALID_ARGUMENT` error is returned.
110  int32 page_size = 2;
111
112  // A page token
113  // [ListChunksResponse.next_page_token][google.cloud.discoveryengine.v1alpha.ListChunksResponse.next_page_token],
114  // received from a previous
115  // [ChunkService.ListChunks][google.cloud.discoveryengine.v1alpha.ChunkService.ListChunks]
116  // call. Provide this to retrieve the subsequent page.
117  //
118  // When paginating, all other parameters provided to
119  // [ChunkService.ListChunks][google.cloud.discoveryengine.v1alpha.ChunkService.ListChunks]
120  // must match the call that provided the page token. Otherwise, an
121  // `INVALID_ARGUMENT` error is returned.
122  string page_token = 3;
123}
124
125// Response message for
126// [ChunkService.ListChunks][google.cloud.discoveryengine.v1alpha.ChunkService.ListChunks]
127// method.
128message ListChunksResponse {
129  // The [Chunk][google.cloud.discoveryengine.v1alpha.Chunk]s.
130  repeated Chunk chunks = 1;
131
132  // A token that can be sent as
133  // [ListChunksRequest.page_token][google.cloud.discoveryengine.v1alpha.ListChunksRequest.page_token]
134  // to retrieve the next page. If this field is omitted, there are no
135  // subsequent pages.
136  string next_page_token = 2;
137}
138