/
environment.proto
390 lines (341 loc) · 15.3 KB
/
environment.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.dialogflow.v2;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/dialogflow/v2/audio_config.proto";
import "google/cloud/dialogflow/v2/fulfillment.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow";
option java_multiple_files = true;
option java_outer_classname = "EnvironmentProto";
option java_package = "com.google.cloud.dialogflow.v2";
option objc_class_prefix = "DF";
// Service for managing [Environments][google.cloud.dialogflow.v2.Environment].
service Environments {
option (google.api.default_host) = "dialogflow.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform,"
"https://www.googleapis.com/auth/dialogflow";
// Returns the list of all non-default environments of the specified agent.
rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*/agent}/environments"
additional_bindings {
get: "/v2/{parent=projects/*/locations/*/agent}/environments"
}
};
option (google.api.method_signature) = "parent";
}
// Retrieves the specified agent environment.
rpc GetEnvironment(GetEnvironmentRequest) returns (Environment) {
option (google.api.http) = {
get: "/v2/{name=projects/*/agent/environments/*}"
additional_bindings {
get: "/v2/{name=projects/*/locations/*/agent/environments/*}"
}
};
}
// Creates an agent environment.
rpc CreateEnvironment(CreateEnvironmentRequest) returns (Environment) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/agent}/environments"
body: "environment"
additional_bindings {
post: "/v2/{parent=projects/*/locations/*/agent}/environments"
body: "environment"
}
};
}
// Updates the specified agent environment.
//
// This method allows you to deploy new agent versions into the environment.
// When an environment is pointed to a new agent version by setting
// `environment.agent_version`, the environment is temporarily set to the
// `LOADING` state. During that time, the environment continues serving the
// previous version of the agent. After the new agent version is done loading,
// the environment is set back to the `RUNNING` state.
// You can use "-" as Environment ID in environment name to update an agent
// version in the default environment. WARNING: this will negate all recent
// changes to the draft agent and can't be undone. You may want to save the
// draft agent to a version before calling this method.
rpc UpdateEnvironment(UpdateEnvironmentRequest) returns (Environment) {
option (google.api.http) = {
patch: "/v2/{environment.name=projects/*/agent/environments/*}"
body: "environment"
additional_bindings {
patch: "/v2/{environment.name=projects/*/locations/*/agent/environments/*}"
body: "environment"
}
};
}
// Deletes the specified agent environment.
rpc DeleteEnvironment(DeleteEnvironmentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2/{name=projects/*/agent/environments/*}"
additional_bindings {
delete: "/v2/{name=projects/*/locations/*/agent/environments/*}"
}
};
}
// Gets the history of the specified environment.
rpc GetEnvironmentHistory(GetEnvironmentHistoryRequest) returns (EnvironmentHistory) {
option (google.api.http) = {
get: "/v2/{parent=projects/*/agent/environments/*}/history"
additional_bindings {
get: "/v2/{parent=projects/*/locations/*/agent/environments/*}/history"
}
};
}
}
// You can create multiple versions of your agent and publish them to separate
// environments.
//
// When you edit an agent, you are editing the draft agent. At any point, you
// can save the draft agent as an agent version, which is an immutable snapshot
// of your agent.
//
// When you save the draft agent, it is published to the default environment.
// When you create agent versions, you can publish them to custom environments.
// You can create a variety of custom environments for:
//
// - testing
// - development
// - production
// - etc.
//
// For more information, see the [versions and environments
// guide](https://cloud.google.com/dialogflow/docs/agents-versions).
message Environment {
option (google.api.resource) = {
type: "dialogflow.googleapis.com/Environment"
pattern: "projects/{project}/agent/environments/{environment}"
pattern: "projects/{project}/locations/{location}/agent/environments/{environment}"
};
// Represents an environment state. When an environment is pointed to a new
// agent version, the environment is temporarily set to the `LOADING` state.
// During that time, the environment keeps on serving the previous version of
// the agent. After the new agent version is done loading, the environment is
// set back to the `RUNNING` state.
enum State {
// Not specified. This value is not used.
STATE_UNSPECIFIED = 0;
// Stopped.
STOPPED = 1;
// Loading.
LOADING = 2;
// Running.
RUNNING = 3;
}
// Output only. The unique identifier of this agent environment.
// Supported formats:
//
// - `projects/<Project ID>/agent/environments/<Environment ID>`
// - `projects/<Project ID>/locations/<Location
// ID>/agent/environments/<Environment ID>`
//
// The environment ID for the default environment is `-`.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. The developer-provided description for this environment.
// The maximum length is 500 characters. If exceeded, the request is rejected.
string description = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. The agent version loaded into this environment.
// Supported formats:
//
// - `projects/<Project ID>/agent/versions/<Version ID>`
// - `projects/<Project ID>/locations/<Location ID>/agent/versions/<Version
// ID>`
string agent_version = 3 [
(google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Version"
}
];
// Output only. The state of this environment. This field is read-only, i.e., it cannot be
// set by create and update methods.
State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The last update time of this environment. This field is read-only, i.e., it
// cannot be set by create and update methods.
google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. Text to speech settings for this environment.
TextToSpeechSettings text_to_speech_settings = 7 [(google.api.field_behavior) = OPTIONAL];
// Optional. The fulfillment settings to use for this environment.
Fulfillment fulfillment = 8 [(google.api.field_behavior) = OPTIONAL];
}
// Instructs the speech synthesizer on how to generate the output audio content.
message TextToSpeechSettings {
// Optional. Indicates whether text to speech is enabled. Even when this field is false,
// other settings in this proto are still retained.
bool enable_text_to_speech = 1 [(google.api.field_behavior) = OPTIONAL];
// Required. Audio encoding of the synthesized audio content.
OutputAudioEncoding output_audio_encoding = 2 [(google.api.field_behavior) = REQUIRED];
// Optional. The synthesis sample rate (in hertz) for this audio. If not provided, then
// the synthesizer will use the default sample rate based on the audio
// encoding. If this is different from the voice's natural sample rate, then
// the synthesizer will honor this request by converting to the desired sample
// rate (which might result in worse audio quality).
int32 sample_rate_hertz = 3 [(google.api.field_behavior) = OPTIONAL];
// Optional. Configuration of how speech should be synthesized, mapping from language
// (https://cloud.google.com/dialogflow/docs/reference/language) to
// SynthesizeSpeechConfig.
map<string, SynthesizeSpeechConfig> synthesize_speech_configs = 4 [(google.api.field_behavior) = OPTIONAL];
}
// The request message for [Environments.ListEnvironments][google.cloud.dialogflow.v2.Environments.ListEnvironments].
message ListEnvironmentsRequest {
// Required. The agent to list all environments from.
// Format:
//
// - `projects/<Project ID>/agent`
// - `projects/<Project ID>/locations/<Location ID>/agent`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "dialogflow.googleapis.com/Environment"
}
];
// Optional. The maximum number of items to return in a single page. By default 100 and
// at most 1000.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. The next_page_token value returned from a previous list request.
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
}
// The response message for [Environments.ListEnvironments][google.cloud.dialogflow.v2.Environments.ListEnvironments].
message ListEnvironmentsResponse {
// The list of agent environments. There will be a maximum number of items
// returned based on the page_size field in the request.
repeated Environment environments = 1;
// Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 2;
}
// The request message for [Environments.GetEnvironment][google.cloud.dialogflow.v2.Environments.GetEnvironment].
message GetEnvironmentRequest {
// Required. The name of the environment.
// Supported formats:
//
// - `projects/<Project ID>/agent/environments/<Environment ID>`
// - `projects/<Project ID>/locations/<Location
// ID>/agent/environments/<Environment ID>`
//
// The environment ID for the default environment is `-`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Environment"
}
];
}
// The request message for [Environments.CreateEnvironment][google.cloud.dialogflow.v2.Environments.CreateEnvironment].
message CreateEnvironmentRequest {
// Required. The agent to create an environment for.
// Supported formats:
//
// - `projects/<Project ID>/agent`
// - `projects/<Project ID>/locations/<Location ID>/agent`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "dialogflow.googleapis.com/Environment"
}
];
// Required. The environment to create.
Environment environment = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The unique id of the new environment.
string environment_id = 3 [(google.api.field_behavior) = REQUIRED];
}
// The request message for [Environments.UpdateEnvironment][google.cloud.dialogflow.v2.Environments.UpdateEnvironment].
message UpdateEnvironmentRequest {
// Required. The environment to update.
Environment environment = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The mask to control which fields get updated.
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
// Optional. This field is used to prevent accidental overwrite of the default
// environment, which is an operation that cannot be undone. To confirm that
// the caller desires this overwrite, this field must be explicitly set to
// true when updating the default environment (environment ID = `-`).
bool allow_load_to_draft_and_discard_changes = 3 [(google.api.field_behavior) = OPTIONAL];
}
// The request message for [Environments.DeleteEnvironment][google.cloud.dialogflow.v2.Environments.DeleteEnvironment].
message DeleteEnvironmentRequest {
// Required. The name of the environment to delete.
// / Format:
//
// - `projects/<Project ID>/agent/environments/<Environment ID>`
// - `projects/<Project ID>/locations/<Location
// ID>/agent/environments/<Environment ID>`
//
// The environment ID for the default environment is `-`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Environment"
}
];
}
// The request message for [Environments.GetEnvironmentHistory][google.cloud.dialogflow.v2.Environments.GetEnvironmentHistory].
message GetEnvironmentHistoryRequest {
// Required. The name of the environment to retrieve history for.
// Supported formats:
//
// - `projects/<Project ID>/agent/environments/<Environment ID>`
// - `projects/<Project ID>/locations/<Location
// ID>/agent/environments/<Environment ID>`
//
// The environment ID for the default environment is `-`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Environment"
}
];
// Optional. The maximum number of items to return in a single page. By default 100 and
// at most 1000.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. The next_page_token value returned from a previous list request.
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
}
// The response message for [Environments.GetEnvironmentHistory][google.cloud.dialogflow.v2.Environments.GetEnvironmentHistory].
message EnvironmentHistory {
// Represents an environment history entry.
message Entry {
// The agent version loaded into this environment history entry.
string agent_version = 1;
// The developer-provided description for this environment history entry.
string description = 2;
// The creation time of this environment history entry.
google.protobuf.Timestamp create_time = 3;
}
// Output only. The name of the environment this history is for.
// Supported formats:
//
// - `projects/<Project ID>/agent/environments/<Environment ID>`
// - `projects/<Project ID>/locations/<Location
// ID>/agent/environments/<Environment ID>`
//
// The environment ID for the default environment is `-`.
string parent = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The list of agent environments. There will be a maximum number of items
// returned based on the page_size field in the request.
repeated Entry entries = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Token to retrieve the next page of results, or empty if there are no
// more results in the list.
string next_page_token = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}