Discovery Engine v1beta API - Class SampleQueryServiceClient (1.0.0-beta18)

public abstract class SampleQueryServiceClient

Reference documentation and code samples for the Discovery Engine v1beta API class SampleQueryServiceClient.

SampleQueryService client wrapper, for convenient use.

Inheritance

object > SampleQueryServiceClient

Namespace

Google.Cloud.DiscoveryEngine.V1Beta

Assembly

Google.Cloud.DiscoveryEngine.V1Beta.dll

Remarks

Service for managing [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s,

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the SampleQueryService 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 SampleQueryService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default SampleQueryService scopes are:

GrpcClient

public virtual SampleQueryService.SampleQueryServiceClient GrpcClient { get; }

The underlying gRPC SampleQueryService client

Property Value
Type Description
SampleQueryServiceSampleQueryServiceClient

ImportSampleQueriesOperationsClient

public virtual OperationsClient ImportSampleQueriesOperationsClient { get; }

The long-running operations client for ImportSampleQueries.

Property Value
Type Description
OperationsClient

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 SampleQueryServiceClient Create()

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

Returns
Type Description
SampleQueryServiceClient

The created SampleQueryServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskSampleQueryServiceClient

The task representing the created SampleQueryServiceClient.

CreateSampleQuery(CreateSampleQueryRequest, CallSettings)

public virtual SampleQuery CreateSampleQuery(CreateSampleQueryRequest request, CallSettings callSettings = null)

Creates a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]

Parameters
Name Description
request CreateSampleQueryRequest

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
SampleQuery

The RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = SampleQueryServiceClient.Create();
// Initialize request argument(s)
CreateSampleQueryRequest request = new CreateSampleQueryRequest
{
    ParentAsSampleQuerySetName = SampleQuerySetName.FromProjectLocationSampleQuerySet("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]"),
    SampleQuery = new SampleQuery(),
    SampleQueryId = "",
};
// Make the request
SampleQuery response = sampleQueryServiceClient.CreateSampleQuery(request);

CreateSampleQuery(SampleQuerySetName, SampleQuery, string, CallSettings)

public virtual SampleQuery CreateSampleQuery(SampleQuerySetName parent, SampleQuery sampleQuery, string sampleQueryId, CallSettings callSettings = null)

Creates a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]

Parameters
Name Description
parent SampleQuerySetName

Required. The parent resource name, such as projects/{project}/locations/{location}/sampleQuerySets/{sampleQuerySet}.

sampleQuery SampleQuery

Required. The [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] to create.

sampleQueryId string

Required. The ID to use for the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], which will become the final component of the [SampleQuery.name][google.cloud.discoveryengine.v1beta.SampleQuery.name].

If the caller does not have permission to create the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

This field must be unique among all [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s with the same [parent][google.cloud.discoveryengine.v1beta.CreateSampleQueryRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned.

This field must conform to RFC-1034 standard with a length limit of 63 characters. Otherwise, an INVALID_ARGUMENT error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SampleQuery

The RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = SampleQueryServiceClient.Create();
// Initialize request argument(s)
SampleQuerySetName parent = SampleQuerySetName.FromProjectLocationSampleQuerySet("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]");
SampleQuery sampleQuery = new SampleQuery();
string sampleQueryId = "";
// Make the request
SampleQuery response = sampleQueryServiceClient.CreateSampleQuery(parent, sampleQuery, sampleQueryId);

CreateSampleQuery(string, SampleQuery, string, CallSettings)

public virtual SampleQuery CreateSampleQuery(string parent, SampleQuery sampleQuery, string sampleQueryId, CallSettings callSettings = null)

Creates a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]

Parameters
Name Description
parent string

Required. The parent resource name, such as projects/{project}/locations/{location}/sampleQuerySets/{sampleQuerySet}.

sampleQuery SampleQuery

Required. The [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] to create.

sampleQueryId string

Required. The ID to use for the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], which will become the final component of the [SampleQuery.name][google.cloud.discoveryengine.v1beta.SampleQuery.name].

If the caller does not have permission to create the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

