Discovery Engine v1 API - Class WidgetConfigServiceClient (1.17.0)

public abstract class WidgetConfigServiceClient

Reference documentation and code samples for the Discovery Engine v1 API class WidgetConfigServiceClient.

WidgetConfigService client wrapper, for convenient use.

Inheritance

object > WidgetConfigServiceClient

Namespace

Google.Cloud.DiscoveryEngine.V1

Assembly

Google.Cloud.DiscoveryEngine.V1.dll

Remarks

Service for managing [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig] configuration.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the WidgetConfigService service, which is a host of "discoveryengine.googleapis.com" and a port of 443.

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default WidgetConfigService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

GrpcClient

public virtual WidgetConfigService.WidgetConfigServiceClient GrpcClient { get; }

The underlying gRPC WidgetConfigService client

Property Value
Type Description
WidgetConfigServiceWidgetConfigServiceClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
Type Description
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static WidgetConfigServiceClient Create()

Synchronously creates a WidgetConfigServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use WidgetConfigServiceClientBuilder.

Returns
Type Description
WidgetConfigServiceClient

The created WidgetConfigServiceClient.

CreateAsync(CancellationToken)

public static Task<WidgetConfigServiceClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a WidgetConfigServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use WidgetConfigServiceClientBuilder.

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskWidgetConfigServiceClient

The task representing the created WidgetConfigServiceClient.

GetWidgetConfig(GetWidgetConfigRequest, CallSettings)

public virtual WidgetConfig GetWidgetConfig(GetWidgetConfigRequest request, CallSettings callSettings = null)

Gets a [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig].

Parameters
Name Description
request GetWidgetConfigRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
WidgetConfig

The RPC response.

Example
// Create client
WidgetConfigServiceClient widgetConfigServiceClient = WidgetConfigServiceClient.Create();
// Initialize request argument(s)
GetWidgetConfigRequest request = new GetWidgetConfigRequest
{
    WidgetConfigName = WidgetConfigName.FromProjectLocationDataStoreWidgetConfig("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[WIDGET_CONFIG]"),
    AcceptCache = false,
    GetWidgetConfigRequestOption = new GetWidgetConfigRequest.Types.GetWidgetConfigRequestOption(),
    LanguageCode = "",
    ModelInfoView = ModelInfoView.Unspecified,
};
// Make the request
WidgetConfig response = widgetConfigServiceClient.GetWidgetConfig(request);

GetWidgetConfig(WidgetConfigName, CallSettings)

public virtual WidgetConfig GetWidgetConfig(WidgetConfigName name, CallSettings callSettings = null)

Gets a [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig].

Parameters
Name Description
name WidgetConfigName

