Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / google-proto-files / google / cloud / dialogflow / v2beta1 / context.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 import "google/protobuf/struct.proto";
23
24 option cc_enable_arenas = true;
25 option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1";
26 option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow";
27 option java_multiple_files = true;
28 option java_outer_classname = "ContextProto";
29 option java_package = "com.google.cloud.dialogflow.v2beta1";
30 option objc_class_prefix = "DF";
31
32 // A context represents additional information included with user input or with
33 // an intent returned by the Dialogflow API. Contexts are helpful for
34 // differentiating user input which may be vague or have a different meaning
35 // depending on additional details from your application such as user setting
36 // and preferences, previous user input, where the user is in your application,
37 // geographic location, and so on.
38 //
39 // You can include contexts as input parameters of a
40 // [DetectIntent][google.cloud.dialogflow.v2beta1.Sessions.DetectIntent] (or
41 // [StreamingDetectIntent][google.cloud.dialogflow.v2beta1.Sessions.StreamingDetectIntent])
42 // request, or as output contexts included in the returned intent. Contexts
43 // expire when an intent is matched, after the number of `DetectIntent` requests
44 // specified by the `lifespan_count` parameter, or after 10 minutes if no
45 // intents are matched for a `DetectIntent` request.
46 //
47 // For more information about contexts, see the
48 // [Dialogflow documentation](https://dialogflow.com/docs/contexts).
49 service Contexts {
50   // Returns the list of all contexts in the specified session.
51   rpc ListContexts(ListContextsRequest) returns (ListContextsResponse) {
52     option (google.api.http) = {
53       get: "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts"
54       additional_bindings {
55         get: "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts"
56       }
57     };
58   }
59
60   // Retrieves the specified context.
61   rpc GetContext(GetContextRequest) returns (Context) {
62     option (google.api.http) = {
63       get: "/v2beta1/{name=projects/*/agent/sessions/*/contexts/*}"
64       additional_bindings {
65         get: "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}"
66       }
67     };
68   }
69
70   // Creates a context.
71   rpc CreateContext(CreateContextRequest) returns (Context) {
72     option (google.api.http) = {
73       post: "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts"
74       body: "context"
75       additional_bindings {
76         post: "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts"
77         body: "context"
78       }
79     };
80   }
81
82   // Updates the specified context.
83   rpc UpdateContext(UpdateContextRequest) returns (Context) {
84     option (google.api.http) = {
85       patch: "/v2beta1/{context.name=projects/*/agent/sessions/*/contexts/*}"
86       body: "context"
87       additional_bindings {
88         patch: "/v2beta1/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}"
89         body: "context"
90       }
91     };
92   }
93
94   // Deletes the specified context.
95   rpc DeleteContext(DeleteContextRequest) returns (google.protobuf.Empty) {
96     option (google.api.http) = {
97       delete: "/v2beta1/{name=projects/*/agent/sessions/*/contexts/*}"
98       additional_bindings {
99         delete: "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}"
100       }
101     };
102   }
103
104   // Deletes all active contexts in the specified session.
105   rpc DeleteAllContexts(DeleteAllContextsRequest)
106       returns (google.protobuf.Empty) {
107     option (google.api.http) = {
108       delete: "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts"
109       additional_bindings {
110         delete: "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts"
111       }
112     };
113   }
114 }
115
116 // Represents a context.
117 message Context {
118   // Required. The unique identifier of the context. Format:
119   // `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`,
120   // or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
121   // ID>/sessions/<Session ID>/contexts/<Context ID>`. The `Context ID` is
122   // always converted to lowercase. If `Environment ID` is not specified, we
123   // assume default 'draft' environment. If `User ID` is not specified, we
124   // assume default '-' user.
125   string name = 1;
126
127   // Optional. The number of conversational query requests after which the
128   // context expires. If set to `0` (the default) the context expires
129   // immediately. Contexts expire automatically after 10 minutes even if there
130   // are no matching queries.
131   int32 lifespan_count = 2;
132
133   // Optional. The collection of parameters associated with this context.
134   // Refer to [this doc](https://dialogflow.com/docs/actions-and-parameters) for
135   // syntax.
136   google.protobuf.Struct parameters = 3;
137 }
138
139 // The request message for
140 // [Contexts.ListContexts][google.cloud.dialogflow.v2beta1.Contexts.ListContexts].
141 message ListContextsRequest {
142   // Required. The session to list all contexts from.
143   // Format: `projects/<Project ID>/agent/sessions/<Session ID>` or
144   // `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
145   // ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume
146   // default 'draft' environment. If `User ID` is not specified, we assume
147   // default '-' user.
148   string parent = 1;
149
150   // Optional. The maximum number of items to return in a single page. By
151   // default 100 and at most 1000.
152   int32 page_size = 2;
153
154   // Optional. The next_page_token value returned from a previous list request.
155   string page_token = 3;
156 }
157
158 // The response message for
159 // [Contexts.ListContexts][google.cloud.dialogflow.v2beta1.Contexts.ListContexts].
160 message ListContextsResponse {
161   // The list of contexts. There will be a maximum number of items
162   // returned based on the page_size field in the request.
163   repeated Context contexts = 1;
164
165   // Token to retrieve the next page of results, or empty if there are no
166   // more results in the list.
167   string next_page_token = 2;
168 }
169
170 // The request message for
171 // [Contexts.GetContext][google.cloud.dialogflow.v2beta1.Contexts.GetContext].
172 message GetContextRequest {
173   // Required. The name of the context. Format:
174   // `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`
175   // or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
176   // ID>/sessions/<Session ID>/contexts/<Context ID>`. If `Environment ID` is
177   // not specified, we assume default 'draft' environment. If `User ID` is not
178   // specified, we assume default '-' user.
179   string name = 1;
180 }
181
182 // The request message for
183 // [Contexts.CreateContext][google.cloud.dialogflow.v2beta1.Contexts.CreateContext].
184 message CreateContextRequest {
185   // Required. The session to create a context for.
186   // Format: `projects/<Project ID>/agent/sessions/<Session ID>` or
187   // `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
188   // ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume
189   // default 'draft' environment. If `User ID` is not specified, we assume
190   // default '-' user.
191   string parent = 1;
192
193   // Required. The context to create.
194   Context context = 2;
195 }
196
197 // The request message for
198 // [Contexts.UpdateContext][google.cloud.dialogflow.v2beta1.Contexts.UpdateContext].
199 message UpdateContextRequest {
200   // Required. The context to update.
201   Context context = 1;
202
203   // Optional. The mask to control which fields get updated.
204   google.protobuf.FieldMask update_mask = 2;
205 }
206
207 // The request message for
208 // [Contexts.DeleteContext][google.cloud.dialogflow.v2beta1.Contexts.DeleteContext].
209 message DeleteContextRequest {
210   // Required. The name of the context to delete. Format:
211   // `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`
212   // or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
213   // ID>/sessions/<Session ID>/contexts/<Context ID>`. If `Environment ID` is
214   // not specified, we assume default 'draft' environment. If `User ID` is not
215   // specified, we assume default '-' user.
216   string name = 1;
217 }
218
219 // The request message for
220 // [Contexts.DeleteAllContexts][google.cloud.dialogflow.v2beta1.Contexts.DeleteAllContexts].
221 message DeleteAllContextsRequest {
222   // Required. The name of the session to delete all contexts from. Format:
223   // `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project
224   // ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session
225   // ID>`. If `Environment ID` is not specified we assume default 'draft'
226   // environment. If `User ID` is not specified, we assume default '-' user.
227   string parent = 1;
228 }