This field must be unique among all [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s with the same [parent][google.cloud.discoveryengine.v1beta.CreateSampleQueryRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned.

This field must conform to RFC-1034 standard with a length limit of 63 characters. Otherwise, an INVALID_ARGUMENT error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SampleQuery

The RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = SampleQueryServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/sampleQuerySets/[SAMPLE_QUERY_SET]";
SampleQuery sampleQuery = new SampleQuery();
string sampleQueryId = "";
// Make the request
SampleQuery response = sampleQueryServiceClient.CreateSampleQuery(parent, sampleQuery, sampleQueryId);

CreateSampleQueryAsync(CreateSampleQueryRequest, CallSettings)

public virtual Task<SampleQuery> CreateSampleQueryAsync(CreateSampleQueryRequest request, CallSettings callSettings = null)

Creates a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]

Parameters
Name Description
request CreateSampleQueryRequest

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
TaskSampleQuery

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSampleQueryRequest request = new CreateSampleQueryRequest
{
    ParentAsSampleQuerySetName = SampleQuerySetName.FromProjectLocationSampleQuerySet("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]"),
    SampleQuery = new SampleQuery(),
    SampleQueryId = "",
};
// Make the request
SampleQuery response = await sampleQueryServiceClient.CreateSampleQueryAsync(request);

CreateSampleQueryAsync(CreateSampleQueryRequest, CancellationToken)

public virtual Task<SampleQuery> CreateSampleQueryAsync(CreateSampleQueryRequest request, CancellationToken cancellationToken)

Creates a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]

Parameters
Name Description
request CreateSampleQueryRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSampleQuery

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSampleQueryRequest request = new CreateSampleQueryRequest
{
    ParentAsSampleQuerySetName = SampleQuerySetName.FromProjectLocationSampleQuerySet("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]"),
    SampleQuery = new SampleQuery(),
    SampleQueryId = "",
};
// Make the request
SampleQuery response = await sampleQueryServiceClient.CreateSampleQueryAsync(request);

CreateSampleQueryAsync(SampleQuerySetName, SampleQuery, string, CallSettings)

public virtual Task<SampleQuery> CreateSampleQueryAsync(SampleQuerySetName parent, SampleQuery sampleQuery, string sampleQueryId, CallSettings callSettings = null)

Creates a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]

Parameters
Name Description
parent SampleQuerySetName

Required. The parent resource name, such as projects/{project}/locations/{location}/sampleQuerySets/{sampleQuerySet}.

sampleQuery SampleQuery

Required. The [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] to create.

sampleQueryId string

Required. The ID to use for the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], which will become the final component of the [SampleQuery.name][google.cloud.discoveryengine.v1beta.SampleQuery.name].

If the caller does not have permission to create the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

This field must be unique among all [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s with the same [parent][google.cloud.discoveryengine.v1beta.CreateSampleQueryRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned.

This field must conform to RFC-1034 standard with a length limit of 63 characters. Otherwise, an INVALID_ARGUMENT error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSampleQuery

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
SampleQuerySetName parent = SampleQuerySetName.FromProjectLocationSampleQuerySet("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]");
SampleQuery sampleQuery = new SampleQuery();
string sampleQueryId = "";
// Make the request
SampleQuery response = await sampleQueryServiceClient.CreateSampleQueryAsync(parent, sampleQuery, sampleQueryId);

CreateSampleQueryAsync(SampleQuerySetName, SampleQuery, string, CancellationToken)

public virtual Task<SampleQuery> CreateSampleQueryAsync(SampleQuerySetName parent, SampleQuery sampleQuery, string sampleQueryId, CancellationToken cancellationToken)

Creates a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]

Parameters
Name Description
parent SampleQuerySetName

Required. The parent resource name, such as projects/{project}/locations/{location}/sampleQuerySets/{sampleQuerySet}.

sampleQuery SampleQuery

Required. The [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] to create.

sampleQueryId string

Required. The ID to use for the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], which will become the final component of the [SampleQuery.name][google.cloud.discoveryengine.v1beta.SampleQuery.name].

If the caller does not have permission to create the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

This field must be unique among all [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s with the same [parent][google.cloud.discoveryengine.v1beta.CreateSampleQueryRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned.

This field must conform to RFC-1034 standard with a length limit of 63 characters. Otherwise, an INVALID_ARGUMENT error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSampleQuery

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
SampleQuerySetName parent = SampleQuerySetName.FromProjectLocationSampleQuerySet("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]");
SampleQuery sampleQuery = new SampleQuery();
string sampleQueryId = "";
// Make the request
SampleQuery response = await sampleQueryServiceClient.CreateSampleQueryAsync(parent, sampleQuery, sampleQueryId);

CreateSampleQueryAsync(string, SampleQuery, string, CallSettings)

public virtual Task<SampleQuery> CreateSampleQueryAsync(string parent, SampleQuery sampleQuery, string sampleQueryId, CallSettings callSettings = null)

Creates a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]

Parameters
Name Description
parent string

Required. The parent resource name, such as projects/{project}/locations/{location}/sampleQuerySets/{sampleQuerySet}.

sampleQuery SampleQuery

Required. The [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] to create.

sampleQueryId string

Required. The ID to use for the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], which will become the final component of the [SampleQuery.name][google.cloud.discoveryengine.v1beta.SampleQuery.name].

