Discovery Engine v1 API - Class CollectionServiceClient (1.17.0)

public abstract class CollectionServiceClient

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

CollectionService client wrapper, for convenient use.

Inheritance

object > CollectionServiceClient

Namespace

Google.Cloud.DiscoveryEngine.V1

Assembly

Google.Cloud.DiscoveryEngine.V1.dll

Remarks

Service for managing [Collection][google.cloud.discoveryengine.v1.Collection]s.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
IReadOnlyListstring
Remarks

DeleteCollectionOperationsClient

public virtual OperationsClient DeleteCollectionOperationsClient { get; }

The long-running operations client for DeleteCollection.

Property Value
Type Description
OperationsClient

GrpcClient

public virtual CollectionService.CollectionServiceClient GrpcClient { get; }

The underlying gRPC CollectionService client

Property Value
Type Description
CollectionServiceCollectionServiceClient

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

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

Returns
Type Description
CollectionServiceClient

The created CollectionServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskCollectionServiceClient

The task representing the created CollectionServiceClient.

DeleteCollection(CollectionName, CallSettings)

public virtual Operation<Empty, DeleteCollectionMetadata> DeleteCollection(CollectionName name, CallSettings callSettings = null)

Deletes a [Collection][google.cloud.discoveryengine.v1.Collection].

Parameters
Name Description
name CollectionName

Required. The full resource name of the Collection, in the format of projects/{project}/locations/{location}/collections/{collection}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyDeleteCollectionMetadata

The RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = CollectionServiceClient.Create();
// Initialize request argument(s)
CollectionName name = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]");
// Make the request
Operation<Empty, DeleteCollectionMetadata> response = collectionServiceClient.DeleteCollection(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteCollectionMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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<Empty, DeleteCollectionMetadata> retrievedResponse = collectionServiceClient.PollOnceDeleteCollection(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteCollection(DeleteCollectionRequest, CallSettings)

public virtual Operation<Empty, DeleteCollectionMetadata> DeleteCollection(DeleteCollectionRequest request, CallSettings callSettings = null)

Deletes a [Collection][google.cloud.discoveryengine.v1.Collection].

Parameters
Name Description
request DeleteCollectionRequest

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
OperationEmptyDeleteCollectionMetadata

The RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = CollectionServiceClient.Create();
// Initialize request argument(s)
DeleteCollectionRequest request = new DeleteCollectionRequest
{
    CollectionName = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]"),
};
// Make the request
Operation<Empty, DeleteCollectionMetadata> response = collectionServiceClient.DeleteCollection(request);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteCollectionMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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<Empty, DeleteCollectionMetadata> retrievedResponse = collectionServiceClient.PollOnceDeleteCollection(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteCollection(string, CallSettings)

public virtual Operation<Empty, DeleteCollectionMetadata> DeleteCollection(string name, CallSettings callSettings = null)

Deletes a [Collection][google.cloud.discoveryengine.v1.Collection].

Parameters
Name Description
name string

Required. The full resource name of the Collection, in the format of projects/{project}/locations/{location}/collections/{collection}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyDeleteCollectionMetadata

The RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = CollectionServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]";
// Make the request
Operation<Empty, DeleteCollectionMetadata> response = collectionServiceClient.DeleteCollection(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteCollectionMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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<Empty, DeleteCollectionMetadata> retrievedResponse = collectionServiceClient.PollOnceDeleteCollection(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteCollectionAsync(CollectionName, CallSettings)

public virtual Task<Operation<Empty, DeleteCollectionMetadata>> DeleteCollectionAsync(CollectionName name, CallSettings callSettings = null)

Deletes a [Collection][google.cloud.discoveryengine.v1.Collection].

Parameters
Name Description
name CollectionName

Required. The full resource name of the Collection, in the format of projects/{project}/locations/{location}/collections/{collection}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyDeleteCollectionMetadata

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
CollectionName name = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]");
// Make the request
Operation<Empty, DeleteCollectionMetadata> response = await collectionServiceClient.DeleteCollectionAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteCollectionMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteCollectionMetadata> retrievedResponse = await collectionServiceClient.PollOnceDeleteCollectionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteCollectionAsync(CollectionName, CancellationToken)

public virtual Task<Operation<Empty, DeleteCollectionMetadata>> DeleteCollectionAsync(CollectionName name, CancellationToken cancellationToken)

Deletes a [Collection][google.cloud.discoveryengine.v1.Collection].

Parameters
Name Description
name CollectionName

Required. The full resource name of the Collection, in the format of projects/{project}/locations/{location}/collections/{collection}.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteCollectionMetadata

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
CollectionName name = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]");
// Make the request
Operation<Empty, DeleteCollectionMetadata> response = await collectionServiceClient.DeleteCollectionAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteCollectionMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteCollectionMetadata> retrievedResponse = await collectionServiceClient.PollOnceDeleteCollectionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteCollectionAsync(DeleteCollectionRequest, CallSettings)

public virtual Task<Operation<Empty, DeleteCollectionMetadata>> DeleteCollectionAsync(DeleteCollectionRequest request, CallSettings callSettings = null)

Deletes a [Collection][google.cloud.discoveryengine.v1.Collection].

Parameters
Name Description
request DeleteCollectionRequest

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
TaskOperationEmptyDeleteCollectionMetadata

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteCollectionRequest request = new DeleteCollectionRequest
{
    CollectionName = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]"),
};
// Make the request
Operation<Empty, DeleteCollectionMetadata> response = await collectionServiceClient.DeleteCollectionAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteCollectionMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteCollectionMetadata> retrievedResponse = await collectionServiceClient.PollOnceDeleteCollectionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteCollectionAsync(DeleteCollectionRequest, CancellationToken)

