Reference documentation and code samples for the Dialogflow CX V3 API class Google::Cloud::Dialogflow::CX::V3::TestCases::Client.
Client for the TestCases service.
Service for managing Test Cases and Test Case Results.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the TestCases Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all TestCases clients ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.configure do |config| config.timeout = 10.0 end
#batch_delete_test_cases
def batch_delete_test_cases(request, options = nil) -> ::Google::Protobuf::Empty
def batch_delete_test_cases(parent: nil, names: nil) -> ::Google::Protobuf::EmptyBatch deletes test cases.
def batch_delete_test_cases(request, options = nil) -> ::Google::Protobuf::Emptybatch_delete_test_cases via a request object, either of type
BatchDeleteTestCasesRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def batch_delete_test_cases(parent: nil, names: nil) -> ::Google::Protobuf::Emptybatch_delete_test_cases via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The agent to delete test cases from.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>. -
names (::Array<::String>) — Required. Format of test case names:
projects/<Project ID>/locations/ <Location ID>/agents/<AgentID>/testCases/<TestCase ID>.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Protobuf::Empty)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new # Call the batch_delete_test_cases method. result = client.batch_delete_test_cases request # The returned object is of type Google::Protobuf::Empty. p result
#batch_run_test_cases
def batch_run_test_cases(request, options = nil) -> ::Gapic::Operation
def batch_run_test_cases(parent: nil, environment: nil, test_cases: nil) -> ::Gapic::OperationKicks off a batch run of test cases.
This method is a long-running
operation.
The returned Operation type has the following method-specific fields:
metadata: BatchRunTestCasesMetadataresponse: BatchRunTestCasesResponse
def batch_run_test_cases(request, options = nil) -> ::Gapic::Operationbatch_run_test_cases via a request object, either of type
BatchRunTestCasesRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def batch_run_test_cases(parent: nil, environment: nil, test_cases: nil) -> ::Gapic::Operationbatch_run_test_cases via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. Agent name. Format:
projects/<Project ID>/locations/<Location ID>/agents/ <AgentID>. -
environment (::String) — Optional. If not set, draft environment is assumed. Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment ID>. -
test_cases (::Array<::String>) — Required. Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/testCases/<TestCase ID>.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new # Call the batch_run_test_cases method. result = client.batch_run_test_cases request # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done! timeout: 60 if result.response? p result.response else puts "No response received." end
#calculate_coverage
def calculate_coverage(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse
def calculate_coverage(agent: nil, type: nil) -> ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponseCalculates the test coverage for an agent.
def calculate_coverage(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponsecalculate_coverage via a request object, either of type
CalculateCoverageRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def calculate_coverage(agent: nil, type: nil) -> ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponsecalculate_coverage via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
agent (::String) — Required. The agent to calculate coverage for.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>. - type (::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest::CoverageType) — Required. The type of coverage requested.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new # Call the calculate_coverage method. result = client.calculate_coverage request # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse. p result
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the TestCases Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_test_case
def create_test_case(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCase
def create_test_case(parent: nil, test_case: nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCaseCreates a test case for the given agent.
def create_test_case(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCasecreate_test_case via a request object, either of type
CreateTestCaseRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_test_case(parent: nil, test_case: nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCasecreate_test_case via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The agent to create the test case for.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>. - test_case (::Google::Cloud::Dialogflow::CX::V3::TestCase, ::Hash) — Required. The test case to create.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::CX::V3::TestCase)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new # Call the create_test_case method. result = client.create_test_case request # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. p result
#export_test_cases
def export_test_cases(request, options = nil) -> ::Gapic::Operation
def export_test_cases(parent: nil, gcs_uri: nil, data_format: nil, filter: nil) -> ::Gapic::OperationExports 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.
The returned Operation type has the following method-specific fields:
metadata: ExportTestCasesMetadataresponse: ExportTestCasesResponse
def export_test_cases(request, options = nil) -> ::Gapic::Operationexport_test_cases via a request object, either of type
ExportTestCasesRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def export_test_cases(parent: nil, gcs_uri: nil, data_format: nil, filter: nil) -> ::Gapic::Operationexport_test_cases via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The agent where to export test cases from.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>. -
gcs_uri (::String) — The Google Cloud Storage 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.
-
data_format (::Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest::DataFormat) — The data format of the exported test cases. If not specified,
BLOBis assumed. -
filter (::String) —
The filter expression used to filter exported test cases, see API Filtering. The expression is case insensitive and supports the following syntax:
name =
For example:
- "name = t1 OR name = t2" matches the test case with the exact resource name "t1" or "t2".
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new # Call the export_test_cases method. result = client.export_test_cases request # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done! timeout: 60 if result.response? p result.response else puts "No response received." end
#get_test_case
def get_test_case(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCase
def get_test_case(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCaseGets a test case.
def get_test_case(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCaseget_test_case via a request object, either of type
GetTestCaseRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_test_case(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCaseget_test_case via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The name of the testcase.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/testCases/<TestCase ID>.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::CX::V3::TestCase)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.new # Call the get_test_case method. result = client.get_test_case request # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. p result
#get_test_case_result
def get_test_case_result(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCaseResult
def get_test_case_result(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCaseResultGets a test case result.
def get_test_case_result(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCaseResultget_test_case_result via a request object, either of type
GetTestCaseResultRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_test_case_result(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCaseResultget_test_case_result via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The name of the testcase.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/testCases/<TestCase ID>/results/<TestCaseResult ID>.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::CX::V3::TestCaseResult)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.new # Call the get_test_case_result method. result = client.get_test_case_result request # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCaseResult. p result
#import_test_cases
def import_test_cases(request, options = nil) -> ::Gapic::Operation
def import_test_cases(parent: nil, gcs_uri: nil, content: nil) -> ::Gapic::OperationImports 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.
The returned Operation type has the following method-specific fields:
metadata: ImportTestCasesMetadataresponse: ImportTestCasesResponse
def import_test_cases(request, options = nil) -> ::Gapic::Operationimport_test_cases via a request object, either of type
ImportTestCasesRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def import_test_cases(parent: nil, gcs_uri: nil, content: nil) -> ::Gapic::Operationimport_test_cases via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The agent to import test cases to.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>. -
gcs_uri (::String) — The Google Cloud Storage 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.
- content (::String) — Uncompressed raw byte content for test cases.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new # Call the import_test_cases method. result = client.import_test_cases request # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done! timeout: 60 if result.response? p result.response else puts "No response received." end
#initialize
def initialize() { |config| ... } -> ClientCreate a new TestCases client object.
- (config) — Configure the TestCases client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new do |config| config.timeout = 10.0 end
#list_test_case_results
def list_test_case_results(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>
def list_test_case_results(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>Fetches a list of results for a given test case.
def list_test_case_results(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>list_test_case_results via a request object, either of type
ListTestCaseResultsRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_test_case_results(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>list_test_case_results via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — 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. - page_size (::Integer) — The maximum number of items to return in a single page. By default 100 and at most 1000.
- page_token (::String) — The next_page_token value returned from a previous list request.
-
filter (::String) —
The filter expression used to filter test case results. See API Filtering.
The expression is case insensitive. Only 'AND' is supported for logical operators. The supported syntax is listed below in detail:
The supported fields and operators are: field operator
environment=,IN(Use valuedraftfor draft environment)test_time>,<latestonly 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.new # Call the list_test_case_results method. result = client.list_test_case_results request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::TestCaseResult. p item end
#list_test_cases
def list_test_cases(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>
def list_test_cases(parent: nil, page_size: nil, page_token: nil, view: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>Fetches a list of test cases for a given agent.
def list_test_cases(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>list_test_cases via a request object, either of type
ListTestCasesRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_test_cases(parent: nil, page_size: nil, page_token: nil, view: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>list_test_cases via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The agent to list all pages for.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>. - page_size (::Integer) — 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.
- page_token (::String) — The next_page_token value returned from a previous list request.
- view (::Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest::TestCaseView) — Specifies whether response should include all fields or just the metadata.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new # Call the list_test_cases method. result = client.list_test_cases request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::TestCase. p item end
#location_client
def location_client() -> Google::Cloud::Location::Locations::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#operations_client
def operations_client() -> ::Google::Cloud::Dialogflow::CX::V3::TestCases::OperationsGet the associated client for long-running operations.
#run_test_case
def run_test_case(request, options = nil) -> ::Gapic::Operation
def run_test_case(name: nil, environment: nil) -> ::Gapic::OperationKicks off a test case run.
This method is a long-running
operation.
The returned Operation type has the following method-specific fields:
metadata: RunTestCaseMetadataresponse: RunTestCaseResponse
def run_test_case(request, options = nil) -> ::Gapic::Operationrun_test_case via a request object, either of type
RunTestCaseRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def run_test_case(name: nil, environment: nil) -> ::Gapic::Operationrun_test_case via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Format of test case name to run:
projects/<Project ID>/locations/ <Location ID>/agents/<AgentID>/testCases/<TestCase ID>. -
environment (::String) — Optional. Environment name. If not set, draft environment is assumed.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment ID>.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new # Call the run_test_case method. result = client.run_test_case request # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done! timeout: 60 if result.response? p result.response else puts "No response received." end
#update_test_case
def update_test_case(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCase
def update_test_case(test_case: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCaseUpdates the specified test case.
def update_test_case(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCaseupdate_test_case via a request object, either of type
UpdateTestCaseRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_test_case(test_case: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCaseupdate_test_case via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- test_case (::Google::Cloud::Dialogflow::CX::V3::TestCase, ::Hash) — Required. The test case to update.
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. The mask to specify which fields should be updated. The
creationTimeandlastTestResultcannot be updated.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::CX::V3::TestCase)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/cx/v3" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new # Call the update_test_case method. result = client.update_test_case request # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. p result