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.
- (config) — Configure the Client client.
- config (Client::Configuration)
# 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#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.
def create_experiment(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
create_experiment
via a request object, either of type
CreateExperimentRequest or an equivalent Hash.
- 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
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).
-
parent (::String) — Required. The Agent to create an
Environment for. Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment ID>
. - experiment (::Google::Cloud::Dialogflow::CX::V3::Experiment, ::Hash) — Required. The experiment to create.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::CX::V3::Experiment)
- 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::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.
def delete_experiment(request, options = nil) -> ::Google::Protobuf::Empty
delete_experiment
via a request object, either of type
DeleteExperimentRequest or an equivalent Hash.
- 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
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).
-
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>
.
- (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::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.
def get_experiment(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
get_experiment
via a request object, either of type
GetExperimentRequest or an equivalent Hash.
- 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
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).
-
name (::String) — Required. The name of the
Environment. Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment ID>/experiments/<Experiment ID>
.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::CX::V3::Experiment)
- 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::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.
- (config) — Configure the Experiments client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# 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.
def list_experiments(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Experiment>
list_experiments
via a request object, either of type
ListExperimentsRequest or an equivalent Hash.
- 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>
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).
-
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Experiment>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Experiment>)
- (::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::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 all elements by calling #each, and the enumerable # will lazily make API calls to fetch subsequent pages. Other # methods are also available for managing paging directly. result.each do |response| # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Experiment. p response end
#location_client
def location_client() -> Google::Cloud::Location::Locations::Client
Get the associated client for mix-in of the Locations.
- (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.
def start_experiment(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
start_experiment
via a request object, either of type
StartExperimentRequest or an equivalent Hash.
- 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
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).
-
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>
.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::CX::V3::Experiment)
- 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::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.
def stop_experiment(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
stop_experiment
via a request object, either of type
StopExperimentRequest or an equivalent Hash.
- 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
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).
-
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>
.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::CX::V3::Experiment)
- 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::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
#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.
def update_experiment(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Experiment
update_experiment
via a request object, either of type
UpdateExperimentRequest or an equivalent Hash.
- 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
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).
- experiment (::Google::Cloud::Dialogflow::CX::V3::Experiment, ::Hash) — Required. The experiment to update.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. The mask to control which fields get updated.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::CX::V3::Experiment)
- 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::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