Discovery Engine v1 API - Class ProjectServiceClient (1.3.0)

public abstract class ProjectServiceClient

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

ProjectService client wrapper, for convenient use.

Inheritance

object > ProjectServiceClient

Derived Types

Namespace

Google.Cloud.DiscoveryEngine.V1

Assembly

Google.Cloud.DiscoveryEngine.V1.dll

Remarks

Service for operations on the [Project][google.cloud.discoveryengine.v1.Project].

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
IReadOnlyListstring
Remarks

The default ProjectService scopes are:

GrpcClient

public virtual ProjectService.ProjectServiceClient GrpcClient { get; }

The underlying gRPC ProjectService client

Property Value
Type Description
ProjectServiceProjectServiceClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
Type Description
LocationsClient

ProvisionProjectOperationsClient

public virtual OperationsClient ProvisionProjectOperationsClient { get; }

The long-running operations client for ProvisionProject.

Property Value
Type Description
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static ProjectServiceClient Create()

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

Returns
Type Description
ProjectServiceClient

The created ProjectServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskProjectServiceClient

The task representing the created ProjectServiceClient.

PollOnceProvisionProject(string, CallSettings)

public virtual Operation<Project, ProvisionProjectMetadata> PollOnceProvisionProject(string operationName, CallSettings callSettings = null)

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

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
OperationProjectProvisionProjectMetadata

The result of polling the operation.

PollOnceProvisionProjectAsync(string, CallSettings)

public virtual Task<Operation<Project, ProvisionProjectMetadata>> PollOnceProvisionProjectAsync(string operationName, CallSettings callSettings = null)

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

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
TaskOperationProjectProvisionProjectMetadata

A task representing the result of polling the operation.

ProvisionProject(ProjectName, CallSettings)

public virtual Operation<Project, ProvisionProjectMetadata> ProvisionProject(ProjectName name, CallSettings callSettings = null)

Provisions the project resource. During the process, related systems will get prepared and initialized.

Caller must read the Terms for data use, and optionally specify in request to provide consent to that service terms.

Parameters
Name Description
name ProjectName

Required. Full resource name of a [Project][google.cloud.discoveryengine.v1.Project], such as projects/{project_id_or_number}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationProjectProvisionProjectMetadata

The RPC response.

Example
// Create client
ProjectServiceClient projectServiceClient = ProjectServiceClient.Create();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
// Make the request
Operation<Project, ProvisionProjectMetadata> response = projectServiceClient.ProvisionProject(name);

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

ProvisionProject(ProvisionProjectRequest, CallSettings)

public virtual Operation<Project, ProvisionProjectMetadata> ProvisionProject(ProvisionProjectRequest request, CallSettings callSettings = null)

Provisions the project resource. During the process, related systems will get prepared and initialized.

Caller must read the Terms for data use, and optionally specify in request to provide consent to that service terms.

Parameters
Name Description
request ProvisionProjectRequest

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
OperationProjectProvisionProjectMetadata

The RPC response.

Example
// Create client
ProjectServiceClient projectServiceClient = ProjectServiceClient.Create();
// Initialize request argument(s)
ProvisionProjectRequest request = new ProvisionProjectRequest
{
    ProjectName = ProjectName.FromProject("[PROJECT]"),
    AcceptDataUseTerms = false,
    DataUseTermsVersion = "",
};
// Make the request
Operation<Project, ProvisionProjectMetadata> response = projectServiceClient.ProvisionProject(request);

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

ProvisionProject(string, CallSettings)

public virtual Operation<Project, ProvisionProjectMetadata> ProvisionProject(string name, CallSettings callSettings = null)

Provisions the project resource. During the process, related systems will get prepared and initialized.

Caller must read the Terms for data use, and optionally specify in request to provide consent to that service terms.

Parameters
Name Description
name string

Required. Full resource name of a [Project][google.cloud.discoveryengine.v1.Project], such as projects/{project_id_or_number}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationProjectProvisionProjectMetadata

The RPC response.

Example
// Create client
ProjectServiceClient projectServiceClient = ProjectServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
// Make the request
Operation<Project, ProvisionProjectMetadata> response = projectServiceClient.ProvisionProject(name);

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

ProvisionProjectAsync(ProjectName, CallSettings)

public virtual Task<Operation<Project, ProvisionProjectMetadata>> ProvisionProjectAsync(ProjectName name, CallSettings callSettings = null)

Provisions the project resource. During the process, related systems will get prepared and initialized.

Caller must read the Terms for data use, and optionally specify in request to provide consent to that service terms.

