Discovery Engine V1 API - Class Google::Cloud::DiscoveryEngine::V1::WidgetConfigService::Client (v2.14.0)

Reference documentation and code samples for the Discovery Engine V1 API class Google::Cloud::DiscoveryEngine::V1::WidgetConfigService::Client.

Client for the WidgetConfigService service.

Service for managing WidgetConfig configuration.

Inherits

  • Object

Methods

.configure

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

Configure the WidgetConfigService 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 WidgetConfigService clients
::Google::Cloud::DiscoveryEngine::V1::WidgetConfigService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the WidgetConfigService 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

#get_widget_config

def get_widget_config(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::WidgetConfig
def get_widget_config(name: nil, accept_cache: nil, get_widget_config_request_option: nil, language_code: nil, model_info_view: nil) -> ::Google::Cloud::DiscoveryEngine::V1::WidgetConfig

Gets a WidgetConfig.

Overloads
def get_widget_config(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::WidgetConfig
Pass arguments to get_widget_config via a request object, either of type GetWidgetConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1::GetWidgetConfigRequest, ::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_widget_config(name: nil, accept_cache: nil, get_widget_config_request_option: nil, language_code: nil, model_info_view: nil) -> ::Google::Cloud::DiscoveryEngine::V1::WidgetConfig
Pass arguments to get_widget_config 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. Full WidgetConfig resource name. Format: projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/widgetConfigs/{widget_config_id}
  • accept_cache (::Boolean) — Optional. Whether it's acceptable to load the widget config from cache. If set to true, recent changes on widget configs may take a few minutes to reflect on the end user's view. It's recommended to set to true for maturely developed widgets, as it improves widget performance. Set to false to see changes reflected in prod right away, if your widget is under development.
  • get_widget_config_request_option (::Google::Cloud::DiscoveryEngine::V1::GetWidgetConfigRequest::GetWidgetConfigRequestOption, ::Hash) — Optional. Options for GetWidgetConfigRequest.
  • language_code (::String) — Optional. BCP-47 language tag (e.g. "en", "fr-CA"). Used to localize human-readable strings in the response, such as the model selector display_name / description on WidgetConfig.UiSettings.ModelConfigInfo. Empty / unset falls back to the default language (English).
  • model_info_view (::Google::Cloud::DiscoveryEngine::V1::ModelInfoView) — Optional. Selects which view of WidgetConfig.UiSettings.ModelConfigInfo the backend computes. ADMIN is set by the Cloud Console admin "Feature Management" page to receive the admin-surfaced model set with ResolvedModel.admin_view populated; END_USER_MOBILE is set by the Gemini Enterprise mobile app to receive the mobile model set; unset / END_USER_WEB returns the end-user web selector.
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/discovery_engine/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1::WidgetConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1::GetWidgetConfigRequest.new

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

# The returned object is of type Google::Cloud::DiscoveryEngine::V1::WidgetConfig.
p result

#initialize

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

Create a new WidgetConfigService client object.

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

# Create a client using a custom configuration
client = ::Google::Cloud::DiscoveryEngine::V1::WidgetConfigService::Client.new do |config|
  config.timeout = 10.0
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)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_widget_config

def update_widget_config(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::WidgetConfig
def update_widget_config(widget_config: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1::WidgetConfig

Update a WidgetConfig.

Overloads
def update_widget_config(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::WidgetConfig
Pass arguments to update_widget_config via a request object, either of type UpdateWidgetConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1::UpdateWidgetConfigRequest, ::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_widget_config(widget_config: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1::WidgetConfig
Pass arguments to update_widget_config 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
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1::WidgetConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1::UpdateWidgetConfigRequest.new

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

# The returned object is of type Google::Cloud::DiscoveryEngine::V1::WidgetConfig.
p result