Reference documentation and code samples for the Gemini Enterprise for Customer Experience V1BETA API class Google::Cloud::Ces::V1beta::WidgetService::Client.
Client for the WidgetService service.
Provides APIs for widgets to interact with CES APIs.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the WidgetService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all WidgetService clients ::Google::Cloud::Ces::V1beta::WidgetService::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the WidgetService 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)
#generate_chat_token
def generate_chat_token(request, options = nil) -> ::Google::Cloud::Ces::V1beta::GenerateChatTokenResponse
def generate_chat_token(name: nil, deployment: nil, recaptcha_token: nil, live_handoff_enabled: nil) -> ::Google::Cloud::Ces::V1beta::GenerateChatTokenResponseGenerates a session scoped token for chat widget to authenticate with Session APIs.
def generate_chat_token(request, options = nil) -> ::Google::Cloud::Ces::V1beta::GenerateChatTokenResponsegenerate_chat_token via a request object, either of type
GenerateChatTokenRequest or an equivalent Hash.
- request (::Google::Cloud::Ces::V1beta::GenerateChatTokenRequest, ::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 generate_chat_token(name: nil, deployment: nil, recaptcha_token: nil, live_handoff_enabled: nil) -> ::Google::Cloud::Ces::V1beta::GenerateChatTokenResponsegenerate_chat_token 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 session name to generate the chat token for. Format: projects/{project}/locations/{location}/apps/{app}/sessions/{session}
- deployment (::String) — Required. The deployment of the app to use for the session. Format: projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}
- recaptcha_token (::String) — Optional. The reCAPTCHA token generated by the client-side chat widget.
- live_handoff_enabled (::Boolean) — Optional. Indicates if live handoff is enabled for the session.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Ces::V1beta::GenerateChatTokenResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/ces/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Ces::V1beta::WidgetService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Ces::V1beta::GenerateChatTokenRequest.new # Call the generate_chat_token method. result = client.generate_chat_token request # The returned object is of type Google::Cloud::Ces::V1beta::GenerateChatTokenResponse. p result
#initialize
def initialize() { |config| ... } -> ClientCreate a new WidgetService client object.
- (config) — Configure the WidgetService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Ces::V1beta::WidgetService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Ces::V1beta::WidgetService::Client.new do |config| config.timeout = 10.0 end
#location_client
def location_client() -> Google::Cloud::Location::Locations::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)