If the caller does not have permission to create the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

This field must be unique among all [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s with the same [parent][google.cloud.discoveryengine.v1beta.CreateSampleQueryRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned.

This field must conform to RFC-1034 standard with a length limit of 63 characters. Otherwise, an INVALID_ARGUMENT error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSampleQuery

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/sampleQuerySets/[SAMPLE_QUERY_SET]";
SampleQuery sampleQuery = new SampleQuery();
string sampleQueryId = "";
// Make the request
SampleQuery response = await sampleQueryServiceClient.CreateSampleQueryAsync(parent, sampleQuery, sampleQueryId);

CreateSampleQueryAsync(string, SampleQuery, string, CancellationToken)

public virtual Task<SampleQuery> CreateSampleQueryAsync(string parent, SampleQuery sampleQuery, string sampleQueryId, CancellationToken cancellationToken)

Creates a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]

Parameters
Name Description
parent string

Required. The parent resource name, such as projects/{project}/locations/{location}/sampleQuerySets/{sampleQuerySet}.

sampleQuery SampleQuery

Required. The [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] to create.

sampleQueryId string

Required. The ID to use for the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], which will become the final component of the [SampleQuery.name][google.cloud.discoveryengine.v1beta.SampleQuery.name].

If the caller does not have permission to create the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

This field must be unique among all [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s with the same [parent][google.cloud.discoveryengine.v1beta.CreateSampleQueryRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned.

This field must conform to RFC-1034 standard with a length limit of 63 characters. Otherwise, an INVALID_ARGUMENT error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSampleQuery

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/sampleQuerySets/[SAMPLE_QUERY_SET]";
SampleQuery sampleQuery = new SampleQuery();
string sampleQueryId = "";
// Make the request
SampleQuery response = await sampleQueryServiceClient.CreateSampleQueryAsync(parent, sampleQuery, sampleQueryId);

DeleteSampleQuery(DeleteSampleQueryRequest, CallSettings)

public virtual void DeleteSampleQuery(DeleteSampleQueryRequest request, CallSettings callSettings = null)

Deletes a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
request DeleteSampleQueryRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = SampleQueryServiceClient.Create();
// Initialize request argument(s)
DeleteSampleQueryRequest request = new DeleteSampleQueryRequest
{
    SampleQueryName = SampleQueryName.FromProjectLocationSampleQuerySetSampleQuery("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]", "[SAMPLE_QUERY]"),
};
// Make the request
sampleQueryServiceClient.DeleteSampleQuery(request);

DeleteSampleQuery(SampleQueryName, CallSettings)

public virtual void DeleteSampleQuery(SampleQueryName name, CallSettings callSettings = null)

Deletes a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
name SampleQueryName

Required. Full resource name of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], such as projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}.

If the caller does not have permission to delete the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] to delete does not exist, a NOT_FOUND error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = SampleQueryServiceClient.Create();
// Initialize request argument(s)
SampleQueryName name = SampleQueryName.FromProjectLocationSampleQuerySetSampleQuery("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]", "[SAMPLE_QUERY]");
// Make the request
sampleQueryServiceClient.DeleteSampleQuery(name);

DeleteSampleQuery(string, CallSettings)

public virtual void DeleteSampleQuery(string name, CallSettings callSettings = null)

Deletes a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
name string

Required. Full resource name of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], such as projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}.

If the caller does not have permission to delete the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] to delete does not exist, a NOT_FOUND error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = SampleQueryServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sampleQuerySets/[SAMPLE_QUERY_SET]/sampleQueries/[SAMPLE_QUERY]";
// Make the request
sampleQueryServiceClient.DeleteSampleQuery(name);

DeleteSampleQueryAsync(DeleteSampleQueryRequest, CallSettings)

public virtual Task DeleteSampleQueryAsync(DeleteSampleQueryRequest request, CallSettings callSettings = null)

Deletes a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
request DeleteSampleQueryRequest

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
Task

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSampleQueryRequest request = new DeleteSampleQueryRequest
{
    SampleQueryName = SampleQueryName.FromProjectLocationSampleQuerySetSampleQuery("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]", "[SAMPLE_QUERY]"),
};
// Make the request
await sampleQueryServiceClient.DeleteSampleQueryAsync(request);

DeleteSampleQueryAsync(DeleteSampleQueryRequest, CancellationToken)

public virtual Task DeleteSampleQueryAsync(DeleteSampleQueryRequest request, CancellationToken cancellationToken)