Parameters
Name Description
name ProjectName

Required. Full resource name of a [Project][google.cloud.discoveryengine.v1.Project], such as projects/{project_id_or_number}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationProjectProvisionProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectServiceClient projectServiceClient = await ProjectServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
// Make the request
Operation<Project, ProvisionProjectMetadata> response = await projectServiceClient.ProvisionProjectAsync(name);

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

ProvisionProjectAsync(ProjectName, CancellationToken)

public virtual Task<Operation<Project, ProvisionProjectMetadata>> ProvisionProjectAsync(ProjectName name, CancellationToken cancellationToken)

Provisions the project resource. During the process, related systems will get prepared and initialized.

Caller must read the Terms for data use, and optionally specify in request to provide consent to that service terms.

Parameters
Name Description
name ProjectName

Required. Full resource name of a [Project][google.cloud.discoveryengine.v1.Project], such as projects/{project_id_or_number}.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationProjectProvisionProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectServiceClient projectServiceClient = await ProjectServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
// Make the request
Operation<Project, ProvisionProjectMetadata> response = await projectServiceClient.ProvisionProjectAsync(name);

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

ProvisionProjectAsync(ProvisionProjectRequest, CallSettings)

public virtual Task<Operation<Project, ProvisionProjectMetadata>> ProvisionProjectAsync(ProvisionProjectRequest request, CallSettings callSettings = null)

Provisions the project resource. During the process, related systems will get prepared and initialized.

Caller must read the Terms for data use, and optionally specify in request to provide consent to that service terms.

Parameters
Name Description
request ProvisionProjectRequest

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
TaskOperationProjectProvisionProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectServiceClient projectServiceClient = await ProjectServiceClient.CreateAsync();
// Initialize request argument(s)
ProvisionProjectRequest request = new ProvisionProjectRequest
{
    ProjectName = ProjectName.FromProject("[PROJECT]"),
    AcceptDataUseTerms = false,
    DataUseTermsVersion = "",
};
// Make the request
Operation<Project, ProvisionProjectMetadata> response = await projectServiceClient.ProvisionProjectAsync(request);

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

ProvisionProjectAsync(ProvisionProjectRequest, CancellationToken)

public virtual Task<Operation<Project, ProvisionProjectMetadata>> ProvisionProjectAsync(ProvisionProjectRequest request, CancellationToken cancellationToken)

Provisions the project resource. During the process, related systems will get prepared and initialized.

Caller must read the Terms for data use, and optionally specify in request to provide consent to that service terms.

Parameters
Name Description
request ProvisionProjectRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationProjectProvisionProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectServiceClient projectServiceClient = await ProjectServiceClient.CreateAsync();
// Initialize request argument(s)
ProvisionProjectRequest request = new ProvisionProjectRequest
{
    ProjectName = ProjectName.FromProject("[PROJECT]"),
    AcceptDataUseTerms = false,
    DataUseTermsVersion = "",
};
// Make the request
Operation<Project, ProvisionProjectMetadata> response = await projectServiceClient.ProvisionProjectAsync(request);

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

ProvisionProjectAsync(string, CallSettings)

public virtual Task<Operation<Project, ProvisionProjectMetadata>> ProvisionProjectAsync(string name, CallSettings callSettings = null)

Provisions the project resource. During the process, related systems will get prepared and initialized.

Caller must read the Terms for data use, and optionally specify in request to provide consent to that service terms.

Parameters
Name Description
name string

Required. Full resource name of a [Project][google.cloud.discoveryengine.v1.Project], such as projects/{project_id_or_number}.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationProjectProvisionProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectServiceClient projectServiceClient = await ProjectServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
// Make the request
Operation<Project, ProvisionProjectMetadata> response = await projectServiceClient.ProvisionProjectAsync(name);

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

ProvisionProjectAsync(string, CancellationToken)

public virtual Task<Operation<Project, ProvisionProjectMetadata>> ProvisionProjectAsync(string name, CancellationToken cancellationToken)

Provisions the project resource. During the process, related systems will get prepared and initialized.

Caller must read the Terms for data use, and optionally specify in request to provide consent to that service terms.

Parameters
Name Description
name string

Required. Full resource name of a [Project][google.cloud.discoveryengine.v1.Project], such as projects/{project_id_or_number}.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationProjectProvisionProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectServiceClient projectServiceClient = await ProjectServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
// Make the request
Operation<Project, ProvisionProjectMetadata> response = await projectServiceClient.ProvisionProjectAsync(name);

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

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.