1 // Copyright 2018 Google LLC
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 package google.cloud.dialogflow.v2beta1;
19 import "google/api/annotations.proto";
20 import "google/cloud/dialogflow/v2beta1/entity_type.proto";
21 import "google/protobuf/empty.proto";
22 import "google/protobuf/field_mask.proto";
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 = "SessionEntityTypeProto";
29 option java_package = "com.google.cloud.dialogflow.v2beta1";
30 option objc_class_prefix = "DF";
32 // Entities are extracted from user input and represent parameters that are
33 // meaningful to your application. For example, a date range, a proper name
34 // such as a geographic location or landmark, and so on. Entities represent
35 // actionable data for your application.
37 // Session entity types are referred to as **User** entity types and are
38 // entities that are built for an individual user such as
39 // favorites, preferences, playlists, and so on. You can redefine a session
40 // entity type at the session level.
42 // For more information about entity types, see the
43 // [Dialogflow documentation](https://dialogflow.com/docs/entities).
44 service SessionEntityTypes {
45 // Returns the list of all session entity types in the specified session.
46 rpc ListSessionEntityTypes(ListSessionEntityTypesRequest)
47 returns (ListSessionEntityTypesResponse) {
48 option (google.api.http) = {
49 get: "/v2beta1/{parent=projects/*/agent/sessions/*}/entityTypes"
51 get: "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes"
56 // Retrieves the specified session entity type.
57 rpc GetSessionEntityType(GetSessionEntityTypeRequest)
58 returns (SessionEntityType) {
59 option (google.api.http) = {
60 get: "/v2beta1/{name=projects/*/agent/sessions/*/entityTypes/*}"
62 get: "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}"
67 // Creates a session entity type.
68 rpc CreateSessionEntityType(CreateSessionEntityTypeRequest)
69 returns (SessionEntityType) {
70 option (google.api.http) = {
71 post: "/v2beta1/{parent=projects/*/agent/sessions/*}/entityTypes"
72 body: "session_entity_type"
74 post: "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes"
75 body: "session_entity_type"
80 // Updates the specified session entity type.
81 rpc UpdateSessionEntityType(UpdateSessionEntityTypeRequest)
82 returns (SessionEntityType) {
83 option (google.api.http) = {
84 patch: "/v2beta1/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}"
85 body: "session_entity_type"
87 patch: "/v2beta1/{session_entity_type.name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}"
88 body: "session_entity_type"
93 // Deletes the specified session entity type.
94 rpc DeleteSessionEntityType(DeleteSessionEntityTypeRequest)
95 returns (google.protobuf.Empty) {
96 option (google.api.http) = {
97 delete: "/v2beta1/{name=projects/*/agent/sessions/*/entityTypes/*}"
99 delete: "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}"
105 // Represents a session entity type.
107 // Extends or replaces a developer entity type at the user session level (we
108 // refer to the entity types defined at the agent level as "developer entity
111 // Note: session entity types apply to all queries, regardless of the language.
112 message SessionEntityType {
113 // The types of modifications for a session entity type.
114 enum EntityOverrideMode {
115 // Not specified. This value should be never used.
116 ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0;
118 // The collection of session entities overrides the collection of entities
119 // in the corresponding developer entity type.
120 ENTITY_OVERRIDE_MODE_OVERRIDE = 1;
122 // The collection of session entities extends the collection of entities in
123 // the corresponding developer entity type.
124 // Calls to `ListSessionEntityTypes`, `GetSessionEntityType`,
125 // `CreateSessionEntityType` and `UpdateSessionEntityType` return the full
126 // collection of entities from the developer entity type in the agent's
127 // default language and the session entity type.
128 ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2;
131 // Required. The unique identifier of this session entity type. Format:
132 // `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
133 // Display Name>`, or
134 // `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
135 // ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`.
136 // If `Environment ID` is not specified, we assume default 'draft'
137 // environment. If `User ID` is not specified, we assume default '-' user.
140 // Required. Indicates whether the additional data should override or
141 // supplement the developer entity type definition.
142 EntityOverrideMode entity_override_mode = 2;
144 // Required. The collection of entities associated with this session entity
146 repeated EntityType.Entity entities = 3;
149 // The request message for
150 // [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.v2beta1.SessionEntityTypes.ListSessionEntityTypes].
151 message ListSessionEntityTypesRequest {
152 // Required. The session to list all session entity types from.
153 // Format: `projects/<Project ID>/agent/sessions/<Session ID>` or
154 // `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/
155 // sessions/<Session ID>`.
156 // If `Environment ID` is not specified, we assume default 'draft'
157 // environment. If `User ID` is not specified, we assume default '-' user.
160 // Optional. The maximum number of items to return in a single page. By
161 // default 100 and at most 1000.
164 // Optional. The next_page_token value returned from a previous list request.
165 string page_token = 3;
168 // The response message for
169 // [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.v2beta1.SessionEntityTypes.ListSessionEntityTypes].
170 message ListSessionEntityTypesResponse {
171 // The list of session entity types. There will be a maximum number of items
172 // returned based on the page_size field in the request.
173 repeated SessionEntityType session_entity_types = 1;
175 // Token to retrieve the next page of results, or empty if there are no
176 // more results in the list.
177 string next_page_token = 2;
180 // The request message for
181 // [SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.v2beta1.SessionEntityTypes.GetSessionEntityType].
182 message GetSessionEntityTypeRequest {
183 // Required. The name of the session entity type. Format:
184 // `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
185 // Display Name>` or `projects/<Project ID>/agent/environments/<Environment
186 // ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display
187 // Name>`. If `Environment ID` is not specified, we assume default 'draft'
188 // environment. If `User ID` is not specified, we assume default '-' user.
192 // The request message for
193 // [SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.v2beta1.SessionEntityTypes.CreateSessionEntityType].
194 message CreateSessionEntityTypeRequest {
195 // Required. The session to create a session entity type for.
196 // Format: `projects/<Project ID>/agent/sessions/<Session ID>` or
197 // `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/
198 // sessions/<Session ID>`. If `Environment ID` is not specified, we assume
199 // default 'draft' environment. If `User ID` is not specified, we assume
203 // Required. The session entity type to create.
204 SessionEntityType session_entity_type = 2;
207 // The request message for
208 // [SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.v2beta1.SessionEntityTypes.UpdateSessionEntityType].
209 message UpdateSessionEntityTypeRequest {
210 // Required. The entity type to update. Format:
211 // `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
212 // Display Name>` or `projects/<Project ID>/agent/environments/<Environment
213 // ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display
214 // Name>`. If `Environment ID` is not specified, we assume default 'draft'
215 // environment. If `User ID` is not specified, we assume default '-' user.
216 SessionEntityType session_entity_type = 1;
218 // Optional. The mask to control which fields get updated.
219 google.protobuf.FieldMask update_mask = 2;
222 // The request message for
223 // [SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.v2beta1.SessionEntityTypes.DeleteSessionEntityType].
224 message DeleteSessionEntityTypeRequest {
225 // Required. The name of the entity type to delete. Format:
226 // `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type
227 // Display Name>` or `projects/<Project ID>/agent/environments/<Environment
228 // ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display
229 // Name>`. If `Environment ID` is not specified, we assume default 'draft'
230 // environment. If `User ID` is not specified, we assume default '-' user.