Required. Full WidgetConfig resource name. Format: projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/widgetConfigs/{widget_config_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
WidgetConfig

The RPC response.

Example
// Create client
WidgetConfigServiceClient widgetConfigServiceClient = WidgetConfigServiceClient.Create();
// Initialize request argument(s)
WidgetConfigName name = WidgetConfigName.FromProjectLocationDataStoreWidgetConfig("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[WIDGET_CONFIG]");
// Make the request
WidgetConfig response = widgetConfigServiceClient.GetWidgetConfig(name);

GetWidgetConfig(string, CallSettings)

public virtual WidgetConfig GetWidgetConfig(string name, CallSettings callSettings = null)

Gets a [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig].

Parameters
Name Description
name string

Required. Full WidgetConfig resource name. Format: projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/widgetConfigs/{widget_config_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
WidgetConfig

The RPC response.

Example
// Create client
WidgetConfigServiceClient widgetConfigServiceClient = WidgetConfigServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/dataStores/[DATA_STORE]/widgetConfigs/[WIDGET_CONFIG]";
// Make the request
WidgetConfig response = widgetConfigServiceClient.GetWidgetConfig(name);

GetWidgetConfigAsync(GetWidgetConfigRequest, CallSettings)

public virtual Task<WidgetConfig> GetWidgetConfigAsync(GetWidgetConfigRequest request, CallSettings callSettings = null)

Gets a [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig].

Parameters
Name Description
request GetWidgetConfigRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskWidgetConfig

A Task containing the RPC response.

Example
// Create client
WidgetConfigServiceClient widgetConfigServiceClient = await WidgetConfigServiceClient.CreateAsync();
// Initialize request argument(s)
GetWidgetConfigRequest request = new GetWidgetConfigRequest
{
    WidgetConfigName = WidgetConfigName.FromProjectLocationDataStoreWidgetConfig("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[WIDGET_CONFIG]"),
    AcceptCache = false,
    GetWidgetConfigRequestOption = new GetWidgetConfigRequest.Types.GetWidgetConfigRequestOption(),
    LanguageCode = "",
    ModelInfoView = ModelInfoView.Unspecified,
};
// Make the request
WidgetConfig response = await widgetConfigServiceClient.GetWidgetConfigAsync(request);

GetWidgetConfigAsync(GetWidgetConfigRequest, CancellationToken)

public virtual Task<WidgetConfig> GetWidgetConfigAsync(GetWidgetConfigRequest request, CancellationToken cancellationToken)

Gets a [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig].

Parameters
Name Description
request GetWidgetConfigRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskWidgetConfig

A Task containing the RPC response.

Example
// Create client
WidgetConfigServiceClient widgetConfigServiceClient = await WidgetConfigServiceClient.CreateAsync();
// Initialize request argument(s)
GetWidgetConfigRequest request = new GetWidgetConfigRequest
{
    WidgetConfigName = WidgetConfigName.FromProjectLocationDataStoreWidgetConfig("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[WIDGET_CONFIG]"),
    AcceptCache = false,
    GetWidgetConfigRequestOption = new GetWidgetConfigRequest.Types.GetWidgetConfigRequestOption(),
    LanguageCode = "",
    ModelInfoView = ModelInfoView.Unspecified,
};
// Make the request
WidgetConfig response = await widgetConfigServiceClient.GetWidgetConfigAsync(request);

GetWidgetConfigAsync(WidgetConfigName, CallSettings)

public virtual Task<WidgetConfig> GetWidgetConfigAsync(WidgetConfigName name, CallSettings callSettings = null)

Gets a [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig].

Parameters
Name Description
name WidgetConfigName

Required. Full WidgetConfig resource name. Format: projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/widgetConfigs/{widget_config_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskWidgetConfig

A Task containing the RPC response.

Example
// Create client
WidgetConfigServiceClient widgetConfigServiceClient = await WidgetConfigServiceClient.CreateAsync();
// Initialize request argument(s)
WidgetConfigName name = WidgetConfigName.FromProjectLocationDataStoreWidgetConfig("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[WIDGET_CONFIG]");
// Make the request
WidgetConfig response = await widgetConfigServiceClient.GetWidgetConfigAsync(name);

GetWidgetConfigAsync(WidgetConfigName, CancellationToken)

public virtual Task<WidgetConfig> GetWidgetConfigAsync(WidgetConfigName name, CancellationToken cancellationToken)

Gets a [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig].

Parameters
Name Description
name WidgetConfigName

Required. Full WidgetConfig resource name. Format: projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/widgetConfigs/{widget_config_id}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskWidgetConfig

A Task containing the RPC response.

Example
// Create client
WidgetConfigServiceClient widgetConfigServiceClient = await WidgetConfigServiceClient.CreateAsync();
// Initialize request argument(s)
WidgetConfigName name = WidgetConfigName.FromProjectLocationDataStoreWidgetConfig("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[WIDGET_CONFIG]");
// Make the request
WidgetConfig response = await widgetConfigServiceClient.GetWidgetConfigAsync(name);

GetWidgetConfigAsync(string, CallSettings)

public virtual Task<WidgetConfig> GetWidgetConfigAsync(string name, CallSettings callSettings = null)

Gets a [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig].

Parameters
Name Description
name string

Required. Full WidgetConfig resource name. Format: projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/widgetConfigs/{widget_config_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskWidgetConfig

A Task containing the RPC response.

Example
// Create client
WidgetConfigServiceClient widgetConfigServiceClient = await WidgetConfigServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/dataStores/[DATA_STORE]/widgetConfigs/[WIDGET_CONFIG]";
// Make the request
WidgetConfig response = await widgetConfigServiceClient.GetWidgetConfigAsync(name);

GetWidgetConfigAsync(string, CancellationToken)

public virtual Task<WidgetConfig> GetWidgetConfigAsync(string name, CancellationToken cancellationToken)

Gets a [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig].

Parameters
Name Description
name string

Required. Full WidgetConfig resource name. Format: projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/widgetConfigs/{widget_config_id}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskWidgetConfig

A Task containing the RPC response.

Example
// Create client
WidgetConfigServiceClient widgetConfigServiceClient = await WidgetConfigServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/dataStores/[DATA_STORE]/widgetConfigs/[WIDGET_CONFIG]";
// Make the request
WidgetConfig response = await widgetConfigServiceClient.GetWidgetConfigAsync(name);

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
Type Description
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

UpdateWidgetConfig(UpdateWidgetConfigRequest, CallSettings)

public virtual WidgetConfig UpdateWidgetConfig(UpdateWidgetConfigRequest request, CallSettings callSettings = null)

Update a WidgetConfig.

Parameters
Name Description
request UpdateWidgetConfigRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
WidgetConfig

The RPC response.

Example
// Create client
WidgetConfigServiceClient widgetConfigServiceClient = WidgetConfigServiceClient.Create();
// Initialize request argument(s)
UpdateWidgetConfigRequest request = new UpdateWidgetConfigRequest
{
    WidgetConfig = new WidgetConfig(),
    UpdateMask = new FieldMask(),
};
// Make the request
WidgetConfig response = widgetConfigServiceClient.UpdateWidgetConfig(request);

UpdateWidgetConfig(WidgetConfig, FieldMask, CallSettings)

public virtual WidgetConfig UpdateWidgetConfig(WidgetConfig widgetConfig, FieldMask updateMask, CallSettings callSettings = null)

Update a WidgetConfig.

Parameters
Name Description
widgetConfig WidgetConfig

Required. The [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig] to update.

If the caller does not have permission to update the [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig], then a PERMISSION_DENIED error is returned.

If the [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig] to update does not exist, a NOT_FOUND error is returned.

updateMask FieldMask

Indicates which fields in the provided [WidgetConfig][google.cloud.discoveryengine.v1.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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
WidgetConfig

The RPC response.

Example
// Create client
WidgetConfigServiceClient widgetConfigServiceClient = WidgetConfigServiceClient.Create();
// Initialize request argument(s)
WidgetConfig widgetConfig = new WidgetConfig();
FieldMask updateMask = new FieldMask();
// Make the request
WidgetConfig response = widgetConfigServiceClient.UpdateWidgetConfig(widgetConfig, updateMask);

UpdateWidgetConfigAsync(UpdateWidgetConfigRequest, CallSettings)

public virtual Task<WidgetConfig> UpdateWidgetConfigAsync(UpdateWidgetConfigRequest request, CallSettings callSettings = null)

Update a WidgetConfig.

Parameters
Name Description
request UpdateWidgetConfigRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskWidgetConfig

A Task containing the RPC response.

Example
// Create client
WidgetConfigServiceClient widgetConfigServiceClient = await WidgetConfigServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateWidgetConfigRequest request = new UpdateWidgetConfigRequest
{
    WidgetConfig = new WidgetConfig(),
    UpdateMask = new FieldMask(),
};
// Make the request
WidgetConfig response = await widgetConfigServiceClient.UpdateWidgetConfigAsync(request);

UpdateWidgetConfigAsync(UpdateWidgetConfigRequest, CancellationToken)

public virtual Task<WidgetConfig> UpdateWidgetConfigAsync(UpdateWidgetConfigRequest request, CancellationToken cancellationToken)

Update a WidgetConfig.

Parameters
Name Description
request UpdateWidgetConfigRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskWidgetConfig

A Task containing the RPC response.

Example
// Create client
WidgetConfigServiceClient widgetConfigServiceClient = await WidgetConfigServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateWidgetConfigRequest request = new UpdateWidgetConfigRequest
{
    WidgetConfig = new WidgetConfig(),
    UpdateMask = new FieldMask(),
};
// Make the request
WidgetConfig response = await widgetConfigServiceClient.UpdateWidgetConfigAsync(request);

UpdateWidgetConfigAsync(WidgetConfig, FieldMask, CallSettings)

public virtual Task<WidgetConfig> UpdateWidgetConfigAsync(WidgetConfig widgetConfig, FieldMask updateMask, CallSettings callSettings = null)

Update a WidgetConfig.

Parameters
Name Description
widgetConfig WidgetConfig

Required. The [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig] to update.

If the caller does not have permission to update the [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig], then a PERMISSION_DENIED error is returned.

If the [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig] to update does not exist, a NOT_FOUND error is returned.

updateMask FieldMask

Indicates which fields in the provided [WidgetConfig][google.cloud.discoveryengine.v1.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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskWidgetConfig

A Task containing the RPC response.

Example
// Create client
WidgetConfigServiceClient widgetConfigServiceClient = await WidgetConfigServiceClient.CreateAsync();
// Initialize request argument(s)
WidgetConfig widgetConfig = new WidgetConfig();
FieldMask updateMask = new FieldMask();
// Make the request
WidgetConfig response = await widgetConfigServiceClient.UpdateWidgetConfigAsync(widgetConfig, updateMask);

UpdateWidgetConfigAsync(WidgetConfig, FieldMask, CancellationToken)

public virtual Task<WidgetConfig> UpdateWidgetConfigAsync(WidgetConfig widgetConfig, FieldMask updateMask, CancellationToken cancellationToken)

Update a WidgetConfig.

Parameters
Name Description
widgetConfig WidgetConfig

Required. The [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig] to update.

If the caller does not have permission to update the [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig], then a PERMISSION_DENIED error is returned.

If the [WidgetConfig][google.cloud.discoveryengine.v1.WidgetConfig] to update does not exist, a NOT_FOUND error is returned.

updateMask FieldMask

Indicates which fields in the provided [WidgetConfig][google.cloud.discoveryengine.v1.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.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskWidgetConfig

A Task containing the RPC response.

Example
// Create client
WidgetConfigServiceClient widgetConfigServiceClient = await WidgetConfigServiceClient.CreateAsync();
// Initialize request argument(s)
WidgetConfig widgetConfig = new WidgetConfig();
FieldMask updateMask = new FieldMask();
// Make the request
WidgetConfig response = await widgetConfigServiceClient.UpdateWidgetConfigAsync(widgetConfig, updateMask);