Deletes a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
request DeleteSampleQueryRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSampleQueryRequest request = new DeleteSampleQueryRequest
{
    SampleQueryName = SampleQueryName.FromProjectLocationSampleQuerySetSampleQuery("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]", "[SAMPLE_QUERY]"),
};
// Make the request
await sampleQueryServiceClient.DeleteSampleQueryAsync(request);

DeleteSampleQueryAsync(SampleQueryName, CallSettings)

public virtual Task DeleteSampleQueryAsync(SampleQueryName name, CallSettings callSettings = null)

Deletes a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
name SampleQueryName

Required. Full resource name of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], such as projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}.

If the caller does not have permission to delete the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] to delete does not exist, a NOT_FOUND error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
SampleQueryName name = SampleQueryName.FromProjectLocationSampleQuerySetSampleQuery("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]", "[SAMPLE_QUERY]");
// Make the request
await sampleQueryServiceClient.DeleteSampleQueryAsync(name);

DeleteSampleQueryAsync(SampleQueryName, CancellationToken)

public virtual Task DeleteSampleQueryAsync(SampleQueryName name, CancellationToken cancellationToken)

Deletes a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
name SampleQueryName

Required. Full resource name of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], such as projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}.

If the caller does not have permission to delete the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] to delete does not exist, a NOT_FOUND error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
SampleQueryName name = SampleQueryName.FromProjectLocationSampleQuerySetSampleQuery("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]", "[SAMPLE_QUERY]");
// Make the request
await sampleQueryServiceClient.DeleteSampleQueryAsync(name);

DeleteSampleQueryAsync(string, CallSettings)

public virtual Task DeleteSampleQueryAsync(string name, CallSettings callSettings = null)

Deletes a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
name string

Required. Full resource name of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], such as projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}.

If the caller does not have permission to delete the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] to delete does not exist, a NOT_FOUND error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sampleQuerySets/[SAMPLE_QUERY_SET]/sampleQueries/[SAMPLE_QUERY]";
// Make the request
await sampleQueryServiceClient.DeleteSampleQueryAsync(name);

DeleteSampleQueryAsync(string, CancellationToken)

public virtual Task DeleteSampleQueryAsync(string name, CancellationToken cancellationToken)

Deletes a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
name string

Required. Full resource name of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], such as projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}.

If the caller does not have permission to delete the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] to delete does not exist, a NOT_FOUND error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sampleQuerySets/[SAMPLE_QUERY_SET]/sampleQueries/[SAMPLE_QUERY]";
// Make the request
await sampleQueryServiceClient.DeleteSampleQueryAsync(name);

GetSampleQuery(GetSampleQueryRequest, CallSettings)

public virtual SampleQuery GetSampleQuery(GetSampleQueryRequest request, CallSettings callSettings = null)

Gets a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
request GetSampleQueryRequest

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
SampleQuery

The RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = SampleQueryServiceClient.Create();
// Initialize request argument(s)
GetSampleQueryRequest request = new GetSampleQueryRequest
{
    SampleQueryName = SampleQueryName.FromProjectLocationSampleQuerySetSampleQuery("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]", "[SAMPLE_QUERY]"),
};
// Make the request
SampleQuery response = sampleQueryServiceClient.GetSampleQuery(request);

GetSampleQuery(SampleQueryName, CallSettings)

public virtual SampleQuery GetSampleQuery(SampleQueryName name, CallSettings callSettings = null)

Gets a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
name SampleQueryName

Required. Full resource name of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], such as projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}.

If the caller does not have permission to access the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the requested [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] does not exist, a NOT_FOUND error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SampleQuery

The RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = SampleQueryServiceClient.Create();
// Initialize request argument(s)
SampleQueryName name = SampleQueryName.FromProjectLocationSampleQuerySetSampleQuery("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]", "[SAMPLE_QUERY]");
// Make the request
SampleQuery response = sampleQueryServiceClient.GetSampleQuery(name);

GetSampleQuery(string, CallSettings)

public virtual SampleQuery GetSampleQuery(string name, CallSettings callSettings = null)

Gets a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
name string

Required. Full resource name of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], such as projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}.

If the caller does not have permission to access the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the requested [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] does not exist, a NOT_FOUND error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SampleQuery

The RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = SampleQueryServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sampleQuerySets/[SAMPLE_QUERY_SET]/sampleQueries/[SAMPLE_QUERY]";
// Make the request
SampleQuery response = sampleQueryServiceClient.GetSampleQuery(name);

GetSampleQueryAsync(GetSampleQueryRequest, CallSettings)

public virtual Task<SampleQuery> GetSampleQueryAsync(GetSampleQueryRequest request, CallSettings callSettings = null)

