environment.proto 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. // Copyright 2021 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/longrunning/operations.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.Cx.V3";
  27. option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3;cx";
  28. option java_multiple_files = true;
  29. option java_outer_classname = "EnvironmentProto";
  30. option java_package = "com.google.cloud.dialogflow.cx.v3";
  31. option objc_class_prefix = "DF";
  32. // Service for managing [Environments][google.cloud.dialogflow.cx.v3.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 environments in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
  39. rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) {
  40. option (google.api.http) = {
  41. get: "/v3/{parent=projects/*/locations/*/agents/*}/environments"
  42. };
  43. option (google.api.method_signature) = "parent";
  44. }
  45. // Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
  46. rpc GetEnvironment(GetEnvironmentRequest) returns (Environment) {
  47. option (google.api.http) = {
  48. get: "/v3/{name=projects/*/locations/*/agents/*/environments/*}"
  49. };
  50. option (google.api.method_signature) = "name";
  51. }
  52. // Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
  53. rpc CreateEnvironment(CreateEnvironmentRequest) returns (google.longrunning.Operation) {
  54. option (google.api.http) = {
  55. post: "/v3/{parent=projects/*/locations/*/agents/*}/environments"
  56. body: "environment"
  57. };
  58. option (google.api.method_signature) = "parent,environment";
  59. option (google.longrunning.operation_info) = {
  60. response_type: "Environment"
  61. metadata_type: "google.protobuf.Struct"
  62. };
  63. }
  64. // Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
  65. rpc UpdateEnvironment(UpdateEnvironmentRequest) returns (google.longrunning.Operation) {
  66. option (google.api.http) = {
  67. patch: "/v3/{environment.name=projects/*/locations/*/agents/*/environments/*}"
  68. body: "environment"
  69. };
  70. option (google.api.method_signature) = "environment,update_mask";
  71. option (google.longrunning.operation_info) = {
  72. response_type: "Environment"
  73. metadata_type: "google.protobuf.Struct"
  74. };
  75. }
  76. // Deletes the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
  77. rpc DeleteEnvironment(DeleteEnvironmentRequest) returns (google.protobuf.Empty) {
  78. option (google.api.http) = {
  79. delete: "/v3/{name=projects/*/locations/*/agents/*/environments/*}"
  80. };
  81. option (google.api.method_signature) = "name";
  82. }
  83. // Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
  84. rpc LookupEnvironmentHistory(LookupEnvironmentHistoryRequest) returns (LookupEnvironmentHistoryResponse) {
  85. option (google.api.http) = {
  86. get: "/v3/{name=projects/*/locations/*/agents/*/environments/*}:lookupEnvironmentHistory"
  87. };
  88. option (google.api.method_signature) = "name";
  89. }
  90. // Kicks off a continuous test under the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
  91. rpc RunContinuousTest(RunContinuousTestRequest) returns (google.longrunning.Operation) {
  92. option (google.api.http) = {
  93. post: "/v3/{environment=projects/*/locations/*/agents/*/environments/*}:runContinuousTest"
  94. body: "*"
  95. };
  96. option (google.longrunning.operation_info) = {
  97. response_type: "RunContinuousTestResponse"
  98. metadata_type: "RunContinuousTestMetadata"
  99. };
  100. }
  101. // Fetches a list of continuous test results for a given environment.
  102. rpc ListContinuousTestResults(ListContinuousTestResultsRequest) returns (ListContinuousTestResultsResponse) {
  103. option (google.api.http) = {
  104. get: "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/continuousTestResults"
  105. };
  106. option (google.api.method_signature) = "parent";
  107. }
  108. }
  109. // Represents an environment for an agent. You can create multiple versions
  110. // of your agent and publish them to separate environments. When you edit an
  111. // agent, you are editing the draft agent. At any point, you can save the draft
  112. // agent as an agent version, which is an immutable snapshot of your agent. When
  113. // you save the draft agent, it is published to the default environment. When
  114. // you create agent versions, you can publish them to custom environments. You
  115. // can create a variety of custom environments for testing, development,
  116. // production, etc.
  117. message Environment {
  118. option (google.api.resource) = {
  119. type: "dialogflow.googleapis.com/Environment"
  120. pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}"
  121. };
  122. // Configuration for the version.
  123. message VersionConfig {
  124. // Required. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
  125. // ID>/flows/<Flow ID>/versions/<Version ID>.
  126. string version = 1 [
  127. (google.api.field_behavior) = REQUIRED,
  128. (google.api.resource_reference) = {
  129. type: "dialogflow.googleapis.com/Version"
  130. }
  131. ];
  132. }
  133. // The name of the environment.
  134. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  135. // ID>/environments/<Environment ID>`.
  136. string name = 1;
  137. // Required. The human-readable name of the environment (unique in an agent). Limit of
  138. // 64 characters.
  139. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  140. // The human-readable description of the environment. The maximum length is
  141. // 500 characters. If exceeded, the request is rejected.
  142. string description = 3;
  143. // Required. A list of configurations for flow versions. You should include version
  144. // configs for all flows that are reachable from [`Start
  145. // Flow`][Agent.start_flow] in the agent. Otherwise, an error will be
  146. // returned.
  147. repeated VersionConfig version_configs = 6 [(google.api.field_behavior) = REQUIRED];
  148. // Output only. Update time of this environment.
  149. google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  150. }
  151. // The request message for [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3.Environments.ListEnvironments].
  152. message ListEnvironmentsRequest {
  153. // Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to list all environments for.
  154. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
  155. string parent = 1 [
  156. (google.api.field_behavior) = REQUIRED,
  157. (google.api.resource_reference) = {
  158. child_type: "dialogflow.googleapis.com/Environment"
  159. }
  160. ];
  161. // The maximum number of items to return in a single page. By default 20 and
  162. // at most 100.
  163. int32 page_size = 2;
  164. // The next_page_token value returned from a previous list request.
  165. string page_token = 3;
  166. }
  167. // The response message for [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3.Environments.ListEnvironments].
  168. message ListEnvironmentsResponse {
  169. // The list of environments. There will be a maximum number of items
  170. // returned based on the page_size field in the request. The list may in some
  171. // cases be empty or contain fewer entries than page_size even if this isn't
  172. // the last page.
  173. repeated Environment environments = 1;
  174. // Token to retrieve the next page of results, or empty if there are no more
  175. // results in the list.
  176. string next_page_token = 2;
  177. }
  178. // The request message for [Environments.GetEnvironment][google.cloud.dialogflow.cx.v3.Environments.GetEnvironment].
  179. message GetEnvironmentRequest {
  180. // Required. The name of the [Environment][google.cloud.dialogflow.cx.v3.Environment].
  181. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  182. // ID>/environments/<Environment ID>`.
  183. string name = 1 [
  184. (google.api.field_behavior) = REQUIRED,
  185. (google.api.resource_reference) = {
  186. type: "dialogflow.googleapis.com/Environment"
  187. }
  188. ];
  189. }
  190. // The request message for [Environments.CreateEnvironment][google.cloud.dialogflow.cx.v3.Environments.CreateEnvironment].
  191. message CreateEnvironmentRequest {
  192. // Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to create an [Environment][google.cloud.dialogflow.cx.v3.Environment] for.
  193. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
  194. string parent = 1 [
  195. (google.api.field_behavior) = REQUIRED,
  196. (google.api.resource_reference) = {
  197. child_type: "dialogflow.googleapis.com/Environment"
  198. }
  199. ];
  200. // Required. The environment to create.
  201. Environment environment = 2 [(google.api.field_behavior) = REQUIRED];
  202. }
  203. // The request message for [Environments.UpdateEnvironment][google.cloud.dialogflow.cx.v3.Environments.UpdateEnvironment].
  204. message UpdateEnvironmentRequest {
  205. // Required. The environment to update.
  206. Environment environment = 1 [(google.api.field_behavior) = REQUIRED];
  207. // Required. The mask to control which fields get updated.
  208. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  209. }
  210. // The request message for [Environments.DeleteEnvironment][google.cloud.dialogflow.cx.v3.Environments.DeleteEnvironment].
  211. message DeleteEnvironmentRequest {
  212. // Required. The name of the [Environment][google.cloud.dialogflow.cx.v3.Environment] to delete.
  213. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  214. // ID>/environments/<Environment ID>`.
  215. string name = 1 [
  216. (google.api.field_behavior) = REQUIRED,
  217. (google.api.resource_reference) = {
  218. type: "dialogflow.googleapis.com/Environment"
  219. }
  220. ];
  221. }
  222. // The request message for [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3.Environments.LookupEnvironmentHistory].
  223. message LookupEnvironmentHistoryRequest {
  224. // Required. Resource name of the environment to look up the history for.
  225. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  226. // ID>/environments/<Environment ID>`.
  227. string name = 1 [
  228. (google.api.field_behavior) = REQUIRED,
  229. (google.api.resource_reference) = {
  230. type: "dialogflow.googleapis.com/Environment"
  231. }
  232. ];
  233. // The maximum number of items to return in a single page. By default 100 and
  234. // at most 1000.
  235. int32 page_size = 2;
  236. // The next_page_token value returned from a previous list request.
  237. string page_token = 3;
  238. }
  239. // The response message for [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3.Environments.LookupEnvironmentHistory].
  240. message LookupEnvironmentHistoryResponse {
  241. // Represents a list of snapshots for an environment. Time of the snapshots is
  242. // stored in [`update_time`][google.cloud.dialogflow.cx.v3.Environment.update_time].
  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. // Represents a result from running a test case in an agent environment.
  249. message ContinuousTestResult {
  250. option (google.api.resource) = {
  251. type: "dialogflow.googleapis.com/ContinuousTestResult"
  252. pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}"
  253. };
  254. // The overall result for a continuous test run in an agent environment.
  255. enum AggregatedTestResult {
  256. // Not specified. Should never be used.
  257. AGGREGATED_TEST_RESULT_UNSPECIFIED = 0;
  258. // All the tests passed.
  259. PASSED = 1;
  260. // At least one test did not pass.
  261. FAILED = 2;
  262. }
  263. // The resource name for the continuous test result. Format:
  264. // `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  265. // ID>/environments/<Environment
  266. // ID>/continuousTestResults/<ContinuousTestResult ID>`.
  267. string name = 1;
  268. // The result of this continuous test run, i.e. whether all the tests in this
  269. // continuous test run pass or not.
  270. AggregatedTestResult result = 2;
  271. // A list of individual test case results names in this continuous test run.
  272. repeated string test_case_results = 3 [(google.api.resource_reference) = {
  273. type: "dialogflow.googleapis.com/TestCaseResult"
  274. }];
  275. // Time when the continuous testing run starts.
  276. google.protobuf.Timestamp run_time = 4;
  277. }
  278. // The request message for [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest].
  279. message RunContinuousTestRequest {
  280. // Required. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
  281. // ID>/environments/<Environment ID>`.
  282. string environment = 1 [
  283. (google.api.field_behavior) = REQUIRED,
  284. (google.api.resource_reference) = {
  285. type: "dialogflow.googleapis.com/Environment"
  286. }
  287. ];
  288. }
  289. // The response message for [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest].
  290. message RunContinuousTestResponse {
  291. // The result for a continuous test run.
  292. ContinuousTestResult continuous_test_result = 1;
  293. }
  294. // Metadata returned for the [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest] long running
  295. // operation.
  296. message RunContinuousTestMetadata {
  297. // The test errors.
  298. repeated TestError errors = 1;
  299. }
  300. // The request message for [Environments.ListContinuousTestResults][google.cloud.dialogflow.cx.v3.Environments.ListContinuousTestResults].
  301. message ListContinuousTestResultsRequest {
  302. // Required. The environment to list results for.
  303. // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/
  304. // environments/<Environment ID>`.
  305. string parent = 1 [
  306. (google.api.field_behavior) = REQUIRED,
  307. (google.api.resource_reference) = {
  308. child_type: "dialogflow.googleapis.com/ContinuousTestResult"
  309. }
  310. ];
  311. // The maximum number of items to return in a single page. By default 100 and
  312. // at most 1000.
  313. int32 page_size = 2;
  314. // The next_page_token value returned from a previous list request.
  315. string page_token = 3;
  316. }
  317. // The response message for [Environments.ListTestCaseResults][].
  318. message ListContinuousTestResultsResponse {
  319. // The list of continuous test results.
  320. repeated ContinuousTestResult continuous_test_results = 1;
  321. // Token to retrieve the next page of results, or empty if there are no more
  322. // results in the list.
  323. string next_page_token = 2;
  324. }