Dialogflow CX V3 API - Class Google::Cloud::Dialogflow::CX::V3::Environments::Client (v1.2.0)

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

Client for the Environments service.

Service for managing Environments.

Inherits

  • Object

Methods

.configure

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

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

#configure

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

Configure the Environments 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_environment

def create_environment(request, options = nil) -> ::Gapic::Operation
def create_environment(parent: nil, environment: nil) -> ::Gapic::Operation

Creates an Environment in the specified Agent.

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

Overloads
def create_environment(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_environment via a request object, either of type CreateEnvironmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest, ::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_environment(parent: nil, environment: nil) -> ::Gapic::Operation
Pass arguments to create_environment 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
  • 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::Environments::Client.new

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

# Call the create_environment method.
result = client.create_environment 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

#delete_environment

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

Deletes the specified Environment.

Overloads
def delete_environment(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_environment via a request object, either of type DeleteEnvironmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::DeleteEnvironmentRequest, ::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_environment(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_environment 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/<ProjectID>/locations/<LocationID>/agents/<AgentID>/environments/<EnvironmentID>.
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::Environments::Client.new

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

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

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

#deploy_flow

def deploy_flow(request, options = nil) -> ::Gapic::Operation
def deploy_flow(environment: nil, flow_version: nil) -> ::Gapic::Operation

Deploys a flow to the specified Environment.

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

Overloads
def deploy_flow(request, options = nil) -> ::Gapic::Operation
Pass arguments to deploy_flow via a request object, either of type DeployFlowRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest, ::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 deploy_flow(environment: nil, flow_version: nil) -> ::Gapic::Operation
Pass arguments to deploy_flow 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
  • environment (::String) — Required. The environment to deploy the flow to. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/environments/<EnvironmentID>.
  • flow_version (::String) — Required. The flow version to deploy. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/versions/<VersionID>.
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::Environments::Client.new

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

# Call the deploy_flow method.
result = client.deploy_flow 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_environment

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

Retrieves the specified Environment.

Overloads
def get_environment(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Environment
Pass arguments to get_environment via a request object, either of type GetEnvironmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest, ::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_environment(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Environment
Pass arguments to get_environment 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/<ProjectID>/locations/<LocationID>/agents/<AgentID>/environments/<EnvironmentID>.
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::Environments::Client.new

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

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

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

#initialize

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

Create a new Environments client object.

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

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

#list_continuous_test_results

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

Fetches a list of continuous test results for a given environment.

Overloads
def list_continuous_test_results(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult>
Pass arguments to list_continuous_test_results via a request object, either of type ListContinuousTestResultsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest, ::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_continuous_test_results(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult>
Pass arguments to list_continuous_test_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 environment to list results for. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/environments/<EnvironmentID>.
  • 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.
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::Environments::Client.new

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

# Call the list_continuous_test_results method.
result = client.list_continuous_test_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::ContinuousTestResult.
  p item
end

#list_environments

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

Returns the list of all environments in the specified Agent.

Overloads
def list_environments(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>
Pass arguments to list_environments via a request object, either of type ListEnvironmentsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::ListEnvironmentsRequest, ::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_environments(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>
Pass arguments to list_environments 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 environments for. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>.
  • 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::Environments::Client.new

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

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

#lookup_environment_history

def lookup_environment_history(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>
def lookup_environment_history(name: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>

Looks up the history of the specified Environment.

Overloads
def lookup_environment_history(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>
Pass arguments to lookup_environment_history via a request object, either of type LookupEnvironmentHistoryRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest, ::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 lookup_environment_history(name: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>
Pass arguments to lookup_environment_history 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. Resource name of the environment to look up the history for. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/environments/<EnvironmentID>.
  • 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.
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::Environments::Client.new

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

# Call the lookup_environment_history method.
result = client.lookup_environment_history 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::Environment.
  p item
end

#operations_client

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

Get the associated client for long-running operations.

#run_continuous_test

def run_continuous_test(request, options = nil) -> ::Gapic::Operation
def run_continuous_test(environment: nil) -> ::Gapic::Operation

Kicks off a continuous test under the specified Environment.

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

Overloads
def run_continuous_test(request, options = nil) -> ::Gapic::Operation
Pass arguments to run_continuous_test via a request object, either of type RunContinuousTestRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest, ::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_continuous_test(environment: nil) -> ::Gapic::Operation
Pass arguments to run_continuous_test 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
  • environment (::String) — Required. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/environments/<EnvironmentID>.
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::Environments::Client.new

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

# Call the run_continuous_test method.
result = client.run_continuous_test 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_environment

def update_environment(request, options = nil) -> ::Gapic::Operation
def update_environment(environment: nil, update_mask: nil) -> ::Gapic::Operation

Updates the specified Environment.

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

Overloads
def update_environment(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_environment via a request object, either of type UpdateEnvironmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest, ::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_environment(environment: nil, update_mask: nil) -> ::Gapic::Operation
Pass arguments to update_environment 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
  • 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::Environments::Client.new

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

# Call the update_environment method.
result = client.update_environment 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