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