public virtual Task<Operation<Empty, DeleteCollectionMetadata>> DeleteCollectionAsync(DeleteCollectionRequest request, CancellationToken cancellationToken)

Deletes a [Collection][google.cloud.discoveryengine.v1.Collection].

Parameters
Name Description
request DeleteCollectionRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteCollectionMetadata

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteCollectionRequest request = new DeleteCollectionRequest
{
    CollectionName = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]"),
};
// Make the request
Operation<Empty, DeleteCollectionMetadata> response = await collectionServiceClient.DeleteCollectionAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteCollectionMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteCollectionMetadata> retrievedResponse = await collectionServiceClient.PollOnceDeleteCollectionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteCollectionAsync(string, CallSettings)

public virtual Task<Operation<Empty, DeleteCollectionMetadata>> DeleteCollectionAsync(string name, CallSettings callSettings = null)

Deletes a [Collection][google.cloud.discoveryengine.v1.Collection].

Parameters
Name Description
name string

Required. The full resource name of the Collection, in the format of projects/{project}/locations/{location}/collections/{collection}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyDeleteCollectionMetadata

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]";
// Make the request
Operation<Empty, DeleteCollectionMetadata> response = await collectionServiceClient.DeleteCollectionAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteCollectionMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteCollectionMetadata> retrievedResponse = await collectionServiceClient.PollOnceDeleteCollectionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteCollectionAsync(string, CancellationToken)

public virtual Task<Operation<Empty, DeleteCollectionMetadata>> DeleteCollectionAsync(string name, CancellationToken cancellationToken)

Deletes a [Collection][google.cloud.discoveryengine.v1.Collection].

Parameters
Name Description
name string

Required. The full resource name of the Collection, in the format of projects/{project}/locations/{location}/collections/{collection}.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteCollectionMetadata

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]";
// Make the request
Operation<Empty, DeleteCollectionMetadata> response = await collectionServiceClient.DeleteCollectionAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteCollectionMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, DeleteCollectionMetadata> retrievedResponse = await collectionServiceClient.PollOnceDeleteCollectionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

GetIamPolicy(IResourceName, CallSettings)

public virtual Policy GetIamPolicy(IResourceName resource, CallSettings callSettings = null)

Gets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist. An empty policy is returned if the resource exists but does not have a policy set on it.

Parameters
Name Description
resource IResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Policy

The RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = CollectionServiceClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = collectionServiceClient.GetIamPolicy(resource);

