environment.proto 15 KB

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