Discovery Engine v1 API - Class EngineServiceClient (1.4.0)

public abstract class EngineServiceClient

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

EngineService client wrapper, for convenient use.

Inheritance

object > EngineServiceClient

Derived Types

Namespace

Google.Cloud.DiscoveryEngine.V1

Assembly

Google.Cloud.DiscoveryEngine.V1.dll

Remarks

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

Properties

CreateEngineOperationsClient

public virtual OperationsClient CreateEngineOperationsClient { get; }

The long-running operations client for CreateEngine.

Property Value
Type Description
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
IReadOnlyListstring
Remarks

The default EngineService scopes are:

DeleteEngineOperationsClient

public virtual OperationsClient DeleteEngineOperationsClient { get; }

The long-running operations client for DeleteEngine.

Property Value
Type Description
OperationsClient

GrpcClient

public virtual EngineService.EngineServiceClient GrpcClient { get; }

The underlying gRPC EngineService client

Property Value
Type Description
EngineServiceEngineServiceClient

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

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

Returns
Type Description
EngineServiceClient

The created EngineServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskEngineServiceClient

The task representing the created EngineServiceClient.

CreateEngine(CollectionName, Engine, string, CallSettings)

public virtual Operation<Engine, CreateEngineMetadata> CreateEngine(CollectionName parent, Engine engine, string engineId, CallSettings callSettings = null)

Creates a [Engine][google.cloud.discoveryengine.v1.Engine].

Parameters
Name Description
parent CollectionName

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

engine Engine

Required. The [Engine][google.cloud.discoveryengine.v1.Engine] to create.

engineId string

Required. The ID to use for the [Engine][google.cloud.discoveryengine.v1.Engine], which will become the final component of the [Engine][google.cloud.discoveryengine.v1.Engine]'s resource name.

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
OperationEngineCreateEngineMetadata

The RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = EngineServiceClient.Create();
// Initialize request argument(s)
CollectionName parent = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]");
Engine engine = new Engine();
string engineId = "";
// Make the request
Operation<Engine, CreateEngineMetadata> response = engineServiceClient.CreateEngine(parent, engine, engineId);

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

CreateEngine(CreateEngineRequest, CallSettings)

public virtual Operation<Engine, CreateEngineMetadata> CreateEngine(CreateEngineRequest request, CallSettings callSettings = null)

Creates a [Engine][google.cloud.discoveryengine.v1.Engine].

Parameters
Name Description
request CreateEngineRequest

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
OperationEngineCreateEngineMetadata

The RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = EngineServiceClient.Create();
// Initialize request argument(s)
CreateEngineRequest request = new CreateEngineRequest
{
    ParentAsCollectionName = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]"),
    Engine = new Engine(),
    EngineId = "",
};
// Make the request
Operation<Engine, CreateEngineMetadata> response = engineServiceClient.CreateEngine(request);

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

CreateEngine(string, Engine, string, CallSettings)

public virtual Operation<Engine, CreateEngineMetadata> CreateEngine(string parent, Engine engine, string engineId, CallSettings callSettings = null)

Creates a [Engine][google.cloud.discoveryengine.v1.Engine].

Parameters
Name Description
parent string

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

engine Engine

Required. The [Engine][google.cloud.discoveryengine.v1.Engine] to create.

engineId string

Required. The ID to use for the [Engine][google.cloud.discoveryengine.v1.Engine], which will become the final component of the [Engine][google.cloud.discoveryengine.v1.Engine]'s resource name.

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
OperationEngineCreateEngineMetadata

The RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = EngineServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]";
Engine engine = new Engine();
string engineId = "";
// Make the request
Operation<Engine, CreateEngineMetadata> response = engineServiceClient.CreateEngine(parent, engine, engineId);

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

CreateEngineAsync(CollectionName, Engine, string, CallSettings)

public virtual Task<Operation<Engine, CreateEngineMetadata>> CreateEngineAsync(CollectionName parent, Engine engine, string engineId, CallSettings callSettings = null)

