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