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