Creates a [Engine][google.cloud.discoveryengine.v1.Engine].

Parameters
Name Description
parent CollectionName

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

engine Engine

Required. The [Engine][google.cloud.discoveryengine.v1.Engine] to create.

engineId string

Required. The ID to use for the [Engine][google.cloud.discoveryengine.v1.Engine], which will become the final component of the [Engine][google.cloud.discoveryengine.v1.Engine]'s resource name.

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
TaskOperationEngineCreateEngineMetadata

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
CollectionName parent = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]");
Engine engine = new Engine();
string engineId = "";
// Make the request
Operation<Engine, CreateEngineMetadata> response = await engineServiceClient.CreateEngineAsync(parent, engine, engineId);

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

CreateEngineAsync(CollectionName, Engine, string, CancellationToken)

public virtual Task<Operation<Engine, CreateEngineMetadata>> CreateEngineAsync(CollectionName parent, Engine engine, string engineId, CancellationToken cancellationToken)

Creates a [Engine][google.cloud.discoveryengine.v1.Engine].

Parameters
Name Description
parent CollectionName

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

engine Engine

Required. The [Engine][google.cloud.discoveryengine.v1.Engine] to create.

engineId string

Required. The ID to use for the [Engine][google.cloud.discoveryengine.v1.Engine], which will become the final component of the [Engine][google.cloud.discoveryengine.v1.Engine]'s resource name.

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
TaskOperationEngineCreateEngineMetadata

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
CollectionName parent = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]");
Engine engine = new Engine();
string engineId = "";
// Make the request
Operation<Engine, CreateEngineMetadata> response = await engineServiceClient.CreateEngineAsync(parent, engine, engineId);

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

CreateEngineAsync(CreateEngineRequest, CallSettings)

public virtual Task<Operation<Engine, CreateEngineMetadata>> CreateEngineAsync(CreateEngineRequest request, CallSettings callSettings = null)

Creates a [Engine][google.cloud.discoveryengine.v1.Engine].

Parameters
Name Description
request CreateEngineRequest

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
TaskOperationEngineCreateEngineMetadata

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
CreateEngineRequest request = new CreateEngineRequest
{
    ParentAsCollectionName = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]"),
    Engine = new Engine(),
    EngineId = "",
};
// Make the request
Operation<Engine, CreateEngineMetadata> response = await engineServiceClient.CreateEngineAsync(request);

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

CreateEngineAsync(CreateEngineRequest, CancellationToken)

public virtual Task<Operation<Engine, CreateEngineMetadata>> CreateEngineAsync(CreateEngineRequest request, CancellationToken cancellationToken)

Creates a [Engine][google.cloud.discoveryengine.v1.Engine].

Parameters
Name Description
request CreateEngineRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEngineCreateEngineMetadata

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
CreateEngineRequest request = new CreateEngineRequest
{
    ParentAsCollectionName = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]"),
    Engine = new Engine(),
    EngineId = "",
};
// Make the request
Operation<Engine, CreateEngineMetadata> response = await engineServiceClient.CreateEngineAsync(request);

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

CreateEngineAsync(string, Engine, string, CallSettings)

public virtual Task<Operation<Engine, CreateEngineMetadata>> CreateEngineAsync(string parent, Engine engine, string engineId, CallSettings callSettings = null)

Creates a [Engine][google.cloud.discoveryengine.v1.Engine].

Parameters
Name Description
parent string

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

engine Engine

Required. The [Engine][google.cloud.discoveryengine.v1.Engine] to create.

engineId string

Required. The ID to use for the [Engine][google.cloud.discoveryengine.v1.Engine], which will become the final component of the [Engine][google.cloud.discoveryengine.v1.Engine]'s resource name.

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
TaskOperationEngineCreateEngineMetadata

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]";
Engine engine = new Engine();
string engineId = "";
// Make the request
Operation<Engine, CreateEngineMetadata> response = await engineServiceClient.CreateEngineAsync(parent, engine, engineId);

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

