Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / dialogflow / protos / google / cloud / dialogflow / v2beta1 / knowledge_base.proto
1 // Copyright 2018 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
15 syntax = "proto3";
16
17 package google.cloud.dialogflow.v2beta1;
18
19 import "google/api/annotations.proto";
20 import "google/protobuf/empty.proto";
21 import "google/protobuf/field_mask.proto";
22
23 option cc_enable_arenas = true;
24 option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1";
25 option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow";
26 option java_multiple_files = true;
27 option java_outer_classname = "KnowledgeBaseProto";
28 option java_package = "com.google.cloud.dialogflow.v2beta1";
29 option objc_class_prefix = "DF";
30
31 // Manages knowledge bases.
32 //
33 // Allows users to setup and maintain knowledge bases with their knowledge data.
34 service KnowledgeBases {
35   // Returns the list of all knowledge bases of the specified agent.
36   rpc ListKnowledgeBases(ListKnowledgeBasesRequest)
37       returns (ListKnowledgeBasesResponse) {
38     option (google.api.http) = {
39       get: "/v2beta1/{parent=projects/*}/knowledgeBases"
40       additional_bindings {
41         get: "/v2beta1/{parent=projects/*/agent}/knowledgeBases"
42       }
43     };
44   }
45
46   // Retrieves the specified knowledge base.
47   rpc GetKnowledgeBase(GetKnowledgeBaseRequest) returns (KnowledgeBase) {
48     option (google.api.http) = {
49       get: "/v2beta1/{name=projects/*/knowledgeBases/*}"
50       additional_bindings {
51         get: "/v2beta1/{name=projects/*/agent/knowledgeBases/*}"
52       }
53     };
54   }
55
56   // Creates a knowledge base.
57   rpc CreateKnowledgeBase(CreateKnowledgeBaseRequest) returns (KnowledgeBase) {
58     option (google.api.http) = {
59       post: "/v2beta1/{parent=projects/*}/knowledgeBases"
60       body: "knowledge_base"
61       additional_bindings {
62         post: "/v2beta1/{parent=projects/*/agent}/knowledgeBases"
63         body: "knowledge_base"
64       }
65     };
66   }
67
68   // Deletes the specified knowledge base.
69   rpc DeleteKnowledgeBase(DeleteKnowledgeBaseRequest)
70       returns (google.protobuf.Empty) {
71     option (google.api.http) = {
72       delete: "/v2beta1/{name=projects/*/knowledgeBases/*}"
73       additional_bindings {
74         delete: "/v2beta1/{name=projects/*/agent/knowledgeBases/*}"
75       }
76     };
77   }
78 }
79
80 // Represents knowledge base resource.
81 message KnowledgeBase {
82   // The knowledge base resource name.
83   // The name must be empty when creating a knowledge base.
84   // Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
85   string name = 1;
86
87   // Required. The display name of the knowledge base. The name must be 1024
88   // bytes or less; otherwise, the creation request fails.
89   string display_name = 2;
90 }
91
92 // Request message for
93 // [KnowledgeBases.ListKnowledgeBases][google.cloud.dialogflow.v2beta1.KnowledgeBases.ListKnowledgeBases].
94 message ListKnowledgeBasesRequest {
95   // Required. The agent to list of knowledge bases for.
96   // Format: `projects/<Project ID>/agent`.
97   string parent = 1;
98
99   // Optional. The maximum number of items to return in a single page. By
100   // default 10 and at most 100.
101   int32 page_size = 2;
102
103   // Optional. The next_page_token value returned from a previous list request.
104   string page_token = 3;
105 }
106
107 // Response message for
108 // [KnowledgeBases.ListKnowledgeBases][google.cloud.dialogflow.v2beta1.KnowledgeBases.ListKnowledgeBases].
109 message ListKnowledgeBasesResponse {
110   // The list of knowledge bases.
111   repeated KnowledgeBase knowledge_bases = 1;
112
113   // Token to retrieve the next page of results, or empty if there are no
114   // more results in the list.
115   string next_page_token = 2;
116 }
117
118 // Request message for [KnowledgeBase.GetDocument][].
119 message GetKnowledgeBaseRequest {
120   // Required. The name of the knowledge base to retrieve.
121   // Format `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
122   string name = 1;
123 }
124
125 // Request message for
126 // [KnowledgeBases.CreateKnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBases.CreateKnowledgeBase].
127 message CreateKnowledgeBaseRequest {
128   // Required. The agent to create a knowledge base for.
129   // Format: `projects/<Project ID>/agent`.
130   string parent = 1;
131
132   // Required. The knowledge base to create.
133   KnowledgeBase knowledge_base = 2;
134 }
135
136 // Request message for
137 // [KnowledgeBases.DeleteKnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBases.DeleteKnowledgeBase].
138 message DeleteKnowledgeBaseRequest {
139   // Required. The name of the knowledge base to delete.
140   // Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`.
141   string name = 1;
142
143   // Optional. Force deletes the knowledge base. When set to true, any documents
144   // in the knowledge base are also deleted.
145   bool force = 2;
146 }