Reference documentation and code samples for the Dialogflow CX V3 API class Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.
REST client for the Examples service.
Service for managing Examples.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the Examples Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all Examples clients ::Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the Examples 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_example
def create_example(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Example
def create_example(parent: nil, example: nil) -> ::Google::Cloud::Dialogflow::CX::V3::ExampleCreates an example in the specified playbook.
def create_example(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Examplecreate_example via a request object, either of type
CreateExampleRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest, ::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_example(parent: nil, example: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Examplecreate_example 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 playbook to create an example for.
Format:
projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>. - example (::Google::Cloud::Dialogflow::CX::V3::Example, ::Hash) — Required. The example to create.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::CX::V3::Example)
- 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::Examples::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::CreateExampleRequest.new # Call the create_example method. result = client.create_example request # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Example. p result
#delete_example
def delete_example(request, options = nil) -> ::Google::Protobuf::Empty
def delete_example(name: nil) -> ::Google::Protobuf::EmptyDeletes the specified example.
def delete_example(request, options = nil) -> ::Google::Protobuf::Emptydelete_example via a request object, either of type
DeleteExampleRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest, ::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_example(name: nil) -> ::Google::Protobuf::Emptydelete_example 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 example to delete.
Format:
projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>/examples/<ExampleID>.
- (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::Examples::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::DeleteExampleRequest.new # Call the delete_example method. result = client.delete_example request # The returned object is of type Google::Protobuf::Empty. p result
#get_example
def get_example(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Example
def get_example(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::ExampleRetrieves the specified example.
def get_example(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Exampleget_example via a request object, either of type
GetExampleRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::GetExampleRequest, ::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_example(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Exampleget_example 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 example.
Format:
projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>/examples/<ExampleID>.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::CX::V3::Example)
- 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::Examples::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::GetExampleRequest.new # Call the get_example method. result = client.get_example request # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Example. p result
#initialize
def initialize() { |config| ... } -> ClientCreate a new Examples REST client object.
- (config) — Configure the Examples client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Dialogflow::CX::V3::Examples::Rest::Client.new do |config| config.timeout = 10.0 end
#list_examples
def list_examples(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Example>
def list_examples(parent: nil, page_size: nil, page_token: nil, language_code: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Example>Returns a list of examples in the specified playbook.
def list_examples(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Example>list_examples via a request object, either of type
ListExamplesRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest, ::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_examples(parent: nil, page_size: nil, page_token: nil, language_code: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Example>list_examples 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 playbook to list the examples from.
Format:
projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>. - page_size (::Integer) — Optional. The maximum number of items to return in a single page. By default 100 and at most 1000.
- page_token (::String) — Optional. The [next_page_token][ListExampleResponse.next_page_token] value returned from a previous list request.
- language_code (::String) — Optional. The language to list examples for. If not specified, list all examples under the playbook. Note: languages must be enabled in the agent before they can be used.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Example>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Example>)
- (::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::Examples::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::ListExamplesRequest.new # Call the list_examples method. result = client.list_examples 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::Example. p item end
#location_client
def location_client() -> Google::Cloud::Location::Locations::Rest::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)
#update_example
def update_example(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Example
def update_example(example: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::ExampleUpdate the specified example.
def update_example(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Exampleupdate_example via a request object, either of type
UpdateExampleRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest, ::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_example(example: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Exampleupdate_example 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).
- example (::Google::Cloud::Dialogflow::CX::V3::Example, ::Hash) — Required. The example to update.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. The mask to control which fields get updated. If the mask is not present, all fields will be updated.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::CX::V3::Example)
- 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::Examples::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::CX::V3::UpdateExampleRequest.new # Call the update_example method. result = client.update_example request # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Example. p result