CreateEngineAsync(string, Engine, string, CancellationToken)

public virtual Task<Operation<Engine, CreateEngineMetadata>> CreateEngineAsync(string parent, Engine engine, string engineId, CancellationToken cancellationToken)

Creates a [Engine][google.cloud.discoveryengine.v1.Engine].

Parameters
Name Description
parent string

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

engine Engine

Required. The [Engine][google.cloud.discoveryengine.v1.Engine] to create.

engineId string

Required. The ID to use for the [Engine][google.cloud.discoveryengine.v1.Engine], which will become the final component of the [Engine][google.cloud.discoveryengine.v1.Engine]'s resource name.

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
TaskOperationEngineCreateEngineMetadata

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]";
Engine engine = new Engine();
string engineId = "";
// Make the request
Operation<Engine, CreateEngineMetadata> response = await engineServiceClient.CreateEngineAsync(parent, engine, engineId);

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

DeleteEngine(DeleteEngineRequest, CallSettings)

public virtual Operation<Empty, DeleteEngineMetadata> DeleteEngine(DeleteEngineRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request DeleteEngineRequest

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
OperationEmptyDeleteEngineMetadata

The RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = EngineServiceClient.Create();
// Initialize request argument(s)
DeleteEngineRequest request = new DeleteEngineRequest
{
    EngineName = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]"),
};
// Make the request
Operation<Empty, DeleteEngineMetadata> response = engineServiceClient.DeleteEngine(request);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteEngineMetadata> 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, DeleteEngineMetadata> retrievedResponse = engineServiceClient.PollOnceDeleteEngine(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;
}

DeleteEngine(EngineName, CallSettings)

public virtual Operation<Empty, DeleteEngineMetadata> DeleteEngine(EngineName name, CallSettings callSettings = null)

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

Parameters
Name Description
name EngineName

Required. Full resource name of [Engine][google.cloud.discoveryengine.v1.Engine], such as projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}.

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

If the [Engine][google.cloud.discoveryengine.v1.Engine] 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
OperationEmptyDeleteEngineMetadata

The RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = EngineServiceClient.Create();
// Initialize request argument(s)
EngineName name = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]");
// Make the request
Operation<Empty, DeleteEngineMetadata> response = engineServiceClient.DeleteEngine(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteEngineMetadata> 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, DeleteEngineMetadata> retrievedResponse = engineServiceClient.PollOnceDeleteEngine(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;
}

DeleteEngine(string, CallSettings)

public virtual Operation<Empty, DeleteEngineMetadata> DeleteEngine(string name, CallSettings callSettings = null)

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

Parameters
Name Description
name string

Required. Full resource name of [Engine][google.cloud.discoveryengine.v1.Engine], such as projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}.

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

If the [Engine][google.cloud.discoveryengine.v1.Engine] 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
OperationEmptyDeleteEngineMetadata

The RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = EngineServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]/engines/[ENGINE]";
// Make the request
Operation<Empty, DeleteEngineMetadata> response = engineServiceClient.DeleteEngine(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteEngineMetadata> 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, DeleteEngineMetadata> retrievedResponse = engineServiceClient.PollOnceDeleteEngine(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;
}

DeleteEngineAsync(DeleteEngineRequest, CallSettings)

public virtual Task<Operation<Empty, DeleteEngineMetadata>> DeleteEngineAsync(DeleteEngineRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request DeleteEngineRequest

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
TaskOperationEmptyDeleteEngineMetadata

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteEngineRequest request = new DeleteEngineRequest
{
    EngineName = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]"),
};
// Make the request
Operation<Empty, DeleteEngineMetadata> response = await engineServiceClient.DeleteEngineAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteEngineMetadata> 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, DeleteEngineMetadata> retrievedResponse = await engineServiceClient.PollOnceDeleteEngineAsync(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;
}

DeleteEngineAsync(DeleteEngineRequest, CancellationToken)

public virtual Task<Operation<Empty, DeleteEngineMetadata>> DeleteEngineAsync(DeleteEngineRequest request, CancellationToken cancellationToken)

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

Parameters
Name Description
request DeleteEngineRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteEngineMetadata

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteEngineRequest request = new DeleteEngineRequest
{
    EngineName = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]"),
};
// Make the request
Operation<Empty, DeleteEngineMetadata> response = await engineServiceClient.DeleteEngineAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteEngineMetadata> 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, DeleteEngineMetadata> retrievedResponse = await engineServiceClient.PollOnceDeleteEngineAsync(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;
}

