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::ConfigurationConfigure the WidgetConfigService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# 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::ConfigurationConfigure 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#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::WidgetConfigGets a WidgetConfig.
def get_widget_config(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::WidgetConfigget_widget_config via a request object, either of type
GetWidgetConfigRequest or an equivalent Hash.
- 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::WidgetConfigget_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).
-
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/descriptiononWidgetConfig.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.ModelConfigInfothe backend computes.ADMINis set by the Cloud Console admin "Feature Management" page to receive the admin-surfaced model set withResolvedModel.admin_viewpopulated;END_USER_MOBILEis set by the Gemini Enterprise mobile app to receive the mobile model set; unset /END_USER_WEBreturns the end-user web selector.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::DiscoveryEngine::V1::WidgetConfig)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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| ... } -> ClientCreate a new WidgetConfigService client object.
- (config) — Configure the WidgetConfigService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# 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::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)
#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::WidgetConfigUpdate a WidgetConfig.
def update_widget_config(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::WidgetConfigupdate_widget_config via a request object, either of type
UpdateWidgetConfigRequest or an equivalent Hash.
- 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::WidgetConfigupdate_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).
-
widget_config (::Google::Cloud::DiscoveryEngine::V1::WidgetConfig, ::Hash) — Required. The WidgetConfig
to update.
If the caller does not have permission to update the WidgetConfig, then a PERMISSION_DENIED error is returned.
If the WidgetConfig to update does not exist, a NOT_FOUND error is returned.
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) — Indicates which fields in the provided
WidgetConfig to update. The
following are the only supported fields:
- [WidgetConfig.enable_autocomplete][google.cloud.discoveryengine.v1.WidgetConfig.enable_autocomplete]
If not set, all supported fields are updated.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::DiscoveryEngine::V1::WidgetConfig)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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