GetIamPolicy(GetIamPolicyRequest, CallSettings)

public virtual Policy GetIamPolicy(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist. An empty policy is returned if the resource exists but does not have a policy set on it.

Parameters
Name Description
request GetIamPolicyRequest

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
Policy

The RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = CollectionServiceClient.Create();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = collectionServiceClient.GetIamPolicy(request);

GetIamPolicy(string, CallSettings)

public virtual Policy GetIamPolicy(string resource, CallSettings callSettings = null)

Gets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist. An empty policy is returned if the resource exists but does not have a policy set on it.

Parameters
Name Description
resource string

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Policy

The RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = CollectionServiceClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = collectionServiceClient.GetIamPolicy(resource);

GetIamPolicyAsync(IResourceName, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CallSettings callSettings = null)

Gets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist. An empty policy is returned if the resource exists but does not have a policy set on it.

Parameters
Name Description
resource IResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await collectionServiceClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(IResourceName, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CancellationToken cancellationToken)

Gets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist. An empty policy is returned if the resource exists but does not have a policy set on it.

Parameters
Name Description
resource IResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await collectionServiceClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist. An empty policy is returned if the resource exists but does not have a policy set on it.

Parameters
Name Description
request GetIamPolicyRequest

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
TaskPolicy

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await collectionServiceClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(GetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CancellationToken cancellationToken)

Gets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist. An empty policy is returned if the resource exists but does not have a policy set on it.

Parameters
Name Description
request GetIamPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await collectionServiceClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(string, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(string resource, CallSettings callSettings = null)

Gets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist. An empty policy is returned if the resource exists but does not have a policy set on it.

Parameters
Name Description
resource string

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await collectionServiceClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(string, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(string resource, CancellationToken cancellationToken)

Gets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist. An empty policy is returned if the resource exists but does not have a policy set on it.

Parameters
Name Description
resource string

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await collectionServiceClient.GetIamPolicyAsync(resource);

PollOnceDeleteCollection(string, CallSettings)

public virtual Operation<Empty, DeleteCollectionMetadata> PollOnceDeleteCollection(string operationName, CallSettings callSettings = null)

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

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
OperationEmptyDeleteCollectionMetadata

The result of polling the operation.

PollOnceDeleteCollectionAsync(string, CallSettings)

public virtual Task<Operation<Empty, DeleteCollectionMetadata>> PollOnceDeleteCollectionAsync(string operationName, CallSettings callSettings = null)

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

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
TaskOperationEmptyDeleteCollectionMetadata

A task representing the result of polling the operation.

SetIamPolicy(IResourceName, Policy, CallSettings)

public virtual Policy SetIamPolicy(IResourceName resource, Policy policy, CallSettings callSettings = null)

Sets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist.

Important: When setting a policy directly on a Collection resource, the only recommended roles in the bindings are: roles/discoveryengine.admin roles/discoveryengine.agentspaceAdmin roles/discoveryengine.viewer roles/discoveryengine.agentspaceViewer roles/discoveryengine.user roles/discoveryengine.agentspaceUser Attempting to grant any other role will result in a warning in logging.

Parameters
Name Description
resource IResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policy Policy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Policy

The RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = CollectionServiceClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = collectionServiceClient.SetIamPolicy(resource, policy);

SetIamPolicy(SetIamPolicyRequest, CallSettings)

public virtual Policy SetIamPolicy(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist.

Important: When setting a policy directly on a Collection resource, the only recommended roles in the bindings are: roles/discoveryengine.admin roles/discoveryengine.agentspaceAdmin roles/discoveryengine.viewer roles/discoveryengine.agentspaceViewer roles/discoveryengine.user roles/discoveryengine.agentspaceUser Attempting to grant any other role will result in a warning in logging.

Parameters
Name Description
request SetIamPolicyRequest

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
Policy

The RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = CollectionServiceClient.Create();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = collectionServiceClient.SetIamPolicy(request);

SetIamPolicy(string, Policy, CallSettings)

public virtual Policy SetIamPolicy(string resource, Policy policy, CallSettings callSettings = null)

Sets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist.

Important: When setting a policy directly on a Collection resource, the only recommended roles in the bindings are: roles/discoveryengine.admin roles/discoveryengine.agentspaceAdmin roles/discoveryengine.viewer roles/discoveryengine.agentspaceViewer roles/discoveryengine.user roles/discoveryengine.agentspaceUser Attempting to grant any other role will result in a warning in logging.

Parameters
Name Description
resource string

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policy Policy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Policy

The RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = CollectionServiceClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = collectionServiceClient.SetIamPolicy(resource, policy);

SetIamPolicyAsync(IResourceName, Policy, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(IResourceName resource, Policy policy, CallSettings callSettings = null)

Sets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist.

Important: When setting a policy directly on a Collection resource, the only recommended roles in the bindings are: roles/discoveryengine.admin roles/discoveryengine.agentspaceAdmin roles/discoveryengine.viewer roles/discoveryengine.agentspaceViewer roles/discoveryengine.user roles/discoveryengine.agentspaceUser Attempting to grant any other role will result in a warning in logging.

Parameters
Name Description
resource IResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policy Policy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = await collectionServiceClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(IResourceName, Policy, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(IResourceName resource, Policy policy, CancellationToken cancellationToken)

Sets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist.

Important: When setting a policy directly on a Collection resource, the only recommended roles in the bindings are: roles/discoveryengine.admin roles/discoveryengine.agentspaceAdmin roles/discoveryengine.viewer roles/discoveryengine.agentspaceViewer roles/discoveryengine.user roles/discoveryengine.agentspaceUser Attempting to grant any other role will result in a warning in logging.

Parameters
Name Description
resource IResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policy Policy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = await collectionServiceClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(SetIamPolicyRequest, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist.

Important: When setting a policy directly on a Collection resource, the only recommended roles in the bindings are: roles/discoveryengine.admin roles/discoveryengine.agentspaceAdmin roles/discoveryengine.viewer roles/discoveryengine.agentspaceViewer roles/discoveryengine.user roles/discoveryengine.agentspaceUser Attempting to grant any other role will result in a warning in logging.

Parameters
Name Description
request SetIamPolicyRequest

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
TaskPolicy

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = await collectionServiceClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(SetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CancellationToken cancellationToken)

Sets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist.

Important: When setting a policy directly on a Collection resource, the only recommended roles in the bindings are: roles/discoveryengine.admin roles/discoveryengine.agentspaceAdmin roles/discoveryengine.viewer roles/discoveryengine.agentspaceViewer roles/discoveryengine.user roles/discoveryengine.agentspaceUser Attempting to grant any other role will result in a warning in logging.

Parameters
Name Description
request SetIamPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = await collectionServiceClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(string, Policy, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(string resource, Policy policy, CallSettings callSettings = null)

Sets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist.

Important: When setting a policy directly on a Collection resource, the only recommended roles in the bindings are: roles/discoveryengine.admin roles/discoveryengine.agentspaceAdmin roles/discoveryengine.viewer roles/discoveryengine.agentspaceViewer roles/discoveryengine.user roles/discoveryengine.agentspaceUser Attempting to grant any other role will result in a warning in logging.

Parameters
Name Description
resource string

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policy Policy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = await collectionServiceClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(string, Policy, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(string resource, Policy policy, CancellationToken cancellationToken)

Sets the IAM access control policy for a [Collection][google.cloud.discoveryengine.v1.Collection]. A NOT_FOUND error is returned if the resource does not exist.

Important: When setting a policy directly on a Collection resource, the only recommended roles in the bindings are: roles/discoveryengine.admin roles/discoveryengine.agentspaceAdmin roles/discoveryengine.viewer roles/discoveryengine.agentspaceViewer roles/discoveryengine.user roles/discoveryengine.agentspaceUser Attempting to grant any other role will result in a warning in logging.

Parameters
Name Description
resource string

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policy Policy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
CollectionServiceClient collectionServiceClient = await CollectionServiceClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = await collectionServiceClient.SetIamPolicyAsync(resource, policy);

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.