DeleteEngineAsync(EngineName, CallSettings)

public virtual Task<Operation<Empty, DeleteEngineMetadata>> DeleteEngineAsync(EngineName name, CallSettings callSettings = null)

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

Parameters
Name Description
name EngineName

Required. Full resource name of [Engine][google.cloud.discoveryengine.v1.Engine], such as projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}.

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

If the [Engine][google.cloud.discoveryengine.v1.Engine] 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
TaskOperationEmptyDeleteEngineMetadata

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
EngineName name = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]");
// Make the request
Operation<Empty, DeleteEngineMetadata> response = await engineServiceClient.DeleteEngineAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteEngineMetadata> 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, DeleteEngineMetadata> retrievedResponse = await engineServiceClient.PollOnceDeleteEngineAsync(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;
}

DeleteEngineAsync(EngineName, CancellationToken)

public virtual Task<Operation<Empty, DeleteEngineMetadata>> DeleteEngineAsync(EngineName name, CancellationToken cancellationToken)

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

Parameters
Name Description
name EngineName

Required. Full resource name of [Engine][google.cloud.discoveryengine.v1.Engine], such as projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}.

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

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteEngineMetadata

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
EngineName name = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]");
// Make the request
Operation<Empty, DeleteEngineMetadata> response = await engineServiceClient.DeleteEngineAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteEngineMetadata> 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, DeleteEngineMetadata> retrievedResponse = await engineServiceClient.PollOnceDeleteEngineAsync(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;
}

DeleteEngineAsync(string, CallSettings)

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

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

Parameters
Name Description
name string

Required. Full resource name of [Engine][google.cloud.discoveryengine.v1.Engine], such as projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}.

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

If the [Engine][google.cloud.discoveryengine.v1.Engine] 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
TaskOperationEmptyDeleteEngineMetadata

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]/engines/[ENGINE]";
// Make the request
Operation<Empty, DeleteEngineMetadata> response = await engineServiceClient.DeleteEngineAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteEngineMetadata> 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, DeleteEngineMetadata> retrievedResponse = await engineServiceClient.PollOnceDeleteEngineAsync(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;
}

DeleteEngineAsync(string, CancellationToken)

public virtual Task<Operation<Empty, DeleteEngineMetadata>> DeleteEngineAsync(string name, CancellationToken cancellationToken)

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

Parameters
Name Description
name string

Required. Full resource name of [Engine][google.cloud.discoveryengine.v1.Engine], such as projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}.

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

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteEngineMetadata

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]/engines/[ENGINE]";
// Make the request
Operation<Empty, DeleteEngineMetadata> response = await engineServiceClient.DeleteEngineAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteEngineMetadata> 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, DeleteEngineMetadata> retrievedResponse = await engineServiceClient.PollOnceDeleteEngineAsync(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;
}

GetEngine(EngineName, CallSettings)

public virtual Engine GetEngine(EngineName name, CallSettings callSettings = null)

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

Parameters
Name Description
name EngineName

Required. Full resource name of [Engine][google.cloud.discoveryengine.v1.Engine], such as projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Engine

The RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = EngineServiceClient.Create();
// Initialize request argument(s)
EngineName name = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]");
// Make the request
Engine response = engineServiceClient.GetEngine(name);

GetEngine(GetEngineRequest, CallSettings)

