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

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::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::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
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::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
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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| ... } -> Client

Create a new TestCases 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::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 the list of run results for the given test case. A maximum of 100 results are kept for each test case.

Overloads
def list_test_case_results(request, options = nil) -> ::Gapic::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::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
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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.

Overloads
def list_test_cases(request, options = nil) -> ::Gapic::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::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
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::Client

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

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

#operations_client

def operations_client() -> ::Google::Cloud::Dialogflow::CX::V3::TestCases::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
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#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
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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