Gets a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
request GetSampleQueryRequest

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
TaskSampleQuery

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
GetSampleQueryRequest request = new GetSampleQueryRequest
{
    SampleQueryName = SampleQueryName.FromProjectLocationSampleQuerySetSampleQuery("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]", "[SAMPLE_QUERY]"),
};
// Make the request
SampleQuery response = await sampleQueryServiceClient.GetSampleQueryAsync(request);

GetSampleQueryAsync(GetSampleQueryRequest, CancellationToken)

public virtual Task<SampleQuery> GetSampleQueryAsync(GetSampleQueryRequest request, CancellationToken cancellationToken)

Gets a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
request GetSampleQueryRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSampleQuery

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
GetSampleQueryRequest request = new GetSampleQueryRequest
{
    SampleQueryName = SampleQueryName.FromProjectLocationSampleQuerySetSampleQuery("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]", "[SAMPLE_QUERY]"),
};
// Make the request
SampleQuery response = await sampleQueryServiceClient.GetSampleQueryAsync(request);

GetSampleQueryAsync(SampleQueryName, CallSettings)

public virtual Task<SampleQuery> GetSampleQueryAsync(SampleQueryName name, CallSettings callSettings = null)

Gets a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
name SampleQueryName

Required. Full resource name of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], such as projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}.

If the caller does not have permission to access the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the requested [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] does not exist, a NOT_FOUND error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSampleQuery

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
SampleQueryName name = SampleQueryName.FromProjectLocationSampleQuerySetSampleQuery("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]", "[SAMPLE_QUERY]");
// Make the request
SampleQuery response = await sampleQueryServiceClient.GetSampleQueryAsync(name);

GetSampleQueryAsync(SampleQueryName, CancellationToken)

public virtual Task<SampleQuery> GetSampleQueryAsync(SampleQueryName name, CancellationToken cancellationToken)

Gets a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
name SampleQueryName

Required. Full resource name of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], such as projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}.

If the caller does not have permission to access the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the requested [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] does not exist, a NOT_FOUND error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSampleQuery

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
SampleQueryName name = SampleQueryName.FromProjectLocationSampleQuerySetSampleQuery("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]", "[SAMPLE_QUERY]");
// Make the request
SampleQuery response = await sampleQueryServiceClient.GetSampleQueryAsync(name);

GetSampleQueryAsync(string, CallSettings)

public virtual Task<SampleQuery> GetSampleQueryAsync(string name, CallSettings callSettings = null)

Gets a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
name string

Required. Full resource name of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], such as projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}.

If the caller does not have permission to access the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the requested [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] does not exist, a NOT_FOUND error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSampleQuery

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sampleQuerySets/[SAMPLE_QUERY_SET]/sampleQueries/[SAMPLE_QUERY]";
// Make the request
SampleQuery response = await sampleQueryServiceClient.GetSampleQueryAsync(name);

GetSampleQueryAsync(string, CancellationToken)

public virtual Task<SampleQuery> GetSampleQueryAsync(string name, CancellationToken cancellationToken)

Gets a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
name string

Required. Full resource name of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], such as projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}.

If the caller does not have permission to access the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the requested [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] does not exist, a NOT_FOUND error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSampleQuery

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sampleQuerySets/[SAMPLE_QUERY_SET]/sampleQueries/[SAMPLE_QUERY]";
// Make the request
SampleQuery response = await sampleQueryServiceClient.GetSampleQueryAsync(name);

ImportSampleQueries(ImportSampleQueriesRequest, CallSettings)

public virtual Operation<ImportSampleQueriesResponse, ImportSampleQueriesMetadata> ImportSampleQueries(ImportSampleQueriesRequest request, CallSettings callSettings = null)