public virtual Engine GetEngine(GetEngineRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request GetEngineRequest

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
Engine

The RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = EngineServiceClient.Create();
// Initialize request argument(s)
GetEngineRequest request = new GetEngineRequest
{
    EngineName = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]"),
};
// Make the request
Engine response = engineServiceClient.GetEngine(request);

GetEngine(string, CallSettings)

public virtual Engine GetEngine(string name, CallSettings callSettings = null)

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

Parameters
Name Description
name string

Required. Full resource name of [Engine][google.cloud.discoveryengine.v1.Engine], such as projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Engine

The RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = EngineServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]/engines/[ENGINE]";
// Make the request
Engine response = engineServiceClient.GetEngine(name);

GetEngineAsync(EngineName, CallSettings)

public virtual Task<Engine> GetEngineAsync(EngineName name, CallSettings callSettings = null)

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

Parameters
Name Description
name EngineName

Required. Full resource name of [Engine][google.cloud.discoveryengine.v1.Engine], such as projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskEngine

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
EngineName name = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]");
// Make the request
Engine response = await engineServiceClient.GetEngineAsync(name);

GetEngineAsync(EngineName, CancellationToken)

public virtual Task<Engine> GetEngineAsync(EngineName name, CancellationToken cancellationToken)

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

Parameters
Name Description
name EngineName

Required. Full resource name of [Engine][google.cloud.discoveryengine.v1.Engine], such as projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskEngine

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
EngineName name = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]");
// Make the request
Engine response = await engineServiceClient.GetEngineAsync(name);

GetEngineAsync(GetEngineRequest, CallSettings)

public virtual Task<Engine> GetEngineAsync(GetEngineRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request GetEngineRequest

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
TaskEngine

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
GetEngineRequest request = new GetEngineRequest
{
    EngineName = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]"),
};
// Make the request
Engine response = await engineServiceClient.GetEngineAsync(request);

GetEngineAsync(GetEngineRequest, CancellationToken)

public virtual Task<Engine> GetEngineAsync(GetEngineRequest request, CancellationToken cancellationToken)

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

Parameters
Name Description
request GetEngineRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskEngine

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
GetEngineRequest request = new GetEngineRequest
{
    EngineName = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]"),
};
// Make the request
Engine response = await engineServiceClient.GetEngineAsync(request);

GetEngineAsync(string, CallSettings)

public virtual Task<Engine> GetEngineAsync(string name, CallSettings callSettings = null)

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

Parameters
Name Description
name string

Required. Full resource name of [Engine][google.cloud.discoveryengine.v1.Engine], such as projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskEngine

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]/engines/[ENGINE]";
// Make the request
Engine response = await engineServiceClient.GetEngineAsync(name);

GetEngineAsync(string, CancellationToken)

public virtual Task<Engine> GetEngineAsync(string name, CancellationToken cancellationToken)

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

Parameters
Name Description
name string

Required. Full resource name of [Engine][google.cloud.discoveryengine.v1.Engine], such as projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskEngine

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]/engines/[ENGINE]";
// Make the request
Engine response = await engineServiceClient.GetEngineAsync(name);

ListEngines(CollectionName, string, int?, CallSettings)

