Dialogflow CX V3 API - Class Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client (v0.17.0)

Reference documentation and code samples for the Dialogflow CX V3 API class Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.

REST client for the TestCases service.

Service for managing Test Cases and Test Case Results.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the TestCases Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all TestCases clients
::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::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::Empty

Batch deletes test cases.

Overloads
def batch_delete_test_cases(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to batch_delete_test_cases via a request object, either of type BatchDeleteTestCasesRequest or an equivalent Hash.
Parameters
  • 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::Empty
Pass arguments to batch_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).
Parameters
  • 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>.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#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::Operation

Kicks off a batch run of test cases.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

Overloads
def batch_run_test_cases(request, options = nil) -> ::Gapic::Operation
Pass arguments to batch_run_test_cases via a request object, either of type BatchRunTestCasesRequest or an equivalent Hash.
Parameters
  • 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::Operation
Pass arguments to batch_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).
Parameters
  • 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>.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#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::CalculateCoverageResponse

Calculates the test coverage for an agent.

Overloads
def calculate_coverage(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse
Pass arguments to calculate_coverage via a request object, either of type CalculateCoverageRequest or an equivalent Hash.
Parameters
  • 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::CalculateCoverageResponse
Pass arguments to calculate_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).
Parameters
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#configure

def configure() { |config| ... } -> Client::Configuration

Configure 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.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#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::TestCase

Creates a test case for the given agent.

Overloads
def create_test_case(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCase
Pass arguments to create_test_case via a request object, either of type CreateTestCaseRequest or an equivalent Hash.
Parameters
  • 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::TestCase
Pass arguments to create_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).
Parameters
  • 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.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#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::Operation

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. The returned Operation type has the following method-specific fields:

Overloads
def export_test_cases(request, options = nil) -> ::Gapic::Operation
Pass arguments to export_test_cases via a request object, either of type ExportTestCasesRequest or an equivalent Hash.
Parameters
  • 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::Operation
Pass arguments to export_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).
Parameters
  • 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, BLOB is 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".
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#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::TestCase

Gets a test case.

Overloads
def get_test_case(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCase
Pass arguments to get_test_case via a request object, either of type GetTestCaseRequest or an equivalent Hash.
Parameters
  • 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::TestCase
Pass arguments to get_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).
Parameter
  • name (::String) — Required. The name of the testcase. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/testCases/<TestCase ID>.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#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::TestCaseResult

Gets a test case result.

Overloads
def get_test_case_result(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCaseResult
Pass arguments to get_test_case_result via a request object, either of type GetTestCaseResultRequest or an equivalent Hash.
Parameters
  • 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::TestCaseResult
Pass arguments to get_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).
Parameter
  • name (::String) — Required. The name of the testcase. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/testCases/<TestCase ID>/results/<TestCaseResult ID>.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#import_test_cases

def import_test_cases(request, options = nil) -> ::Gapic::Operation
def import_test_cases(parent: nil, gcs_uri: nil, content: nil) -> ::Gapic::Operation

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. The returned Operation type has the following method-specific fields:

Overloads
def import_test_cases(request, options = nil) -> ::Gapic::Operation
Pass arguments to import_test_cases via a request object, either of type ImportTestCasesRequest or an equivalent Hash.
Parameters
  • 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::Operation
Pass arguments to import_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).
Parameters
  • 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.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#initialize

def initialize() { |config| ... } -> Client

Create a new TestCases REST client object.

Yields
  • (config) — Configure the TestCases client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new do |config|
  config.timeout = 10.0
end

#list_test_case_results

def list_test_case_results(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>
def list_test_case_results(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>

Fetches a list of results for a given test case.

Overloads
def list_test_case_results(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>
Pass arguments to list_test_case_results via a request object, either of type ListTestCaseResultsRequest or an equivalent Hash.
Parameters
  • 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::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>
Pass arguments to 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).
Parameters
  • 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 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.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#list_test_cases

def list_test_cases(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>
def list_test_cases(parent: nil, page_size: nil, page_token: nil, view: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>

Fetches a list of test cases for a given agent.

Overloads
def list_test_cases(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>
Pass arguments to list_test_cases via a request object, either of type ListTestCasesRequest or an equivalent Hash.
Parameters
  • 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::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>
Pass arguments to 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).
Parameters
  • 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.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#location_client

def location_client() -> Google::Cloud::Location::Locations::Rest::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Rest::Client)

#operations_client

def operations_client() -> ::Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Operations

Get 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::Operation

Kicks off a test case run.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

Overloads
def run_test_case(request, options = nil) -> ::Gapic::Operation
Pass arguments to run_test_case via a request object, either of type RunTestCaseRequest or an equivalent Hash.
Parameters
  • 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::Operation
Pass arguments to run_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).
Parameters
  • 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>.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#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::TestCase

Updates the specified test case.

Overloads
def update_test_case(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::TestCase
Pass arguments to update_test_case via a request object, either of type UpdateTestCaseRequest or an equivalent Hash.
Parameters
  • 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::TestCase
Pass arguments to update_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).
Parameters
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.