Bulk import of multiple [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s. Sample queries that already exist may be deleted.

Note: It is possible for a subset of the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s to be successfully imported.

Parameters
Name Description
request ImportSampleQueriesRequest

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
OperationImportSampleQueriesResponseImportSampleQueriesMetadata

The RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = SampleQueryServiceClient.Create();
// Initialize request argument(s)
ImportSampleQueriesRequest request = new ImportSampleQueriesRequest
{
    ParentAsSampleQuerySetName = SampleQuerySetName.FromProjectLocationSampleQuerySet("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]"),
    InlineSource = new ImportSampleQueriesRequest.Types.InlineSource(),
    ErrorConfig = new ImportErrorConfig(),
};
// Make the request
Operation<ImportSampleQueriesResponse, ImportSampleQueriesMetadata> response = sampleQueryServiceClient.ImportSampleQueries(request);

// Poll until the returned long-running operation is complete
Operation<ImportSampleQueriesResponse, ImportSampleQueriesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
ImportSampleQueriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ImportSampleQueriesResponse, ImportSampleQueriesMetadata> retrievedResponse = sampleQueryServiceClient.PollOnceImportSampleQueries(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ImportSampleQueriesResponse retrievedResult = retrievedResponse.Result;
}

ImportSampleQueriesAsync(ImportSampleQueriesRequest, CallSettings)

public virtual Task<Operation<ImportSampleQueriesResponse, ImportSampleQueriesMetadata>> ImportSampleQueriesAsync(ImportSampleQueriesRequest request, CallSettings callSettings = null)

Bulk import of multiple [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s. Sample queries that already exist may be deleted.

Note: It is possible for a subset of the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s to be successfully imported.

Parameters
Name Description
request ImportSampleQueriesRequest

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
TaskOperationImportSampleQueriesResponseImportSampleQueriesMetadata

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
ImportSampleQueriesRequest request = new ImportSampleQueriesRequest
{
    ParentAsSampleQuerySetName = SampleQuerySetName.FromProjectLocationSampleQuerySet("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]"),
    InlineSource = new ImportSampleQueriesRequest.Types.InlineSource(),
    ErrorConfig = new ImportErrorConfig(),
};
// Make the request
Operation<ImportSampleQueriesResponse, ImportSampleQueriesMetadata> response = await sampleQueryServiceClient.ImportSampleQueriesAsync(request);

// Poll until the returned long-running operation is complete
Operation<ImportSampleQueriesResponse, ImportSampleQueriesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ImportSampleQueriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ImportSampleQueriesResponse, ImportSampleQueriesMetadata> retrievedResponse = await sampleQueryServiceClient.PollOnceImportSampleQueriesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ImportSampleQueriesResponse retrievedResult = retrievedResponse.Result;
}

ImportSampleQueriesAsync(ImportSampleQueriesRequest, CancellationToken)

public virtual Task<Operation<ImportSampleQueriesResponse, ImportSampleQueriesMetadata>> ImportSampleQueriesAsync(ImportSampleQueriesRequest request, CancellationToken cancellationToken)

Bulk import of multiple [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s. Sample queries that already exist may be deleted.

Note: It is possible for a subset of the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s to be successfully imported.

Parameters
Name Description
request ImportSampleQueriesRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationImportSampleQueriesResponseImportSampleQueriesMetadata

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
ImportSampleQueriesRequest request = new ImportSampleQueriesRequest
{
    ParentAsSampleQuerySetName = SampleQuerySetName.FromProjectLocationSampleQuerySet("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]"),
    InlineSource = new ImportSampleQueriesRequest.Types.InlineSource(),
    ErrorConfig = new ImportErrorConfig(),
};
// Make the request
Operation<ImportSampleQueriesResponse, ImportSampleQueriesMetadata> response = await sampleQueryServiceClient.ImportSampleQueriesAsync(request);

// Poll until the returned long-running operation is complete
Operation<ImportSampleQueriesResponse, ImportSampleQueriesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ImportSampleQueriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ImportSampleQueriesResponse, ImportSampleQueriesMetadata> retrievedResponse = await sampleQueryServiceClient.PollOnceImportSampleQueriesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ImportSampleQueriesResponse retrievedResult = retrievedResponse.Result;
}

ListSampleQueries(ListSampleQueriesRequest, CallSettings)

public virtual PagedEnumerable<ListSampleQueriesResponse, SampleQuery> ListSampleQueries(ListSampleQueriesRequest request, CallSettings callSettings = null)

Gets a list of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s.

Parameters
Name Description
request ListSampleQueriesRequest

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
PagedEnumerableListSampleQueriesResponseSampleQuery

A pageable sequence of SampleQuery resources.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = SampleQueryServiceClient.Create();
// Initialize request argument(s)
ListSampleQueriesRequest request = new ListSampleQueriesRequest
{
    ParentAsSampleQuerySetName = SampleQuerySetName.FromProjectLocationSampleQuerySet("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]"),
};
// Make the request
PagedEnumerable<ListSampleQueriesResponse, SampleQuery> response = sampleQueryServiceClient.ListSampleQueries(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (SampleQuery item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSampleQueriesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SampleQuery item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SampleQuery> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SampleQuery item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSampleQueries(SampleQuerySetName, string, int?, CallSettings)

public virtual PagedEnumerable<ListSampleQueriesResponse, SampleQuery> ListSampleQueries(SampleQuerySetName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Gets a list of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s.

Parameters
Name Description
parent SampleQuerySetName

Required. The parent sample query set resource name, such as projects/{project}/locations/{location}/sampleQuerySets/{sampleQuerySet}.

If the caller does not have permission to list [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s under this sample query set, regardless of whether or not this sample query set exists, a PERMISSION_DENIED error is returned.

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListSampleQueriesResponseSampleQuery

A pageable sequence of SampleQuery resources.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = SampleQueryServiceClient.Create();
// Initialize request argument(s)
SampleQuerySetName parent = SampleQuerySetName.FromProjectLocationSampleQuerySet("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]");
// Make the request
PagedEnumerable<ListSampleQueriesResponse, SampleQuery> response = sampleQueryServiceClient.ListSampleQueries(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (SampleQuery item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSampleQueriesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SampleQuery item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SampleQuery> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SampleQuery item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSampleQueries(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListSampleQueriesResponse, SampleQuery> ListSampleQueries(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Gets a list of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s.

Parameters
Name Description
parent string

Required. The parent sample query set resource name, such as projects/{project}/locations/{location}/sampleQuerySets/{sampleQuerySet}.

If the caller does not have permission to list [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s under this sample query set, regardless of whether or not this sample query set exists, a PERMISSION_DENIED error is returned.

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListSampleQueriesResponseSampleQuery

A pageable sequence of SampleQuery resources.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = SampleQueryServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/sampleQuerySets/[SAMPLE_QUERY_SET]";
// Make the request
PagedEnumerable<ListSampleQueriesResponse, SampleQuery> response = sampleQueryServiceClient.ListSampleQueries(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (SampleQuery item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSampleQueriesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SampleQuery item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SampleQuery> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SampleQuery item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSampleQueriesAsync(ListSampleQueriesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListSampleQueriesResponse, SampleQuery> ListSampleQueriesAsync(ListSampleQueriesRequest request, CallSettings callSettings = null)

Gets a list of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s.

Parameters
Name Description
request ListSampleQueriesRequest

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
PagedAsyncEnumerableListSampleQueriesResponseSampleQuery

A pageable asynchronous sequence of SampleQuery resources.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
ListSampleQueriesRequest request = new ListSampleQueriesRequest
{
    ParentAsSampleQuerySetName = SampleQuerySetName.FromProjectLocationSampleQuerySet("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]"),
};
// Make the request
PagedAsyncEnumerable<ListSampleQueriesResponse, SampleQuery> response = sampleQueryServiceClient.ListSampleQueriesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((SampleQuery item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSampleQueriesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SampleQuery item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SampleQuery> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SampleQuery item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSampleQueriesAsync(SampleQuerySetName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListSampleQueriesResponse, SampleQuery> ListSampleQueriesAsync(SampleQuerySetName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Gets a list of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s.

Parameters
Name Description
parent SampleQuerySetName

Required. The parent sample query set resource name, such as projects/{project}/locations/{location}/sampleQuerySets/{sampleQuerySet}.

If the caller does not have permission to list [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s under this sample query set, regardless of whether or not this sample query set exists, a PERMISSION_DENIED error is returned.

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListSampleQueriesResponseSampleQuery

A pageable asynchronous sequence of SampleQuery resources.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
SampleQuerySetName parent = SampleQuerySetName.FromProjectLocationSampleQuerySet("[PROJECT]", "[LOCATION]", "[SAMPLE_QUERY_SET]");
// Make the request
PagedAsyncEnumerable<ListSampleQueriesResponse, SampleQuery> response = sampleQueryServiceClient.ListSampleQueriesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((SampleQuery item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSampleQueriesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SampleQuery item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SampleQuery> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SampleQuery item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSampleQueriesAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListSampleQueriesResponse, SampleQuery> ListSampleQueriesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Gets a list of [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s.

Parameters
Name Description
parent string

Required. The parent sample query set resource name, such as projects/{project}/locations/{location}/sampleQuerySets/{sampleQuerySet}.

If the caller does not have permission to list [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s under this sample query set, regardless of whether or not this sample query set exists, a PERMISSION_DENIED error is returned.

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListSampleQueriesResponseSampleQuery

A pageable asynchronous sequence of SampleQuery resources.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/sampleQuerySets/[SAMPLE_QUERY_SET]";
// Make the request
PagedAsyncEnumerable<ListSampleQueriesResponse, SampleQuery> response = sampleQueryServiceClient.ListSampleQueriesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((SampleQuery item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSampleQueriesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SampleQuery item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SampleQuery> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SampleQuery item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

PollOnceImportSampleQueries(string, CallSettings)

public virtual Operation<ImportSampleQueriesResponse, ImportSampleQueriesMetadata> PollOnceImportSampleQueries(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of ImportSampleQueries .

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationImportSampleQueriesResponseImportSampleQueriesMetadata

The result of polling the operation.

PollOnceImportSampleQueriesAsync(string, CallSettings)

public virtual Task<Operation<ImportSampleQueriesResponse, ImportSampleQueriesMetadata>> PollOnceImportSampleQueriesAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of ImportSampleQueries.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationImportSampleQueriesResponseImportSampleQueriesMetadata

A task representing the result of polling the operation.

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.

UpdateSampleQuery(SampleQuery, FieldMask, CallSettings)

public virtual SampleQuery UpdateSampleQuery(SampleQuery sampleQuery, FieldMask updateMask, CallSettings callSettings = null)

Updates a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
sampleQuery SampleQuery

Required. The simple query to update.

If the caller does not have permission to update the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] to update does not exist a NOT_FOUND error is returned.

updateMask FieldMask

Indicates which fields in the provided imported 'simple query' to update. If not set, will by default update all fields.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SampleQuery

The RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = SampleQueryServiceClient.Create();
// Initialize request argument(s)
SampleQuery sampleQuery = new SampleQuery();
FieldMask updateMask = new FieldMask();
// Make the request
SampleQuery response = sampleQueryServiceClient.UpdateSampleQuery(sampleQuery, updateMask);

UpdateSampleQuery(UpdateSampleQueryRequest, CallSettings)

public virtual SampleQuery UpdateSampleQuery(UpdateSampleQueryRequest request, CallSettings callSettings = null)

Updates a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
request UpdateSampleQueryRequest

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
SampleQuery

The RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = SampleQueryServiceClient.Create();
// Initialize request argument(s)
UpdateSampleQueryRequest request = new UpdateSampleQueryRequest
{
    SampleQuery = new SampleQuery(),
    UpdateMask = new FieldMask(),
};
// Make the request
SampleQuery response = sampleQueryServiceClient.UpdateSampleQuery(request);

UpdateSampleQueryAsync(SampleQuery, FieldMask, CallSettings)

public virtual Task<SampleQuery> UpdateSampleQueryAsync(SampleQuery sampleQuery, FieldMask updateMask, CallSettings callSettings = null)

Updates a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
sampleQuery SampleQuery

Required. The simple query to update.

If the caller does not have permission to update the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] to update does not exist a NOT_FOUND error is returned.

updateMask FieldMask

Indicates which fields in the provided imported 'simple query' to update. If not set, will by default update all fields.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSampleQuery

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
SampleQuery sampleQuery = new SampleQuery();
FieldMask updateMask = new FieldMask();
// Make the request
SampleQuery response = await sampleQueryServiceClient.UpdateSampleQueryAsync(sampleQuery, updateMask);

UpdateSampleQueryAsync(SampleQuery, FieldMask, CancellationToken)

public virtual Task<SampleQuery> UpdateSampleQueryAsync(SampleQuery sampleQuery, FieldMask updateMask, CancellationToken cancellationToken)

Updates a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
sampleQuery SampleQuery

Required. The simple query to update.

If the caller does not have permission to update the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery] to update does not exist a NOT_FOUND error is returned.

updateMask FieldMask

Indicates which fields in the provided imported 'simple query' to update. If not set, will by default update all fields.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSampleQuery

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
SampleQuery sampleQuery = new SampleQuery();
FieldMask updateMask = new FieldMask();
// Make the request
SampleQuery response = await sampleQueryServiceClient.UpdateSampleQueryAsync(sampleQuery, updateMask);

UpdateSampleQueryAsync(UpdateSampleQueryRequest, CallSettings)

public virtual Task<SampleQuery> UpdateSampleQueryAsync(UpdateSampleQueryRequest request, CallSettings callSettings = null)

Updates a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
request UpdateSampleQueryRequest

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
TaskSampleQuery

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSampleQueryRequest request = new UpdateSampleQueryRequest
{
    SampleQuery = new SampleQuery(),
    UpdateMask = new FieldMask(),
};
// Make the request
SampleQuery response = await sampleQueryServiceClient.UpdateSampleQueryAsync(request);

UpdateSampleQueryAsync(UpdateSampleQueryRequest, CancellationToken)

public virtual Task<SampleQuery> UpdateSampleQueryAsync(UpdateSampleQueryRequest request, CancellationToken cancellationToken)

Updates a [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery].

Parameters
Name Description
request UpdateSampleQueryRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSampleQuery

A Task containing the RPC response.

Example
// Create client
SampleQueryServiceClient sampleQueryServiceClient = await SampleQueryServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSampleQueryRequest request = new UpdateSampleQueryRequest
{
    SampleQuery = new SampleQuery(),
    UpdateMask = new FieldMask(),
};
// Make the request
SampleQuery response = await sampleQueryServiceClient.UpdateSampleQueryAsync(request);