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.cx.v3; 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/cx/v3/flow.proto"; 24import "google/cloud/dialogflow/cx/v3/intent.proto"; 25import "google/cloud/dialogflow/cx/v3/page.proto"; 26import "google/cloud/dialogflow/cx/v3/response_message.proto"; 27import "google/cloud/dialogflow/cx/v3/session.proto"; 28import "google/cloud/dialogflow/cx/v3/transition_route_group.proto"; 29import "google/longrunning/operations.proto"; 30import "google/protobuf/empty.proto"; 31import "google/protobuf/field_mask.proto"; 32import "google/protobuf/struct.proto"; 33import "google/protobuf/timestamp.proto"; 34import "google/rpc/status.proto"; 35 36option cc_enable_arenas = true; 37option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; 38option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb"; 39option java_multiple_files = true; 40option java_outer_classname = "TestCaseProto"; 41option java_package = "com.google.cloud.dialogflow.cx.v3"; 42option objc_class_prefix = "DF"; 43option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; 44 45// Service for managing [Test Cases][google.cloud.dialogflow.cx.v3.TestCase] and 46// [Test Case Results][google.cloud.dialogflow.cx.v3.TestCaseResult]. 47service TestCases { 48 option (google.api.default_host) = "dialogflow.googleapis.com"; 49 option (google.api.oauth_scopes) = 50 "https://www.googleapis.com/auth/cloud-platform," 51 "https://www.googleapis.com/auth/dialogflow"; 52 53 // Fetches a list of test cases for a given agent. 54 rpc ListTestCases(ListTestCasesRequest) returns (ListTestCasesResponse) { 55 option (google.api.http) = { 56 get: "/v3/{parent=projects/*/locations/*/agents/*}/testCases" 57 }; 58 option (google.api.method_signature) = "parent"; 59 } 60 61 // Batch deletes test cases. 62 rpc BatchDeleteTestCases(BatchDeleteTestCasesRequest) 63 returns (google.protobuf.Empty) { 64 option (google.api.http) = { 65 post: "/v3/{parent=projects/*/locations/*/agents/*}/testCases:batchDelete" 66 body: "*" 67 }; 68 option (google.api.method_signature) = "parent"; 69 } 70 71 // Gets a test case. 72 rpc GetTestCase(GetTestCaseRequest) returns (TestCase) { 73 option (google.api.http) = { 74 get: "/v3/{name=projects/*/locations/*/agents/*/testCases/*}" 75 }; 76 option (google.api.method_signature) = "name"; 77 } 78 79 // Creates a test case for the given agent. 80 rpc CreateTestCase(CreateTestCaseRequest) returns (TestCase) { 81 option (google.api.http) = { 82 post: "/v3/{parent=projects/*/locations/*/agents/*}/testCases" 83 body: "test_case" 84 }; 85 option (google.api.method_signature) = "parent,test_case"; 86 } 87 88 // Updates the specified test case. 89 rpc UpdateTestCase(UpdateTestCaseRequest) returns (TestCase) { 90 option (google.api.http) = { 91 patch: "/v3/{test_case.name=projects/*/locations/*/agents/*/testCases/*}" 92 body: "test_case" 93 }; 94 option (google.api.method_signature) = "test_case,update_mask"; 95 } 96 97 // Kicks off a test case run. 98 // 99 // This method is a [long-running 100 // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 101 // The returned `Operation` type has the following method-specific fields: 102 // 103 // - `metadata`: 104 // [RunTestCaseMetadata][google.cloud.dialogflow.cx.v3.RunTestCaseMetadata] 105 // - `response`: 106 // [RunTestCaseResponse][google.cloud.dialogflow.cx.v3.RunTestCaseResponse] 107 rpc RunTestCase(RunTestCaseRequest) returns (google.longrunning.Operation) { 108 option (google.api.http) = { 109 post: "/v3/{name=projects/*/locations/*/agents/*/testCases/*}:run" 110 body: "*" 111 }; 112 option (google.longrunning.operation_info) = { 113 response_type: "RunTestCaseResponse" 114 metadata_type: "RunTestCaseMetadata" 115 }; 116 } 117 118 // Kicks off a batch run of test cases. 119 // 120 // This method is a [long-running 121 // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 122 // The returned `Operation` type has the following method-specific fields: 123 // 124 // - `metadata`: 125 // [BatchRunTestCasesMetadata][google.cloud.dialogflow.cx.v3.BatchRunTestCasesMetadata] 126 // - `response`: 127 // [BatchRunTestCasesResponse][google.cloud.dialogflow.cx.v3.BatchRunTestCasesResponse] 128 rpc BatchRunTestCases(BatchRunTestCasesRequest) 129 returns (google.longrunning.Operation) { 130 option (google.api.http) = { 131 post: "/v3/{parent=projects/*/locations/*/agents/*}/testCases:batchRun" 132 body: "*" 133 }; 134 option (google.longrunning.operation_info) = { 135 response_type: "BatchRunTestCasesResponse" 136 metadata_type: "BatchRunTestCasesMetadata" 137 }; 138 } 139 140 // Calculates the test coverage for an agent. 141 rpc CalculateCoverage(CalculateCoverageRequest) 142 returns (CalculateCoverageResponse) { 143 option (google.api.http) = { 144 get: "/v3/{agent=projects/*/locations/*/agents/*}/testCases:calculateCoverage" 145 }; 146 } 147 148 // Imports the test cases from a Cloud Storage bucket or a local file. It 149 // always creates new test cases and won't overwrite any existing ones. The 150 // provided ID in the imported test case is neglected. 151 // 152 // This method is a [long-running 153 // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 154 // The returned `Operation` type has the following method-specific fields: 155 // 156 // - `metadata`: 157 // [ImportTestCasesMetadata][google.cloud.dialogflow.cx.v3.ImportTestCasesMetadata] 158 // - `response`: 159 // [ImportTestCasesResponse][google.cloud.dialogflow.cx.v3.ImportTestCasesResponse] 160 rpc ImportTestCases(ImportTestCasesRequest) 161 returns (google.longrunning.Operation) { 162 option (google.api.http) = { 163 post: "/v3/{parent=projects/*/locations/*/agents/*}/testCases:import" 164 body: "*" 165 }; 166 option (google.longrunning.operation_info) = { 167 response_type: "ImportTestCasesResponse" 168 metadata_type: "ImportTestCasesMetadata" 169 }; 170 } 171 172 // Exports the test cases under the agent to a Cloud Storage bucket or a local 173 // file. Filter can be applied to export a subset of test cases. 174 // 175 // This method is a [long-running 176 // operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 177 // The returned `Operation` type has the following method-specific fields: 178 // 179 // - `metadata`: 180 // [ExportTestCasesMetadata][google.cloud.dialogflow.cx.v3.ExportTestCasesMetadata] 181 // - `response`: 182 // [ExportTestCasesResponse][google.cloud.dialogflow.cx.v3.ExportTestCasesResponse] 183 rpc ExportTestCases(ExportTestCasesRequest) 184 returns (google.longrunning.Operation) { 185 option (google.api.http) = { 186 post: "/v3/{parent=projects/*/locations/*/agents/*}/testCases:export" 187 body: "*" 188 }; 189 option (google.longrunning.operation_info) = { 190 response_type: "ExportTestCasesResponse" 191 metadata_type: "ExportTestCasesMetadata" 192 }; 193 } 194 195 // Fetches the list of run results for the given test case. A maximum of 100 196 // results are kept for each test case. 197 rpc ListTestCaseResults(ListTestCaseResultsRequest) 198 returns (ListTestCaseResultsResponse) { 199 option (google.api.http) = { 200 get: "/v3/{parent=projects/*/locations/*/agents/*/testCases/*}/results" 201 }; 202 option (google.api.method_signature) = "parent"; 203 } 204 205 // Gets a test case result. 206 rpc GetTestCaseResult(GetTestCaseResultRequest) returns (TestCaseResult) { 207 option (google.api.http) = { 208 get: "/v3/{name=projects/*/locations/*/agents/*/testCases/*/results/*}" 209 }; 210 option (google.api.method_signature) = "name"; 211 } 212} 213 214// Represents a test case. 215message TestCase { 216 option (google.api.resource) = { 217 type: "dialogflow.googleapis.com/TestCase" 218 pattern: "projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}" 219 }; 220 221 // The unique identifier of the test case. 222 // [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3.TestCases.CreateTestCase] 223 // will populate the name automatically. Otherwise use format: 224 // `projects/<Project ID>/locations/<LocationID>/agents/ 225 // <AgentID>/testCases/<TestCase ID>`. 226 string name = 1; 227 228 // Tags are short descriptions that users may apply to test cases for 229 // organizational and filtering purposes. Each tag should start with "#" and 230 // has a limit of 30 characters. 231 repeated string tags = 2; 232 233 // Required. The human-readable name of the test case, unique within the 234 // agent. Limit of 200 characters. 235 string display_name = 3 [(google.api.field_behavior) = REQUIRED]; 236 237 // Additional freeform notes about the test case. Limit of 400 characters. 238 string notes = 4; 239 240 // Config for the test case. 241 TestConfig test_config = 13; 242 243 // The conversation turns uttered when the test case was created, in 244 // chronological order. These include the canonical set of agent utterances 245 // that should occur when the agent is working properly. 246 repeated ConversationTurn test_case_conversation_turns = 5; 247 248 // Output only. When the test was created. 249 google.protobuf.Timestamp creation_time = 10 250 [(google.api.field_behavior) = OUTPUT_ONLY]; 251 252 // The latest test result. 253 TestCaseResult last_test_result = 12; 254} 255 256// Represents a result from running a test case in an agent environment. 257message TestCaseResult { 258 option (google.api.resource) = { 259 type: "dialogflow.googleapis.com/TestCaseResult" 260 pattern: "projects/{project}/locations/{location}/agents/{agent}/testCases/{test_case}/results/{result}" 261 }; 262 263 // The resource name for the test case result. Format: 264 // `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/testCases/ 265 // <TestCase ID>/results/<TestCaseResult ID>`. 266 string name = 1; 267 268 // Environment where the test was run. If not set, it indicates the draft 269 // environment. 270 string environment = 2 [(google.api.resource_reference) = { 271 type: "dialogflow.googleapis.com/Environment" 272 }]; 273 274 // The conversation turns uttered during the test case replay in chronological 275 // order. 276 repeated ConversationTurn conversation_turns = 3; 277 278 // Whether the test case passed in the agent environment. 279 TestResult test_result = 4; 280 281 // The time that the test was run. 282 google.protobuf.Timestamp test_time = 5; 283} 284 285// Represents configurations for a test case. 286message TestConfig { 287 // Session parameters to be compared when calculating differences. 288 repeated string tracking_parameters = 1; 289 290 // Flow name to start the test case with. 291 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent 292 // ID>/flows/<Flow ID>`. 293 // 294 // Only one of `flow` and `page` should be set to indicate the starting point 295 // of the test case. If both are set, `page` takes precedence over `flow`. If 296 // neither is set, the test case will start with start page on the default 297 // start flow. 298 string flow = 2 [ 299 (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } 300 ]; 301 302 // The [page][google.cloud.dialogflow.cx.v3.Page] to start the test case with. 303 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent 304 // ID>/flows/<Flow ID>/pages/<Page ID>`. 305 // 306 // Only one of `flow` and `page` should be set to indicate the starting point 307 // of the test case. If both are set, `page` takes precedence over `flow`. If 308 // neither is set, the test case will start with start page on the default 309 // start flow. 310 string page = 3 [ 311 (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Page" } 312 ]; 313} 314 315// One interaction between a human and virtual agent. The human provides some 316// input and the virtual agent provides a response. 317message ConversationTurn { 318 // The input from the human user. 319 message UserInput { 320 // Supports [text input][google.cloud.dialogflow.cx.v3.QueryInput.text], 321 // [event input][google.cloud.dialogflow.cx.v3.QueryInput.event], [dtmf 322 // input][google.cloud.dialogflow.cx.v3.QueryInput.dtmf] in the test case. 323 QueryInput input = 5; 324 325 // Parameters that need to be injected into the conversation during intent 326 // detection. 327 google.protobuf.Struct injected_parameters = 2; 328 329 // If webhooks should be allowed to trigger in response to the user 330 // utterance. Often if parameters are injected, webhooks should not be 331 // enabled. 332 bool is_webhook_enabled = 3; 333 334 // Whether sentiment analysis is enabled. 335 bool enable_sentiment_analysis = 7; 336 } 337 338 // The output from the virtual agent. 339 message VirtualAgentOutput { 340 // The session parameters available to the bot at this point. 341 google.protobuf.Struct session_parameters = 4; 342 343 // Output only. If this is part of a [result conversation 344 // turn][TestCaseResult.conversation_turns], the list of differences 345 // between the original run and the replay for this output, if any. 346 repeated TestRunDifference differences = 5 347 [(google.api.field_behavior) = OUTPUT_ONLY]; 348 349 // Required. Input only. The diagnostic 350 // [info][Session.DetectIntentResponse.QueryResult.diagnostic_info] 351 // output for the turn. Required to calculate the testing coverage. 352 google.protobuf.Struct diagnostic_info = 6 [ 353 (google.api.field_behavior) = REQUIRED, 354 (google.api.field_behavior) = INPUT_ONLY 355 ]; 356 357 // The [Intent][google.cloud.dialogflow.cx.v3.Intent] that triggered the 358 // response. Only name and displayName will be set. 359 Intent triggered_intent = 7; 360 361 // The [Page][google.cloud.dialogflow.cx.v3.Page] on which the utterance was 362 // spoken. Only name and displayName will be set. 363 Page current_page = 8; 364 365 // The [text][google.cloud.dialogflow.cx.v3.ResponseMessage.Text] responses 366 // from the agent for the turn. 367 repeated ResponseMessage.Text text_responses = 9; 368 369 // Response error from the agent in the test result. If set, other output 370 // is empty. 371 google.rpc.Status status = 10; 372 } 373 374 // The user input. 375 UserInput user_input = 1; 376 377 // The virtual agent output. 378 VirtualAgentOutput virtual_agent_output = 2; 379} 380 381// The description of differences between original and replayed agent output. 382message TestRunDifference { 383 // What part of the message replay differs from the test case. 384 enum DiffType { 385 // Should never be used. 386 DIFF_TYPE_UNSPECIFIED = 0; 387 388 // The intent. 389 INTENT = 1; 390 391 // The page. 392 PAGE = 2; 393 394 // The parameters. 395 PARAMETERS = 3; 396 397 // The message utterance. 398 UTTERANCE = 4; 399 400 // The flow. 401 FLOW = 5; 402 } 403 404 // The type of diff. 405 DiffType type = 1; 406 407 // A human readable description of the diff, showing the actual output vs 408 // expected output. 409 string description = 2; 410} 411 412// Transition coverage represents the percentage of all possible page 413// transitions (page-level transition routes and event handlers, excluding 414// transition route groups) present within any of a parent's test cases. 415message TransitionCoverage { 416 // The source or target of a transition. 417 message TransitionNode { 418 // A TransitionNode can be either a page or a flow. 419 oneof kind { 420 // Indicates a transition to a [Page][google.cloud.dialogflow.cx.v3.Page]. 421 // Only some fields such as name and displayname will be set. 422 Page page = 1; 423 424 // Indicates a transition to a [Flow][google.cloud.dialogflow.cx.v3.Flow]. 425 // Only some fields such as name and displayname will be set. 426 Flow flow = 2; 427 } 428 } 429 430 // A transition in a page. 431 message Transition { 432 // The start node of a transition. 433 TransitionNode source = 1; 434 435 // The index of a transition in the transition list. Starting from 0. 436 int32 index = 4; 437 438 // The end node of a transition. 439 TransitionNode target = 2; 440 441 // Whether the transition is covered by at least one of the 442 // agent's test cases. 443 bool covered = 3; 444 445 // The detailed transition. 446 oneof detail { 447 // Intent route or condition route. 448 TransitionRoute transition_route = 5; 449 450 // Event handler. 451 EventHandler event_handler = 6; 452 } 453 } 454 455 // The list of Transitions present in the agent. 456 repeated Transition transitions = 1; 457 458 // The percent of transitions in the agent that are covered. 459 float coverage_score = 2; 460} 461 462// Transition route group coverage represents the percentage of all possible 463// transition routes present within any of a parent's test cases. The results 464// are grouped by the transition route group. 465message TransitionRouteGroupCoverage { 466 // Coverage result message for one transition route group. 467 message Coverage { 468 // A transition coverage in a transition route group. 469 message Transition { 470 // Intent route or condition route. 471 TransitionRoute transition_route = 1; 472 473 // Whether the transition route is covered by at least one of the 474 // agent's test cases. 475 bool covered = 2; 476 } 477 478 // Transition route group metadata. Only name and displayName will be set. 479 TransitionRouteGroup route_group = 1; 480 481 // The list of transition routes and coverage in the transition route group. 482 repeated Transition transitions = 2; 483 484 // The percent of transition routes in the transition route group that are 485 // covered. 486 float coverage_score = 3; 487 } 488 489 // Transition route group coverages. 490 repeated Coverage coverages = 1; 491 492 // The percent of transition routes in all the transition route groups that 493 // are covered. 494 float coverage_score = 2; 495} 496 497// Intent coverage represents the percentage of all possible intents in the 498// agent that are triggered in any of a parent's test cases. 499message IntentCoverage { 500 // The agent's intent. 501 message Intent { 502 // The intent full resource name 503 string intent = 1 [(google.api.resource_reference) = { 504 type: "dialogflow.googleapis.com/Intent" 505 }]; 506 507 // Whether the intent is covered by at least one of the agent's 508 // test cases. 509 bool covered = 2; 510 } 511 512 // The list of Intents present in the agent 513 repeated Intent intents = 1; 514 515 // The percent of intents in the agent that are covered. 516 float coverage_score = 2; 517} 518 519// The request message for 520// [TestCases.CalculateCoverage][google.cloud.dialogflow.cx.v3.TestCases.CalculateCoverage]. 521message CalculateCoverageRequest { 522 // The type of coverage score requested. 523 enum CoverageType { 524 // Should never be used. 525 COVERAGE_TYPE_UNSPECIFIED = 0; 526 527 // Intent coverage. 528 INTENT = 1; 529 530 // Page transition coverage. 531 PAGE_TRANSITION = 2; 532 533 // Transition route group coverage. 534 TRANSITION_ROUTE_GROUP = 3; 535 } 536 537 // Required. The agent to calculate coverage for. 538 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. 539 string agent = 3 [ 540 (google.api.field_behavior) = REQUIRED, 541 (google.api.resource_reference) = { 542 type: "dialogflow.googleapis.com/Agent" 543 } 544 ]; 545 546 // Required. The type of coverage requested. 547 CoverageType type = 2 [(google.api.field_behavior) = REQUIRED]; 548} 549 550// The response message for 551// [TestCases.CalculateCoverage][google.cloud.dialogflow.cx.v3.TestCases.CalculateCoverage]. 552message CalculateCoverageResponse { 553 // The agent to calculate coverage for. 554 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. 555 string agent = 5 [(google.api.resource_reference) = { 556 type: "dialogflow.googleapis.com/Agent" 557 }]; 558 559 // The type of coverage requested. 560 oneof coverage_type { 561 // Intent coverage. 562 IntentCoverage intent_coverage = 2; 563 564 // Transition (excluding transition route groups) coverage. 565 TransitionCoverage transition_coverage = 4; 566 567 // Transition route group coverage. 568 TransitionRouteGroupCoverage route_group_coverage = 6; 569 } 570} 571 572// The request message for 573// [TestCases.ListTestCases][google.cloud.dialogflow.cx.v3.TestCases.ListTestCases]. 574message ListTestCasesRequest { 575 // Specifies how much test case information to include in the response. 576 enum TestCaseView { 577 // The default / unset value. 578 // The API will default to the BASIC view. 579 TEST_CASE_VIEW_UNSPECIFIED = 0; 580 581 // Include basic metadata about the test case, but not the conversation 582 // turns. This is the default value. 583 BASIC = 1; 584 585 // Include everything. 586 FULL = 2; 587 } 588 589 // Required. The agent to list all pages for. 590 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. 591 string parent = 1 [ 592 (google.api.field_behavior) = REQUIRED, 593 (google.api.resource_reference) = { 594 child_type: "dialogflow.googleapis.com/TestCase" 595 } 596 ]; 597 598 // The maximum number of items to return in a single page. By default 20. 599 // Note that when TestCaseView = FULL, the maximum page size allowed is 20. 600 // When TestCaseView = BASIC, the maximum page size allowed is 500. 601 int32 page_size = 2; 602 603 // The next_page_token value returned from a previous list request. 604 string page_token = 3; 605 606 // Specifies whether response should include all fields or just the metadata. 607 TestCaseView view = 4; 608} 609 610// The response message for 611// [TestCases.ListTestCases][google.cloud.dialogflow.cx.v3.TestCases.ListTestCases]. 612message ListTestCasesResponse { 613 // The list of test cases. There will be a maximum number of items returned 614 // based on the page_size field in the request. 615 repeated TestCase test_cases = 1; 616 617 // Token to retrieve the next page of results, or empty if there are no more 618 // results in the list. 619 string next_page_token = 2; 620} 621 622// The request message for 623// [TestCases.BatchDeleteTestCases][google.cloud.dialogflow.cx.v3.TestCases.BatchDeleteTestCases]. 624message BatchDeleteTestCasesRequest { 625 // Required. The agent to delete test cases from. 626 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. 627 string parent = 1 [ 628 (google.api.field_behavior) = REQUIRED, 629 (google.api.resource_reference) = { 630 child_type: "dialogflow.googleapis.com/TestCase" 631 } 632 ]; 633 634 // Required. Format of test case names: `projects/<Project ID>/locations/ 635 // <Location ID>/agents/<AgentID>/testCases/<TestCase ID>`. 636 repeated string names = 3 [ 637 (google.api.field_behavior) = REQUIRED, 638 (google.api.resource_reference) = { 639 type: "dialogflow.googleapis.com/TestCase" 640 } 641 ]; 642} 643 644// The request message for 645// [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3.TestCases.CreateTestCase]. 646message CreateTestCaseRequest { 647 // Required. The agent to create the test case for. 648 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. 649 string parent = 1 [ 650 (google.api.field_behavior) = REQUIRED, 651 (google.api.resource_reference) = { 652 child_type: "dialogflow.googleapis.com/TestCase" 653 } 654 ]; 655 656 // Required. The test case to create. 657 TestCase test_case = 2 [(google.api.field_behavior) = REQUIRED]; 658} 659 660// The request message for 661// [TestCases.UpdateTestCase][google.cloud.dialogflow.cx.v3.TestCases.UpdateTestCase]. 662message UpdateTestCaseRequest { 663 // Required. The test case to update. 664 TestCase test_case = 1 [(google.api.field_behavior) = REQUIRED]; 665 666 // Required. The mask to specify which fields should be updated. The 667 // [`creationTime`][google.cloud.dialogflow.cx.v3.TestCase.creation_time] and 668 // [`lastTestResult`][google.cloud.dialogflow.cx.v3.TestCase.last_test_result] 669 // cannot be updated. 670 google.protobuf.FieldMask update_mask = 2 671 [(google.api.field_behavior) = REQUIRED]; 672} 673 674// The request message for 675// [TestCases.GetTestCase][google.cloud.dialogflow.cx.v3.TestCases.GetTestCase]. 676message GetTestCaseRequest { 677 // Required. The name of the testcase. 678 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent 679 // ID>/testCases/<TestCase ID>`. 680 string name = 1 [ 681 (google.api.field_behavior) = REQUIRED, 682 (google.api.resource_reference) = { 683 type: "dialogflow.googleapis.com/TestCase" 684 } 685 ]; 686} 687 688// The request message for 689// [TestCases.RunTestCase][google.cloud.dialogflow.cx.v3.TestCases.RunTestCase]. 690message RunTestCaseRequest { 691 // Required. Format of test case name to run: `projects/<Project 692 // ID>/locations/ <Location ID>/agents/<AgentID>/testCases/<TestCase ID>`. 693 string name = 1 [ 694 (google.api.field_behavior) = REQUIRED, 695 (google.api.resource_reference) = { 696 type: "dialogflow.googleapis.com/TestCase" 697 } 698 ]; 699 700 // Optional. Environment name. If not set, draft environment is assumed. 701 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent 702 // ID>/environments/<Environment ID>`. 703 string environment = 2 [ 704 (google.api.field_behavior) = OPTIONAL, 705 (google.api.resource_reference) = { 706 type: "dialogflow.googleapis.com/Environment" 707 } 708 ]; 709} 710 711// The response message for 712// [TestCases.RunTestCase][google.cloud.dialogflow.cx.v3.TestCases.RunTestCase]. 713message RunTestCaseResponse { 714 // The result. 715 TestCaseResult result = 2; 716} 717 718// Metadata returned for the 719// [TestCases.RunTestCase][google.cloud.dialogflow.cx.v3.TestCases.RunTestCase] 720// long running operation. This message currently has no fields. 721message RunTestCaseMetadata {} 722 723// The request message for 724// [TestCases.BatchRunTestCases][google.cloud.dialogflow.cx.v3.TestCases.BatchRunTestCases]. 725message BatchRunTestCasesRequest { 726 // Required. Agent name. Format: `projects/<Project ID>/locations/<Location 727 // ID>/agents/ <AgentID>`. 728 string parent = 1 [ 729 (google.api.field_behavior) = REQUIRED, 730 (google.api.resource_reference) = { 731 child_type: "dialogflow.googleapis.com/TestCase" 732 } 733 ]; 734 735 // Optional. If not set, draft environment is assumed. Format: 736 // `projects/<Project ID>/locations/<Location ID>/agents/<Agent 737 // ID>/environments/<Environment ID>`. 738 string environment = 2 [ 739 (google.api.field_behavior) = OPTIONAL, 740 (google.api.resource_reference) = { 741 type: "dialogflow.googleapis.com/Environment" 742 } 743 ]; 744 745 // Required. Format: `projects/<Project ID>/locations/<Location 746 // ID>/agents/<Agent ID>/testCases/<TestCase ID>`. 747 repeated string test_cases = 3 [ 748 (google.api.field_behavior) = REQUIRED, 749 (google.api.resource_reference) = { 750 type: "dialogflow.googleapis.com/TestCase" 751 } 752 ]; 753} 754 755// The response message for 756// [TestCases.BatchRunTestCases][google.cloud.dialogflow.cx.v3.TestCases.BatchRunTestCases]. 757message BatchRunTestCasesResponse { 758 // The test case results. The detailed 759 // [conversation 760 // turns][google.cloud.dialogflow.cx.v3.TestCaseResult.conversation_turns] are 761 // empty in this response. 762 repeated TestCaseResult results = 1; 763} 764 765// Metadata returned for the 766// [TestCases.BatchRunTestCases][google.cloud.dialogflow.cx.v3.TestCases.BatchRunTestCases] 767// long running operation. 768message BatchRunTestCasesMetadata { 769 // The test errors. 770 repeated TestError errors = 1; 771} 772 773// Error info for running a test. 774message TestError { 775 // The test case resource name. 776 string test_case = 1 [(google.api.resource_reference) = { 777 type: "dialogflow.googleapis.com/TestCase" 778 }]; 779 780 // The status associated with the test. 781 google.rpc.Status status = 2; 782 783 // The timestamp when the test was completed. 784 google.protobuf.Timestamp test_time = 3; 785} 786 787// The request message for 788// [TestCases.ImportTestCases][google.cloud.dialogflow.cx.v3.TestCases.ImportTestCases]. 789message ImportTestCasesRequest { 790 // Required. The agent to import test cases to. 791 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. 792 string parent = 1 [ 793 (google.api.field_behavior) = REQUIRED, 794 (google.api.resource_reference) = { 795 child_type: "dialogflow.googleapis.com/TestCase" 796 } 797 ]; 798 799 // Required. The source to import. 800 oneof source { 801 // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI 802 // to import test cases from. The format of this URI must be 803 // `gs://<bucket-name>/<object-name>`. 804 // 805 // Dialogflow performs a read operation for the Cloud Storage object 806 // on the caller's behalf, so your request authentication must 807 // have read permissions for the object. For more information, see 808 // [Dialogflow access 809 // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). 810 string gcs_uri = 2; 811 812 // Uncompressed raw byte content for test cases. 813 bytes content = 3; 814 } 815} 816 817// The response message for 818// [TestCases.ImportTestCases][google.cloud.dialogflow.cx.v3.TestCases.ImportTestCases]. 819message ImportTestCasesResponse { 820 // The unique identifiers of the new test cases. 821 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent 822 // ID>/testCases/<TestCase ID>`. 823 repeated string names = 1 [(google.api.resource_reference) = { 824 type: "dialogflow.googleapis.com/TestCase" 825 }]; 826} 827 828// Metadata returned for the 829// [TestCases.ImportTestCases][google.cloud.dialogflow.cx.v3.TestCases.ImportTestCases] 830// long running operation. 831message ImportTestCasesMetadata { 832 // Errors for failed test cases. 833 repeated TestCaseError errors = 1; 834} 835 836// Error info for importing a test. 837message TestCaseError { 838 // The test case. 839 TestCase test_case = 1; 840 841 // The status associated with the test case. 842 google.rpc.Status status = 2; 843} 844 845// The request message for 846// [TestCases.ExportTestCases][google.cloud.dialogflow.cx.v3.TestCases.ExportTestCases]. 847message ExportTestCasesRequest { 848 // Data format of the exported test cases. 849 enum DataFormat { 850 // Unspecified format. 851 DATA_FORMAT_UNSPECIFIED = 0; 852 853 // Raw bytes. 854 BLOB = 1; 855 856 // JSON format. 857 JSON = 2; 858 } 859 860 // Required. The agent where to export test cases from. 861 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. 862 string parent = 1 [ 863 (google.api.field_behavior) = REQUIRED, 864 (google.api.resource_reference) = { 865 child_type: "dialogflow.googleapis.com/TestCase" 866 } 867 ]; 868 869 // The destination to export. 870 oneof destination { 871 // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to 872 // export the test cases to. The format of this URI must be 873 // `gs://<bucket-name>/<object-name>`. If unspecified, the serialized test 874 // cases is returned inline. 875 // 876 // Dialogflow performs a write operation for the Cloud Storage object 877 // on the caller's behalf, so your request authentication must 878 // have write permissions for the object. For more information, see 879 // [Dialogflow access 880 // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). 881 string gcs_uri = 2; 882 } 883 884 // The data format of the exported test cases. If not specified, `BLOB` is 885 // assumed. 886 DataFormat data_format = 3; 887 888 // The filter expression used to filter exported test cases, see 889 // [API Filtering](https://aip.dev/160). The expression is case insensitive 890 // and supports the following syntax: 891 // 892 // name = <value> [OR name = <value>] ... 893 // 894 // For example: 895 // 896 // * "name = t1 OR name = t2" matches the test case with the exact resource 897 // name "t1" or "t2". 898 string filter = 4; 899} 900 901// The response message for 902// [TestCases.ExportTestCases][google.cloud.dialogflow.cx.v3.TestCases.ExportTestCases]. 903message ExportTestCasesResponse { 904 // The exported test cases. 905 oneof destination { 906 // The URI to a file containing the exported test cases. This field is 907 // populated only if `gcs_uri` is specified in 908 // [ExportTestCasesRequest][google.cloud.dialogflow.cx.v3.ExportTestCasesRequest]. 909 string gcs_uri = 1; 910 911 // Uncompressed raw byte content for test cases. 912 bytes content = 2; 913 } 914} 915 916// Metadata returned for the 917// [TestCases.ExportTestCases][google.cloud.dialogflow.cx.v3.TestCases.ExportTestCases] 918// long running operation. This message currently has no fields. 919message ExportTestCasesMetadata {} 920 921// The request message for 922// [TestCases.ListTestCaseResults][google.cloud.dialogflow.cx.v3.TestCases.ListTestCaseResults]. 923message ListTestCaseResultsRequest { 924 // Required. The test case to list results for. 925 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/ 926 // testCases/<TestCase ID>`. Specify a `-` as a wildcard for TestCase ID to 927 // list results across multiple test cases. 928 string parent = 1 [ 929 (google.api.field_behavior) = REQUIRED, 930 (google.api.resource_reference) = { 931 child_type: "dialogflow.googleapis.com/TestCaseResult" 932 } 933 ]; 934 935 // The maximum number of items to return in a single page. By default 100 and 936 // at most 1000. 937 int32 page_size = 2; 938 939 // The next_page_token value returned from a previous list request. 940 string page_token = 3; 941 942 // The filter expression used to filter test case results. See 943 // [API Filtering](https://aip.dev/160). 944 // 945 // The expression is case insensitive. Only 'AND' is supported for logical 946 // operators. The supported syntax is listed below in detail: 947 // 948 // <field> <operator> <value> [AND <field> <operator> <value>] ... 949 // [AND latest] 950 // 951 // The supported fields and operators are: 952 // field operator 953 // `environment` `=`, `IN` (Use value `draft` for draft environment) 954 // `test_time` `>`, `<` 955 // 956 // `latest` only returns the latest test result in all results for each test 957 // case. 958 // 959 // Examples: 960 // * "environment=draft AND latest" matches the latest test result for each 961 // test case in the draft environment. 962 // * "environment IN (e1,e2)" matches any test case results with an 963 // environment resource name of either "e1" or "e2". 964 // * "test_time > 1602540713" matches any test case results with test time 965 // later than a unix timestamp in seconds 1602540713. 966 string filter = 4; 967} 968 969// The response message for 970// [TestCases.ListTestCaseResults][google.cloud.dialogflow.cx.v3.TestCases.ListTestCaseResults]. 971message ListTestCaseResultsResponse { 972 // The list of test case results. 973 repeated TestCaseResult test_case_results = 1; 974 975 // Token to retrieve the next page of results, or empty if there are no more 976 // results in the list. 977 string next_page_token = 2; 978} 979 980// The request message for 981// [TestCases.GetTestCaseResult][google.cloud.dialogflow.cx.v3.TestCases.GetTestCaseResult]. 982message GetTestCaseResultRequest { 983 // Required. The name of the testcase. 984 // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent 985 // ID>/testCases/<TestCase ID>/results/<TestCaseResult ID>`. 986 string name = 1 [ 987 (google.api.field_behavior) = REQUIRED, 988 (google.api.resource_reference) = { 989 type: "dialogflow.googleapis.com/TestCaseResult" 990 } 991 ]; 992} 993 994// The test result for a test case and an agent environment. 995enum TestResult { 996 // Not specified. Should never be used. 997 TEST_RESULT_UNSPECIFIED = 0; 998 999 // The test passed. 1000 PASSED = 1; 1001 1002 // The test did not pass. 1003 FAILED = 2; 1004} 1005