public virtual PagedEnumerable<ListEnginesResponse, Engine> ListEngines(CollectionName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all the [Engine][google.cloud.discoveryengine.v1.Engine]s associated with the project.

Parameters
Name Description
parent CollectionName

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

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
PagedEnumerableListEnginesResponseEngine

A pageable sequence of Engine resources.

Example
// Create client
EngineServiceClient engineServiceClient = EngineServiceClient.Create();
// Initialize request argument(s)
CollectionName parent = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]");
// Make the request
PagedEnumerable<ListEnginesResponse, Engine> response = engineServiceClient.ListEngines(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Engine 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 (ListEnginesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Engine 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<Engine> 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 (Engine 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;

ListEngines(ListEnginesRequest, CallSettings)

public virtual PagedEnumerable<ListEnginesResponse, Engine> ListEngines(ListEnginesRequest request, CallSettings callSettings = null)

Lists all the [Engine][google.cloud.discoveryengine.v1.Engine]s associated with the project.

Parameters
Name Description
request ListEnginesRequest

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
PagedEnumerableListEnginesResponseEngine

A pageable sequence of Engine resources.

Example
// Create client
EngineServiceClient engineServiceClient = EngineServiceClient.Create();
// Initialize request argument(s)
ListEnginesRequest request = new ListEnginesRequest
{
    ParentAsCollectionName = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]"),
    Filter = "",
};
// Make the request
PagedEnumerable<ListEnginesResponse, Engine> response = engineServiceClient.ListEngines(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Engine 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 (ListEnginesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Engine 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<Engine> 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 (Engine 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;

ListEngines(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListEnginesResponse, Engine> ListEngines(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all the [Engine][google.cloud.discoveryengine.v1.Engine]s associated with the project.

Parameters
Name Description
parent string

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

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
PagedEnumerableListEnginesResponseEngine

A pageable sequence of Engine resources.

Example
// Create client
EngineServiceClient engineServiceClient = EngineServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]";
// Make the request
PagedEnumerable<ListEnginesResponse, Engine> response = engineServiceClient.ListEngines(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Engine 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 (ListEnginesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Engine 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<Engine> 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 (Engine 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;

ListEnginesAsync(CollectionName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListEnginesResponse, Engine> ListEnginesAsync(CollectionName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all the [Engine][google.cloud.discoveryengine.v1.Engine]s associated with the project.

Parameters
Name Description
parent CollectionName

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

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
PagedAsyncEnumerableListEnginesResponseEngine

A pageable asynchronous sequence of Engine resources.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
CollectionName parent = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]");
// Make the request
PagedAsyncEnumerable<ListEnginesResponse, Engine> response = engineServiceClient.ListEnginesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Engine 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((ListEnginesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Engine 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<Engine> 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 (Engine 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;

ListEnginesAsync(ListEnginesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListEnginesResponse, Engine> ListEnginesAsync(ListEnginesRequest request, CallSettings callSettings = null)

Lists all the [Engine][google.cloud.discoveryengine.v1.Engine]s associated with the project.

Parameters
Name Description
request ListEnginesRequest

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
PagedAsyncEnumerableListEnginesResponseEngine

A pageable asynchronous sequence of Engine resources.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
ListEnginesRequest request = new ListEnginesRequest
{
    ParentAsCollectionName = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListEnginesResponse, Engine> response = engineServiceClient.ListEnginesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Engine 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((ListEnginesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Engine 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<Engine> 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 (Engine 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;

ListEnginesAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListEnginesResponse, Engine> ListEnginesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all the [Engine][google.cloud.discoveryengine.v1.Engine]s associated with the project.

Parameters
Name Description
parent string

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

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
PagedAsyncEnumerableListEnginesResponseEngine

A pageable asynchronous sequence of Engine resources.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]";
// Make the request
PagedAsyncEnumerable<ListEnginesResponse, Engine> response = engineServiceClient.ListEnginesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Engine 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((ListEnginesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Engine 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<Engine> 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 (Engine 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;

PollOnceCreateEngine(string, CallSettings)

public virtual Operation<Engine, CreateEngineMetadata> PollOnceCreateEngine(string operationName, CallSettings callSettings = null)

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

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
OperationEngineCreateEngineMetadata

The result of polling the operation.

PollOnceCreateEngineAsync(string, CallSettings)

public virtual Task<Operation<Engine, CreateEngineMetadata>> PollOnceCreateEngineAsync(string operationName, CallSettings callSettings = null)

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

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
TaskOperationEngineCreateEngineMetadata

A task representing the result of polling the operation.

PollOnceDeleteEngine(string, CallSettings)

public virtual Operation<Empty, DeleteEngineMetadata> PollOnceDeleteEngine(string operationName, CallSettings callSettings = null)

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

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
OperationEmptyDeleteEngineMetadata

The result of polling the operation.

PollOnceDeleteEngineAsync(string, CallSettings)

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

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

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
TaskOperationEmptyDeleteEngineMetadata

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.

UpdateEngine(Engine, FieldMask, CallSettings)

public virtual Engine UpdateEngine(Engine engine, FieldMask updateMask, CallSettings callSettings = null)

Updates an [Engine][google.cloud.discoveryengine.v1.Engine]

Parameters
Name Description
engine Engine

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

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

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

updateMask FieldMask

Indicates which fields in the provided [Engine][google.cloud.discoveryengine.v1.Engine] to update.

If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Engine

The RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = EngineServiceClient.Create();
// Initialize request argument(s)
Engine engine = new Engine();
FieldMask updateMask = new FieldMask();
// Make the request
Engine response = engineServiceClient.UpdateEngine(engine, updateMask);

UpdateEngine(UpdateEngineRequest, CallSettings)

public virtual Engine UpdateEngine(UpdateEngineRequest request, CallSettings callSettings = null)

Updates an [Engine][google.cloud.discoveryengine.v1.Engine]

Parameters
Name Description
request UpdateEngineRequest

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
Engine

The RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = EngineServiceClient.Create();
// Initialize request argument(s)
UpdateEngineRequest request = new UpdateEngineRequest
{
    Engine = new Engine(),
    UpdateMask = new FieldMask(),
};
// Make the request
Engine response = engineServiceClient.UpdateEngine(request);

UpdateEngineAsync(Engine, FieldMask, CallSettings)

public virtual Task<Engine> UpdateEngineAsync(Engine engine, FieldMask updateMask, CallSettings callSettings = null)

Updates an [Engine][google.cloud.discoveryengine.v1.Engine]

Parameters
Name Description
engine Engine

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

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

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

updateMask FieldMask

Indicates which fields in the provided [Engine][google.cloud.discoveryengine.v1.Engine] to update.

If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskEngine

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
Engine engine = new Engine();
FieldMask updateMask = new FieldMask();
// Make the request
Engine response = await engineServiceClient.UpdateEngineAsync(engine, updateMask);

UpdateEngineAsync(Engine, FieldMask, CancellationToken)

public virtual Task<Engine> UpdateEngineAsync(Engine engine, FieldMask updateMask, CancellationToken cancellationToken)

Updates an [Engine][google.cloud.discoveryengine.v1.Engine]

Parameters
Name Description
engine Engine

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

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

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

updateMask FieldMask

Indicates which fields in the provided [Engine][google.cloud.discoveryengine.v1.Engine] to update.

If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskEngine

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
Engine engine = new Engine();
FieldMask updateMask = new FieldMask();
// Make the request
Engine response = await engineServiceClient.UpdateEngineAsync(engine, updateMask);

UpdateEngineAsync(UpdateEngineRequest, CallSettings)

public virtual Task<Engine> UpdateEngineAsync(UpdateEngineRequest request, CallSettings callSettings = null)

Updates an [Engine][google.cloud.discoveryengine.v1.Engine]

Parameters
Name Description
request UpdateEngineRequest

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
TaskEngine

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateEngineRequest request = new UpdateEngineRequest
{
    Engine = new Engine(),
    UpdateMask = new FieldMask(),
};
// Make the request
Engine response = await engineServiceClient.UpdateEngineAsync(request);

UpdateEngineAsync(UpdateEngineRequest, CancellationToken)

public virtual Task<Engine> UpdateEngineAsync(UpdateEngineRequest request, CancellationToken cancellationToken)

Updates an [Engine][google.cloud.discoveryengine.v1.Engine]

Parameters
Name Description
request UpdateEngineRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskEngine

A Task containing the RPC response.

Example
// Create client
EngineServiceClient engineServiceClient = await EngineServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateEngineRequest request = new UpdateEngineRequest
{
    Engine = new Engine(),
    UpdateMask = new FieldMask(),
};
// Make the request
Engine response = await engineServiceClient.UpdateEngineAsync(request);