environment.proto 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  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.cx.v3;
  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/cx/v3/test_case.proto";
  21. import "google/cloud/dialogflow/cx/v3/webhook.proto";
  22. import "google/longrunning/operations.proto";
  23. import "google/protobuf/empty.proto";
  24. import "google/protobuf/field_mask.proto";
  25. import "google/protobuf/timestamp.proto";
  26. option cc_enable_arenas = true;
  27. option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3";
  28. option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3;cx";
  29. option java_multiple_files = true;
  30. option java_outer_classname = "EnvironmentProto";
  31. option java_package = "com.google.cloud.dialogflow.cx.v3";
  32. option objc_class_prefix = "DF";
  33. option ruby_package = "Google::Cloud::Dialogflow::CX::V3";
  34. // Service for managing [Environments][google.cloud.dialogflow.cx.v3.Environment].
  35. service Environments {
  36. option (google.api.default_host) = "dialogflow.googleapis.com";
  37. option (google.api.oauth_scopes) =
  38. "https://www.googleapis.com/auth/cloud-platform,"
  39. "https://www.googleapis.com/auth/dialogflow";
  40. // Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
  41. rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) {
  42. option (google.api.http) = {
  43. get: "/v3/{parent=projects/*/locations/*/agents/*}/environments"
  44. };
  45. option (google.api.method_signature) = "parent";
  46. }
  47. // Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
  48. rpc GetEnvironment(GetEnvironmentRequest) returns (Environment) {
  49. option (google.api.http) = {
  50. get: "/v3/{name=projects/*/locations/*/agents/*/environments/*}"
  51. };
  52. option (google.api.method_signature) = "name";
  53. }
  54. // Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
  55. //
  56. // This method is a [long-running
  57. // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
  58. // The returned `Operation` type has the following method-specific fields:
  59. //
  60. // - `metadata`: An empty [Struct
  61. // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
  62. // - `response`: [Environment][google.cloud.dialogflow.cx.v3.Environment]
  63. rpc CreateEnvironment(CreateEnvironmentRequest) returns (google.longrunning.Operation) {
  64. option (google.api.http) = {
  65. post: "/v3/{parent=projects/*/locations/*/agents/*}/environments"
  66. body: "environment"
  67. };
  68. option (google.api.method_signature) = "parent,environment";
  69. option (google.longrunning.operation_info) = {
  70. response_type: "Environment"
  71. metadata_type: "google.protobuf.Struct"
  72. };
  73. }
  74. // Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
  75. //
  76. // This method is a [long-running
  77. // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
  78. // The returned `Operation` type has the following method-specific fields:
  79. //
  80. // - `metadata`: An empty [Struct
  81. // message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
  82. // - `response`: [Environment][google.cloud.dialogflow.cx.v3.Environment]
  83. rpc UpdateEnvironment(UpdateEnvironmentRequest) returns (google.longrunning.Operation) {
  84. option (google.api.http) = {
  85. patch: "/v3/{environment.name=projects/*/locations/*/agents/*/environments/*}"
  86. body: "environment"
  87. };
  88. option (google.api.method_signature) = "environment,update_mask";
  89. option (google.longrunning.operation_info) = {
  90. response_type: "Environment"
  91. metadata_type: "google.protobuf.Struct"
  92. };
  93. }
  94. // Deletes the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
  95. rpc DeleteEnvironment(DeleteEnvironmentRequest) returns (google.protobuf.Empty) {
  96. option (google.api.http) = {
  97. delete: "/v3/{name=projects/*/locations/*/agents/*/environments/*}"
  98. };
  99. option (google.api.method_signature) = "name";
  100. }
  101. // Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
  102. rpc LookupEnvironmentHistory(LookupEnvironmentHistoryRequest) returns (LookupEnvironmentHistoryResponse) {
  103. option (google.api.http) = {
  104. get: "/v3/{name=projects/*/locations/*/agents/*/environments/*}:lookupEnvironmentHistory"
  105. };
  106. option (google.api.method_signature) = "name";
  107. }
  108. // Kicks off a continuous test under the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
  109. //
  110. // This method is a [long-running
  111. // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
  112. // The returned `Operation` type has the following method-specific fields:
  113. //
  114. // - `metadata`: [RunContinuousTestMetadata][google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata]
  115. // - `response`: [RunContinuousTestResponse][google.cloud.dialogflow.cx.v3.RunContinuousTestResponse]
  116. rpc RunContinuousTest(RunContinuousTestRequest) returns (google.longrunning.Operation) {
  117. option (google.api.http) = {
  118. post: "/v3/{environment=projects/*/locations/*/agents/*/environments/*}:runContinuousTest"
  119. body: "*"
  120. };
  121. option (google.longrunning.operation_info) = {
  122. response_type: "RunContinuousTestResponse"
  123. metadata_type: "RunContinuousTestMetadata"
  124. };
  125. }
  126. // Fetches a list of continuous test results for a given environment.
  127. rpc ListContinuousTestResults(ListContinuousTestResultsRequest) returns (ListContinuousTestResultsResponse) {
  128. option (google.api.http) = {
  129. get: "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/continuousTestResults"
  130. };
  131. option (google.api.method_signature) = "parent";
  132. }
  133. // Deploys a flow to the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
  134. //
  135. // This method is a [long-running
  136. // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
  137. // The returned `Operation` type has the following method-specific fields:
  138. //
  139. // - `metadata`: [DeployFlowMetadata][google.cloud.dialogflow.cx.v3.DeployFlowMetadata]
  140. // - `response`: [DeployFlowResponse][google.cloud.dialogflow.cx.v3.DeployFlowResponse]
  141. rpc DeployFlow(DeployFlowRequest) returns (google.longrunning.Operation) {
  142. option (google.api.http) = {
  143. post: "/v3/{environment=projects/*/locations/*/agents/*/environments/*}:deployFlow"
  144. body: "*"
  145. };
  146. option (google.longrunning.operation_info) = {
  147. response_type: "DeployFlowResponse"
  148. metadata_type: "DeployFlowMetadata"
  149. };
  150. }
  151. }
  152. // Represents an environment for an agent. You can create multiple versions
  153. // of your agent and publish them to separate environments. When you edit an
  154. // agent, you are editing the draft agent. At any point, you can save the draft
  155. // agent as an agent version, which is an immutable snapshot of your agent. When
  156. // you save the draft agent, it is published to the default environment. When
  157. // you create agent versions, you can publish them to custom environments. You
  158. // can create a variety of custom environments for testing, development,
  159. // production, etc.
  160. message Environment {
  161. option (google.api.resource) = {
  162. type: "dialogflow.googleapis.com/Environment"
  163. pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}"
  164. };
  165. // Configuration for the version.
  166. message VersionConfig {
  167. // Required. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
  168. // ID>/flows/<Flow ID>/versions/<Version ID>.
  169. string version = 1 [
  170. (google.api.field_behavior) = REQUIRED,
  171. (google.api.resource_reference) = {
  172. type: "dialogflow.googleapis.com/Version"
  173. }
  174. ];
  175. }
  176. // The configuration for continuous tests.
  177. message TestCasesConfig {
  178. // A list of test case names to run. They should be under the same agent.
  179. // Format of each test case name: `projects/<Project ID>/locations/
  180. // <Location ID>/agents/<AgentID>/testCases/<TestCase ID>`
  181. repeated string test_cases = 1 [(google.api.resource_reference) = {
  182. type: "dialogflow.googleapis.com/TestCase"
  183. }];
  184. // Whether to run test cases in [TestCasesConfig.test_cases][google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig.test_cases] periodically.
  185. // Default false. If set to true, run once a day.
  186. bool enable_continuous_run = 2;
  187. // Whether to run test cases in [TestCasesConfig.test_cases][google.cloud.dialogflow.cx.v3.Environment.TestCasesConfig.test_cases] before
  188. // deploying a flow version to the environment. Default false.
  189. bool enable_predeployment_run = 3;
  190. }
  191. // Configuration for webhooks.
  192. message WebhookConfig {
  193. // The list of webhooks to override for the agent environment. The webhook
  194. // must exist in the agent. You can override fields in
  195. // [`generic_web_service`][google.cloud.dialogflow.cx.v3.Webhook.generic_web_service] and
  196. // [`service_directory`][google.cloud.dialogflow.cx.v3.Webhook.service_directory].
  197. repeated Webhook webhook_overrides = 1;
  198. }
  199. // The name of the environment.
  200. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  201. // ID>/environments/<Environment ID>`.
  202. string name = 1;
  203. // Required. The human-readable name of the environment (unique in an agent). Limit of
  204. // 64 characters.
  205. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  206. // The human-readable description of the environment. The maximum length is
  207. // 500 characters. If exceeded, the request is rejected.
  208. string description = 3;
  209. // Required. A list of configurations for flow versions. You should include version
  210. // configs for all flows that are reachable from [`Start
  211. // Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
  212. // returned.
  213. repeated VersionConfig version_configs = 6 [(google.api.field_behavior) = REQUIRED];
  214. // Output only. Update time of this environment.
  215. google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  216. // The test cases config for continuous tests of this environment.
  217. TestCasesConfig test_cases_config = 7;
  218. // The webhook configuration for this environment.
  219. WebhookConfig webhook_config = 10;
  220. }
  221. // The request message for [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3.Environments.ListEnvironments].
  222. message ListEnvironmentsRequest {
  223. // Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to list all environments for.
  224. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
  225. string parent = 1 [
  226. (google.api.field_behavior) = REQUIRED,
  227. (google.api.resource_reference) = {
  228. child_type: "dialogflow.googleapis.com/Environment"
  229. }
  230. ];
  231. // The maximum number of items to return in a single page. By default 20 and
  232. // at most 100.
  233. int32 page_size = 2;
  234. // The next_page_token value returned from a previous list request.
  235. string page_token = 3;
  236. }
  237. // The response message for [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3.Environments.ListEnvironments].
  238. message ListEnvironmentsResponse {
  239. // The list of environments. There will be a maximum number of items
  240. // returned based on the page_size field in the request. The list may in some
  241. // cases be empty or contain fewer entries than page_size even if this isn't
  242. // the last page.
  243. repeated Environment environments = 1;
  244. // Token to retrieve the next page of results, or empty if there are no more
  245. // results in the list.
  246. string next_page_token = 2;
  247. }
  248. // The request message for [Environments.GetEnvironment][google.cloud.dialogflow.cx.v3.Environments.GetEnvironment].
  249. message GetEnvironmentRequest {
  250. // Required. The name of the [Environment][google.cloud.dialogflow.cx.v3.Environment].
  251. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  252. // ID>/environments/<Environment ID>`.
  253. string name = 1 [
  254. (google.api.field_behavior) = REQUIRED,
  255. (google.api.resource_reference) = {
  256. type: "dialogflow.googleapis.com/Environment"
  257. }
  258. ];
  259. }
  260. // The request message for [Environments.CreateEnvironment][google.cloud.dialogflow.cx.v3.Environments.CreateEnvironment].
  261. message CreateEnvironmentRequest {
  262. // Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3.Environment] for.
  263. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
  264. string parent = 1 [
  265. (google.api.field_behavior) = REQUIRED,
  266. (google.api.resource_reference) = {
  267. child_type: "dialogflow.googleapis.com/Environment"
  268. }
  269. ];
  270. // Required. The environment to create.
  271. Environment environment = 2 [(google.api.field_behavior) = REQUIRED];
  272. }
  273. // The request message for [Environments.UpdateEnvironment][google.cloud.dialogflow.cx.v3.Environments.UpdateEnvironment].
  274. message UpdateEnvironmentRequest {
  275. // Required. The environment to update.
  276. Environment environment = 1 [(google.api.field_behavior) = REQUIRED];
  277. // Required. The mask to control which fields get updated.
  278. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  279. }
  280. // The request message for [Environments.DeleteEnvironment][google.cloud.dialogflow.cx.v3.Environments.DeleteEnvironment].
  281. message DeleteEnvironmentRequest {
  282. // Required. The name of the [Environment][google.cloud.dialogflow.cx.v3.Environment] to delete.
  283. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  284. // ID>/environments/<Environment ID>`.
  285. string name = 1 [
  286. (google.api.field_behavior) = REQUIRED,
  287. (google.api.resource_reference) = {
  288. type: "dialogflow.googleapis.com/Environment"
  289. }
  290. ];
  291. }
  292. // The request message for [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3.Environments.LookupEnvironmentHistory].
  293. message LookupEnvironmentHistoryRequest {
  294. // Required. Resource name of the environment to look up the history for.
  295. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  296. // ID>/environments/<Environment ID>`.
  297. string name = 1 [
  298. (google.api.field_behavior) = REQUIRED,
  299. (google.api.resource_reference) = {
  300. type: "dialogflow.googleapis.com/Environment"
  301. }
  302. ];
  303. // The maximum number of items to return in a single page. By default 100 and
  304. // at most 1000.
  305. int32 page_size = 2;
  306. // The next_page_token value returned from a previous list request.
  307. string page_token = 3;
  308. }
  309. // The response message for [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3.Environments.LookupEnvironmentHistory].
  310. message LookupEnvironmentHistoryResponse {
  311. // Represents a list of snapshots for an environment. Time of the snapshots is
  312. // stored in [`update_time`][google.cloud.dialogflow.cx.v3.Environment.update_time].
  313. repeated Environment environments = 1;
  314. // Token to retrieve the next page of results, or empty if there are no more
  315. // results in the list.
  316. string next_page_token = 2;
  317. }
  318. // Represents a result from running a test case in an agent environment.
  319. message ContinuousTestResult {
  320. option (google.api.resource) = {
  321. type: "dialogflow.googleapis.com/ContinuousTestResult"
  322. pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}"
  323. };
  324. // The overall result for a continuous test run in an agent environment.
  325. enum AggregatedTestResult {
  326. // Not specified. Should never be used.
  327. AGGREGATED_TEST_RESULT_UNSPECIFIED = 0;
  328. // All the tests passed.
  329. PASSED = 1;
  330. // At least one test did not pass.
  331. FAILED = 2;
  332. }
  333. // The resource name for the continuous test result. Format:
  334. // `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  335. // ID>/environments/<Environment
  336. // ID>/continuousTestResults/<ContinuousTestResult ID>`.
  337. string name = 1;
  338. // The result of this continuous test run, i.e. whether all the tests in this
  339. // continuous test run pass or not.
  340. AggregatedTestResult result = 2;
  341. // A list of individual test case results names in this continuous test run.
  342. repeated string test_case_results = 3 [(google.api.resource_reference) = {
  343. type: "dialogflow.googleapis.com/TestCaseResult"
  344. }];
  345. // Time when the continuous testing run starts.
  346. google.protobuf.Timestamp run_time = 4;
  347. }
  348. // The request message for [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest].
  349. message RunContinuousTestRequest {
  350. // Required. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  351. // ID>/environments/<Environment ID>`.
  352. string environment = 1 [
  353. (google.api.field_behavior) = REQUIRED,
  354. (google.api.resource_reference) = {
  355. type: "dialogflow.googleapis.com/Environment"
  356. }
  357. ];
  358. }
  359. // The response message for [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest].
  360. message RunContinuousTestResponse {
  361. // The result for a continuous test run.
  362. ContinuousTestResult continuous_test_result = 1;
  363. }
  364. // Metadata returned for the [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest] long running
  365. // operation.
  366. message RunContinuousTestMetadata {
  367. // The test errors.
  368. repeated TestError errors = 1;
  369. }
  370. // The request message for [Environments.ListContinuousTestResults][google.cloud.dialogflow.cx.v3.Environments.ListContinuousTestResults].
  371. message ListContinuousTestResultsRequest {
  372. // Required. The environment to list results for.
  373. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/
  374. // environments/<Environment ID>`.
  375. string parent = 1 [
  376. (google.api.field_behavior) = REQUIRED,
  377. (google.api.resource_reference) = {
  378. child_type: "dialogflow.googleapis.com/ContinuousTestResult"
  379. }
  380. ];
  381. // The maximum number of items to return in a single page. By default 100 and
  382. // at most 1000.
  383. int32 page_size = 2;
  384. // The next_page_token value returned from a previous list request.
  385. string page_token = 3;
  386. }
  387. // The response message for [Environments.ListTestCaseResults][].
  388. message ListContinuousTestResultsResponse {
  389. // The list of continuous test results.
  390. repeated ContinuousTestResult continuous_test_results = 1;
  391. // Token to retrieve the next page of results, or empty if there are no more
  392. // results in the list.
  393. string next_page_token = 2;
  394. }
  395. // The request message for [Environments.DeployFlow][google.cloud.dialogflow.cx.v3.Environments.DeployFlow].
  396. message DeployFlowRequest {
  397. // Required. The environment to deploy the flow to.
  398. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/
  399. // environments/<Environment ID>`.
  400. string environment = 1 [
  401. (google.api.field_behavior) = REQUIRED,
  402. (google.api.resource_reference) = {
  403. type: "dialogflow.googleapis.com/Environment"
  404. }
  405. ];
  406. // Required. The flow version to deploy.
  407. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/
  408. // flows/<Flow ID>/versions/<Version ID>`.
  409. string flow_version = 2 [
  410. (google.api.field_behavior) = REQUIRED,
  411. (google.api.resource_reference) = {
  412. type: "dialogflow.googleapis.com/Version"
  413. }
  414. ];
  415. }
  416. // The response message for [Environments.DeployFlow][google.cloud.dialogflow.cx.v3.Environments.DeployFlow].
  417. message DeployFlowResponse {
  418. // The updated environment where the flow is deployed.
  419. Environment environment = 1;
  420. // The name of the flow version [Deployment][google.cloud.dialogflow.cx.v3.Deployment].
  421. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/
  422. // environments/<Environment ID>/deployments/<Deployment ID>`.
  423. string deployment = 2;
  424. }
  425. // Metadata returned for the [Environments.DeployFlow][google.cloud.dialogflow.cx.v3.Environments.DeployFlow] long running
  426. // operation.
  427. message DeployFlowMetadata {
  428. // Errors of running deployment tests.
  429. repeated TestError test_errors = 1;
  430. }