Dialogflow CX V3 API - Class Google::Cloud::Dialogflow::CX::V3::Experiments::Client (v0.25.0)

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

Client for the Experiments service.

Service for managing Experiments.

Inherits

  • Object

Methods

.configure

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

Configure the Experiments 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 Experiments clients
::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the Experiments 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_experiment

def create_experiment(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
def create_experiment(parent: nil, experiment: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment

Creates an Experiment in the specified Environment.

Overloads
def create_experiment(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
Pass arguments to create_experiment via a request object, either of type CreateExperimentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest, ::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_experiment(parent: nil, experiment: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
Pass arguments to create_experiment 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::Experiments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new

# Call the create_experiment method.
result = client.create_experiment request

# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment.
p result

#delete_experiment

def delete_experiment(request, options = nil) -> ::Google::Protobuf::Empty
def delete_experiment(name: nil) -> ::Google::Protobuf::Empty

Deletes the specified Experiment.

Overloads
def delete_experiment(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_experiment via a request object, either of type DeleteExperimentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest, ::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 delete_experiment(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_experiment 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 Environment to delete. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment ID>/experiments/<Experiment 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::Experiments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.new

# Call the delete_experiment method.
result = client.delete_experiment request

# The returned object is of type Google::Protobuf::Empty.
p result

#get_experiment

def get_experiment(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
def get_experiment(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment

Retrieves the specified Experiment.

Overloads
def get_experiment(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
Pass arguments to get_experiment via a request object, either of type GetExperimentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest, ::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_experiment(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
Pass arguments to get_experiment 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 Environment. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment ID>/experiments/<Experiment 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::Experiments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.new

# Call the get_experiment method.
result = client.get_experiment request

# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment.
p result

#initialize

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

Create a new Experiments client object.

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

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

#list_experiments

def list_experiments(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Experiment>
def list_experiments(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Experiment>

Returns the list of all experiments in the specified Environment.

Overloads
def list_experiments(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Experiment>
Pass arguments to list_experiments via a request object, either of type ListExperimentsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest, ::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_experiments(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Experiment>
Pass arguments to list_experiments 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 Environment to list all environments for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment ID>.
  • page_size (::Integer) — The maximum number of items to return in a single page. By default 20 and at most 100.
  • page_token (::String) — The next_page_token value returned from a previous list request.
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::Experiments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.new

# Call the list_experiments method.
result = client.list_experiments 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::Experiment.
  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)

#start_experiment

def start_experiment(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
def start_experiment(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment

Starts the specified Experiment. This rpc only changes the state of experiment from PENDING to RUNNING.

Overloads
def start_experiment(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
Pass arguments to start_experiment via a request object, either of type StartExperimentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest, ::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 start_experiment(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
Pass arguments to start_experiment 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. Resource name of the experiment to start. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment ID>/experiments/<Experiment 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::Experiments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.new

# Call the start_experiment method.
result = client.start_experiment request

# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment.
p result

#stop_experiment

def stop_experiment(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
def stop_experiment(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment

Stops the specified Experiment. This rpc only changes the state of experiment from RUNNING to DONE.

Overloads
def stop_experiment(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
Pass arguments to stop_experiment via a request object, either of type StopExperimentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest, ::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 stop_experiment(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
Pass arguments to stop_experiment 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. Resource name of the experiment to stop. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment ID>/experiments/<Experiment 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::Experiments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.new

# Call the stop_experiment method.
result = client.stop_experiment request

# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment.
p result

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_experiment

def update_experiment(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
def update_experiment(experiment: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment

Updates the specified Experiment.

Overloads
def update_experiment(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
Pass arguments to update_experiment via a request object, either of type UpdateExperimentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest, ::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_experiment(experiment: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
Pass arguments to update_experiment 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::Experiments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new

# Call the update_experiment method.
result = client.update_experiment request

# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment.
p result