Reference documentation and code samples for the Dialogflow CX V3 API class Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.
REST 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all Environments clients ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#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:
metadata
: An empty Struct messageresponse
: Environment
def create_environment(request, options = nil) -> ::Gapic::Operation
create_environment
via a request object, either of type
CreateEnvironmentRequest or an equivalent Hash.
- 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
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).
-
parent (::String) — Required. The Agent to create an
Environment for. Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>
. - environment (::Google::Cloud::Dialogflow::CX::V3::Environment, ::Hash) — Required. The environment to create.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call 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::Environments::Rest::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.
def delete_environment(request, options = nil) -> ::Google::Protobuf::Empty
delete_environment
via a request object, either of type
DeleteEnvironmentRequest or an equivalent Hash.
- 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
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).
-
name (::String) — Required. The name of the
Environment to delete. Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment ID>
.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call 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::Environments::Rest::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:
metadata
: DeployFlowMetadataresponse
: DeployFlowResponse
def deploy_flow(request, options = nil) -> ::Gapic::Operation
deploy_flow
via a request object, either of type
DeployFlowRequest or an equivalent Hash.
- 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
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).
-
environment (::String) — Required. The environment to deploy the flow to.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/ environments/<Environment ID>
. -
flow_version (::String) — Required. The flow version to deploy.
Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/ flows/<Flow ID>/versions/<Version ID>
.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call 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::Environments::Rest::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.
def get_environment(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Environment
get_environment
via a request object, either of type
GetEnvironmentRequest or an equivalent Hash.
- 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
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).
-
name (::String) — Required. The name of the
Environment. Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment ID>
.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::CX::V3::Environment)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call 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::Environments::Rest::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 REST client object.
- (config) — Configure the Environments client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new do |config| config.timeout = 10.0 end
#list_continuous_test_results
def list_continuous_test_results(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult>
def list_continuous_test_results(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult>
Fetches a list of continuous test results for a given environment.
def list_continuous_test_results(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult>
list_continuous_test_results
via a request object, either of type
ListContinuousTestResultsRequest or an equivalent Hash.
- 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::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult>
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).
-
parent (::String) — Required. The environment to list results 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 100 and at most 1000.
- page_token (::String) — The next_page_token value returned from a previous list request.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult>)
- (::Google::Cloud::Error) — if the REST call 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::Environments::Rest::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::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>
def list_environments(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>
Returns the list of all environments in the specified Agent.
def list_environments(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>
list_environments
via a request object, either of type
ListEnvironmentsRequest or an equivalent Hash.
- 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::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>
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).
-
parent (::String) — Required. The Agent to list all
environments 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 and at most 100.
- page_token (::String) — The next_page_token value returned from a previous list request.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>)
- (::Google::Cloud::Error) — if the REST call 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::Environments::Rest::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::Rest::Client
Get the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#lookup_environment_history
def lookup_environment_history(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>
def lookup_environment_history(name: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>
Looks up the history of the specified Environment.
def lookup_environment_history(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>
lookup_environment_history
via a request object, either of type
LookupEnvironmentHistoryRequest or an equivalent Hash.
- 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::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>
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).
-
name (::String) — Required. Resource name of the environment to look up the history 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 100 and at most 1000.
- page_token (::String) — The next_page_token value returned from a previous list request.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>)
- (::Google::Cloud::Error) — if the REST call 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::Environments::Rest::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::Rest::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:
metadata
: RunContinuousTestMetadataresponse
: RunContinuousTestResponse
def run_continuous_test(request, options = nil) -> ::Gapic::Operation
run_continuous_test
via a request object, either of type
RunContinuousTestRequest or an equivalent Hash.
- 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
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).
-
environment (::String) — Required. Format:
projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment ID>
.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call 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::Environments::Rest::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
#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:
metadata
: An empty Struct messageresponse
: Environment
def update_environment(request, options = nil) -> ::Gapic::Operation
update_environment
via a request object, either of type
UpdateEnvironmentRequest or an equivalent Hash.
- 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
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).
- environment (::Google::Cloud::Dialogflow::CX::V3::Environment, ::Hash) — Required. The environment to update.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. The mask to control which fields get updated.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call 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::Environments::Rest::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