Cloud Document AI v1beta3 API - Class DocumentServiceClient (2.0.0-beta18)

public abstract class DocumentServiceClient

Reference documentation and code samples for the Cloud Document AI v1beta3 API class DocumentServiceClient.

DocumentService client wrapper, for convenient use.

Inheritance

object > DocumentServiceClient

Namespace

Google.Cloud.DocumentAI.V1Beta3

Assembly

Google.Cloud.DocumentAI.V1Beta3.dll

Remarks

Service to call Cloud DocumentAI to manage document collection (dataset).

Properties

BatchDeleteDocumentsOperationsClient

public virtual OperationsClient BatchDeleteDocumentsOperationsClient { get; }

The long-running operations client for BatchDeleteDocuments.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default DocumentService scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

The default DocumentService scopes are:

GrpcClient

public virtual DocumentService.DocumentServiceClient GrpcClient { get; }

The underlying gRPC DocumentService client

Property Value
TypeDescription
DocumentServiceDocumentServiceClient

ImportDocumentsOperationsClient

public virtual OperationsClient ImportDocumentsOperationsClient { get; }

The long-running operations client for ImportDocuments.

Property Value
TypeDescription
OperationsClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
TypeDescription
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

UpdateDatasetOperationsClient

public virtual OperationsClient UpdateDatasetOperationsClient { get; }

The long-running operations client for UpdateDataset.

Property Value
TypeDescription
OperationsClient

Methods

BatchDeleteDocuments(BatchDeleteDocumentsRequest, CallSettings)

public virtual Operation<BatchDeleteDocumentsResponse, BatchDeleteDocumentsMetadata> BatchDeleteDocuments(BatchDeleteDocumentsRequest request, CallSettings callSettings = null)

Deletes a set of documents.

Parameters
NameDescription
requestBatchDeleteDocumentsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationBatchDeleteDocumentsResponseBatchDeleteDocumentsMetadata

The RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
BatchDeleteDocumentsRequest request = new BatchDeleteDocumentsRequest
{
    Dataset = "",
    DatasetDocuments = new BatchDatasetDocuments(),
};
// Make the request
Operation<BatchDeleteDocumentsResponse, BatchDeleteDocumentsMetadata> response = documentServiceClient.BatchDeleteDocuments(request);

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

BatchDeleteDocuments(string, CallSettings)

public virtual Operation<BatchDeleteDocumentsResponse, BatchDeleteDocumentsMetadata> BatchDeleteDocuments(string dataset, CallSettings callSettings = null)

Deletes a set of documents.

Parameters
NameDescription
datasetstring

Required. The dataset resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationBatchDeleteDocumentsResponseBatchDeleteDocumentsMetadata

The RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
string dataset = "";
// Make the request
Operation<BatchDeleteDocumentsResponse, BatchDeleteDocumentsMetadata> response = documentServiceClient.BatchDeleteDocuments(dataset);

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

BatchDeleteDocumentsAsync(BatchDeleteDocumentsRequest, CallSettings)

public virtual Task<Operation<BatchDeleteDocumentsResponse, BatchDeleteDocumentsMetadata>> BatchDeleteDocumentsAsync(BatchDeleteDocumentsRequest request, CallSettings callSettings = null)

Deletes a set of documents.

Parameters
NameDescription
requestBatchDeleteDocumentsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationBatchDeleteDocumentsResponseBatchDeleteDocumentsMetadata

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
BatchDeleteDocumentsRequest request = new BatchDeleteDocumentsRequest
{
    Dataset = "",
    DatasetDocuments = new BatchDatasetDocuments(),
};
// Make the request
Operation<BatchDeleteDocumentsResponse, BatchDeleteDocumentsMetadata> response = await documentServiceClient.BatchDeleteDocumentsAsync(request);

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

BatchDeleteDocumentsAsync(BatchDeleteDocumentsRequest, CancellationToken)

public virtual Task<Operation<BatchDeleteDocumentsResponse, BatchDeleteDocumentsMetadata>> BatchDeleteDocumentsAsync(BatchDeleteDocumentsRequest request, CancellationToken cancellationToken)

Deletes a set of documents.

Parameters
NameDescription
requestBatchDeleteDocumentsRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationBatchDeleteDocumentsResponseBatchDeleteDocumentsMetadata

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
BatchDeleteDocumentsRequest request = new BatchDeleteDocumentsRequest
{
    Dataset = "",
    DatasetDocuments = new BatchDatasetDocuments(),
};
// Make the request
Operation<BatchDeleteDocumentsResponse, BatchDeleteDocumentsMetadata> response = await documentServiceClient.BatchDeleteDocumentsAsync(request);

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

BatchDeleteDocumentsAsync(string, CallSettings)

public virtual Task<Operation<BatchDeleteDocumentsResponse, BatchDeleteDocumentsMetadata>> BatchDeleteDocumentsAsync(string dataset, CallSettings callSettings = null)

Deletes a set of documents.

Parameters
NameDescription
datasetstring

Required. The dataset resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationBatchDeleteDocumentsResponseBatchDeleteDocumentsMetadata

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
string dataset = "";
// Make the request
Operation<BatchDeleteDocumentsResponse, BatchDeleteDocumentsMetadata> response = await documentServiceClient.BatchDeleteDocumentsAsync(dataset);

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

BatchDeleteDocumentsAsync(string, CancellationToken)

public virtual Task<Operation<BatchDeleteDocumentsResponse, BatchDeleteDocumentsMetadata>> BatchDeleteDocumentsAsync(string dataset, CancellationToken cancellationToken)

Deletes a set of documents.

Parameters
NameDescription
datasetstring

Required. The dataset resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationBatchDeleteDocumentsResponseBatchDeleteDocumentsMetadata

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
string dataset = "";
// Make the request
Operation<BatchDeleteDocumentsResponse, BatchDeleteDocumentsMetadata> response = await documentServiceClient.BatchDeleteDocumentsAsync(dataset);

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

Create()

public static DocumentServiceClient Create()

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

Returns
TypeDescription
DocumentServiceClient

The created DocumentServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskDocumentServiceClient

The task representing the created DocumentServiceClient.

GetDatasetSchema(DatasetSchemaName, CallSettings)

public virtual DatasetSchema GetDatasetSchema(DatasetSchemaName name, CallSettings callSettings = null)

Gets the DatasetSchema of a Dataset.

Parameters
NameDescription
nameDatasetSchemaName

Required. The dataset schema resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DatasetSchema

The RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
DatasetSchemaName name = DatasetSchemaName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
DatasetSchema response = documentServiceClient.GetDatasetSchema(name);

GetDatasetSchema(GetDatasetSchemaRequest, CallSettings)

public virtual DatasetSchema GetDatasetSchema(GetDatasetSchemaRequest request, CallSettings callSettings = null)

Gets the DatasetSchema of a Dataset.

Parameters
NameDescription
requestGetDatasetSchemaRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DatasetSchema

The RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
GetDatasetSchemaRequest request = new GetDatasetSchemaRequest
{
    DatasetSchemaName = DatasetSchemaName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
    VisibleFieldsOnly = false,
};
// Make the request
DatasetSchema response = documentServiceClient.GetDatasetSchema(request);

GetDatasetSchema(string, CallSettings)

public virtual DatasetSchema GetDatasetSchema(string name, CallSettings callSettings = null)

Gets the DatasetSchema of a Dataset.

Parameters
NameDescription
namestring

Required. The dataset schema resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DatasetSchema

The RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]/dataset/datasetSchema";
// Make the request
DatasetSchema response = documentServiceClient.GetDatasetSchema(name);

GetDatasetSchemaAsync(DatasetSchemaName, CallSettings)

public virtual Task<DatasetSchema> GetDatasetSchemaAsync(DatasetSchemaName name, CallSettings callSettings = null)

Gets the DatasetSchema of a Dataset.

Parameters
NameDescription
nameDatasetSchemaName

Required. The dataset schema resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskDatasetSchema

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
DatasetSchemaName name = DatasetSchemaName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
DatasetSchema response = await documentServiceClient.GetDatasetSchemaAsync(name);

GetDatasetSchemaAsync(DatasetSchemaName, CancellationToken)

public virtual Task<DatasetSchema> GetDatasetSchemaAsync(DatasetSchemaName name, CancellationToken cancellationToken)

Gets the DatasetSchema of a Dataset.

Parameters
NameDescription
nameDatasetSchemaName

Required. The dataset schema resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskDatasetSchema

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
DatasetSchemaName name = DatasetSchemaName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
DatasetSchema response = await documentServiceClient.GetDatasetSchemaAsync(name);

GetDatasetSchemaAsync(GetDatasetSchemaRequest, CallSettings)

public virtual Task<DatasetSchema> GetDatasetSchemaAsync(GetDatasetSchemaRequest request, CallSettings callSettings = null)

Gets the DatasetSchema of a Dataset.

Parameters
NameDescription
requestGetDatasetSchemaRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskDatasetSchema

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
GetDatasetSchemaRequest request = new GetDatasetSchemaRequest
{
    DatasetSchemaName = DatasetSchemaName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
    VisibleFieldsOnly = false,
};
// Make the request
DatasetSchema response = await documentServiceClient.GetDatasetSchemaAsync(request);

GetDatasetSchemaAsync(GetDatasetSchemaRequest, CancellationToken)

public virtual Task<DatasetSchema> GetDatasetSchemaAsync(GetDatasetSchemaRequest request, CancellationToken cancellationToken)

Gets the DatasetSchema of a Dataset.

Parameters
NameDescription
requestGetDatasetSchemaRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskDatasetSchema

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
GetDatasetSchemaRequest request = new GetDatasetSchemaRequest
{
    DatasetSchemaName = DatasetSchemaName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
    VisibleFieldsOnly = false,
};
// Make the request
DatasetSchema response = await documentServiceClient.GetDatasetSchemaAsync(request);

GetDatasetSchemaAsync(string, CallSettings)

public virtual Task<DatasetSchema> GetDatasetSchemaAsync(string name, CallSettings callSettings = null)

Gets the DatasetSchema of a Dataset.

Parameters
NameDescription
namestring

Required. The dataset schema resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskDatasetSchema

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]/dataset/datasetSchema";
// Make the request
DatasetSchema response = await documentServiceClient.GetDatasetSchemaAsync(name);

GetDatasetSchemaAsync(string, CancellationToken)

public virtual Task<DatasetSchema> GetDatasetSchemaAsync(string name, CancellationToken cancellationToken)

Gets the DatasetSchema of a Dataset.

Parameters
NameDescription
namestring

Required. The dataset schema resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskDatasetSchema

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]/dataset/datasetSchema";
// Make the request
DatasetSchema response = await documentServiceClient.GetDatasetSchemaAsync(name);

GetDocument(DatasetName, CallSettings)

public virtual GetDocumentResponse GetDocument(DatasetName dataset, CallSettings callSettings = null)

Returns relevant fields present in the requested document.

Parameters
NameDescription
datasetDatasetName

Required. The resource name of the dataset that the document belongs to . Format: projects/{project}/locations/{location}/processors/{processor}/dataset

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
GetDocumentResponse

The RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
DatasetName dataset = DatasetName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
GetDocumentResponse response = documentServiceClient.GetDocument(dataset);

GetDocument(GetDocumentRequest, CallSettings)

public virtual GetDocumentResponse GetDocument(GetDocumentRequest request, CallSettings callSettings = null)

Returns relevant fields present in the requested document.

Parameters
NameDescription
requestGetDocumentRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
GetDocumentResponse

The RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
GetDocumentRequest request = new GetDocumentRequest
{
    DatasetAsDatasetName = DatasetName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
    DocumentId = new DocumentId(),
    ReadMask = new FieldMask(),
    PageRange = new DocumentPageRange(),
};
// Make the request
GetDocumentResponse response = documentServiceClient.GetDocument(request);

GetDocument(string, CallSettings)

public virtual GetDocumentResponse GetDocument(string dataset, CallSettings callSettings = null)

Returns relevant fields present in the requested document.

Parameters
NameDescription
datasetstring

Required. The resource name of the dataset that the document belongs to . Format: projects/{project}/locations/{location}/processors/{processor}/dataset

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
GetDocumentResponse

The RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
string dataset = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]/dataset";
// Make the request
GetDocumentResponse response = documentServiceClient.GetDocument(dataset);

GetDocumentAsync(DatasetName, CallSettings)

public virtual Task<GetDocumentResponse> GetDocumentAsync(DatasetName dataset, CallSettings callSettings = null)

Returns relevant fields present in the requested document.

Parameters
NameDescription
datasetDatasetName

Required. The resource name of the dataset that the document belongs to . Format: projects/{project}/locations/{location}/processors/{processor}/dataset

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskGetDocumentResponse

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
DatasetName dataset = DatasetName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
GetDocumentResponse response = await documentServiceClient.GetDocumentAsync(dataset);

GetDocumentAsync(DatasetName, CancellationToken)

public virtual Task<GetDocumentResponse> GetDocumentAsync(DatasetName dataset, CancellationToken cancellationToken)

Returns relevant fields present in the requested document.

Parameters
NameDescription
datasetDatasetName

Required. The resource name of the dataset that the document belongs to . Format: projects/{project}/locations/{location}/processors/{processor}/dataset

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskGetDocumentResponse

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
DatasetName dataset = DatasetName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
GetDocumentResponse response = await documentServiceClient.GetDocumentAsync(dataset);

GetDocumentAsync(GetDocumentRequest, CallSettings)

public virtual Task<GetDocumentResponse> GetDocumentAsync(GetDocumentRequest request, CallSettings callSettings = null)

Returns relevant fields present in the requested document.

Parameters
NameDescription
requestGetDocumentRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskGetDocumentResponse

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
GetDocumentRequest request = new GetDocumentRequest
{
    DatasetAsDatasetName = DatasetName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
    DocumentId = new DocumentId(),
    ReadMask = new FieldMask(),
    PageRange = new DocumentPageRange(),
};
// Make the request
GetDocumentResponse response = await documentServiceClient.GetDocumentAsync(request);

GetDocumentAsync(GetDocumentRequest, CancellationToken)

public virtual Task<GetDocumentResponse> GetDocumentAsync(GetDocumentRequest request, CancellationToken cancellationToken)

Returns relevant fields present in the requested document.

Parameters
NameDescription
requestGetDocumentRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskGetDocumentResponse

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
GetDocumentRequest request = new GetDocumentRequest
{
    DatasetAsDatasetName = DatasetName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
    DocumentId = new DocumentId(),
    ReadMask = new FieldMask(),
    PageRange = new DocumentPageRange(),
};
// Make the request
GetDocumentResponse response = await documentServiceClient.GetDocumentAsync(request);

GetDocumentAsync(string, CallSettings)

public virtual Task<GetDocumentResponse> GetDocumentAsync(string dataset, CallSettings callSettings = null)

Returns relevant fields present in the requested document.

Parameters
NameDescription
datasetstring

Required. The resource name of the dataset that the document belongs to . Format: projects/{project}/locations/{location}/processors/{processor}/dataset

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskGetDocumentResponse

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
string dataset = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]/dataset";
// Make the request
GetDocumentResponse response = await documentServiceClient.GetDocumentAsync(dataset);

GetDocumentAsync(string, CancellationToken)

public virtual Task<GetDocumentResponse> GetDocumentAsync(string dataset, CancellationToken cancellationToken)

Returns relevant fields present in the requested document.

Parameters
NameDescription
datasetstring

Required. The resource name of the dataset that the document belongs to . Format: projects/{project}/locations/{location}/processors/{processor}/dataset

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskGetDocumentResponse

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
string dataset = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]/dataset";
// Make the request
GetDocumentResponse response = await documentServiceClient.GetDocumentAsync(dataset);

ImportDocuments(DatasetName, CallSettings)

public virtual Operation<ImportDocumentsResponse, ImportDocumentsMetadata> ImportDocuments(DatasetName dataset, CallSettings callSettings = null)

Import documents into a dataset.

Parameters
NameDescription
datasetDatasetName

Required. The dataset resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationImportDocumentsResponseImportDocumentsMetadata

The RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
DatasetName dataset = DatasetName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
Operation<ImportDocumentsResponse, ImportDocumentsMetadata> response = documentServiceClient.ImportDocuments(dataset);

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

ImportDocuments(ImportDocumentsRequest, CallSettings)

public virtual Operation<ImportDocumentsResponse, ImportDocumentsMetadata> ImportDocuments(ImportDocumentsRequest request, CallSettings callSettings = null)

Import documents into a dataset.

Parameters
NameDescription
requestImportDocumentsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationImportDocumentsResponseImportDocumentsMetadata

The RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
ImportDocumentsRequest request = new ImportDocumentsRequest
{
    DatasetAsDatasetName = DatasetName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
    BatchDocumentsImportConfigs =
    {
        new ImportDocumentsRequest.Types.BatchDocumentsImportConfig(),
    },
};
// Make the request
Operation<ImportDocumentsResponse, ImportDocumentsMetadata> response = documentServiceClient.ImportDocuments(request);

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

ImportDocuments(string, CallSettings)

public virtual Operation<ImportDocumentsResponse, ImportDocumentsMetadata> ImportDocuments(string dataset, CallSettings callSettings = null)

Import documents into a dataset.

Parameters
NameDescription
datasetstring

Required. The dataset resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationImportDocumentsResponseImportDocumentsMetadata

The RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
string dataset = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]/dataset";
// Make the request
Operation<ImportDocumentsResponse, ImportDocumentsMetadata> response = documentServiceClient.ImportDocuments(dataset);

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

ImportDocumentsAsync(DatasetName, CallSettings)

public virtual Task<Operation<ImportDocumentsResponse, ImportDocumentsMetadata>> ImportDocumentsAsync(DatasetName dataset, CallSettings callSettings = null)

Import documents into a dataset.

Parameters
NameDescription
datasetDatasetName

Required. The dataset resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationImportDocumentsResponseImportDocumentsMetadata

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
DatasetName dataset = DatasetName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
Operation<ImportDocumentsResponse, ImportDocumentsMetadata> response = await documentServiceClient.ImportDocumentsAsync(dataset);

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

ImportDocumentsAsync(DatasetName, CancellationToken)

public virtual Task<Operation<ImportDocumentsResponse, ImportDocumentsMetadata>> ImportDocumentsAsync(DatasetName dataset, CancellationToken cancellationToken)

Import documents into a dataset.

Parameters
NameDescription
datasetDatasetName

Required. The dataset resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationImportDocumentsResponseImportDocumentsMetadata

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
DatasetName dataset = DatasetName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
Operation<ImportDocumentsResponse, ImportDocumentsMetadata> response = await documentServiceClient.ImportDocumentsAsync(dataset);

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

ImportDocumentsAsync(ImportDocumentsRequest, CallSettings)

public virtual Task<Operation<ImportDocumentsResponse, ImportDocumentsMetadata>> ImportDocumentsAsync(ImportDocumentsRequest request, CallSettings callSettings = null)

Import documents into a dataset.

Parameters
NameDescription
requestImportDocumentsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationImportDocumentsResponseImportDocumentsMetadata

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
ImportDocumentsRequest request = new ImportDocumentsRequest
{
    DatasetAsDatasetName = DatasetName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
    BatchDocumentsImportConfigs =
    {
        new ImportDocumentsRequest.Types.BatchDocumentsImportConfig(),
    },
};
// Make the request
Operation<ImportDocumentsResponse, ImportDocumentsMetadata> response = await documentServiceClient.ImportDocumentsAsync(request);

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

ImportDocumentsAsync(ImportDocumentsRequest, CancellationToken)

public virtual Task<Operation<ImportDocumentsResponse, ImportDocumentsMetadata>> ImportDocumentsAsync(ImportDocumentsRequest request, CancellationToken cancellationToken)

Import documents into a dataset.

Parameters
NameDescription
requestImportDocumentsRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationImportDocumentsResponseImportDocumentsMetadata

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
ImportDocumentsRequest request = new ImportDocumentsRequest
{
    DatasetAsDatasetName = DatasetName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
    BatchDocumentsImportConfigs =
    {
        new ImportDocumentsRequest.Types.BatchDocumentsImportConfig(),
    },
};
// Make the request
Operation<ImportDocumentsResponse, ImportDocumentsMetadata> response = await documentServiceClient.ImportDocumentsAsync(request);

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

ImportDocumentsAsync(string, CallSettings)

public virtual Task<Operation<ImportDocumentsResponse, ImportDocumentsMetadata>> ImportDocumentsAsync(string dataset, CallSettings callSettings = null)

Import documents into a dataset.

Parameters
NameDescription
datasetstring

Required. The dataset resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationImportDocumentsResponseImportDocumentsMetadata

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
string dataset = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]/dataset";
// Make the request
Operation<ImportDocumentsResponse, ImportDocumentsMetadata> response = await documentServiceClient.ImportDocumentsAsync(dataset);

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

ImportDocumentsAsync(string, CancellationToken)

public virtual Task<Operation<ImportDocumentsResponse, ImportDocumentsMetadata>> ImportDocumentsAsync(string dataset, CancellationToken cancellationToken)

Import documents into a dataset.

Parameters
NameDescription
datasetstring

Required. The dataset resource name. Format: projects/{project}/locations/{location}/processors/{processor}/dataset

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationImportDocumentsResponseImportDocumentsMetadata

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
string dataset = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]/dataset";
// Make the request
Operation<ImportDocumentsResponse, ImportDocumentsMetadata> response = await documentServiceClient.ImportDocumentsAsync(dataset);

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

ListDocuments(DatasetName, string, int?, CallSettings)

public virtual PagedEnumerable<ListDocumentsResponse, DocumentMetadata> ListDocuments(DatasetName dataset, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns a list of documents present in the dataset.

Parameters
NameDescription
datasetDatasetName

Required. The resource name of the dataset to be listed. Format: projects/{project}/locations/{location}/processors/{processor}/dataset

pageTokenstring

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

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListDocumentsResponseDocumentMetadata

A pageable sequence of DocumentMetadata resources.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
DatasetName dataset = DatasetName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
PagedEnumerable<ListDocumentsResponse, DocumentMetadata> response = documentServiceClient.ListDocuments(dataset);

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

ListDocuments(ListDocumentsRequest, CallSettings)

public virtual PagedEnumerable<ListDocumentsResponse, DocumentMetadata> ListDocuments(ListDocumentsRequest request, CallSettings callSettings = null)

Returns a list of documents present in the dataset.

Parameters
NameDescription
requestListDocumentsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListDocumentsResponseDocumentMetadata

A pageable sequence of DocumentMetadata resources.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
ListDocumentsRequest request = new ListDocumentsRequest
{
    DatasetAsDatasetName = DatasetName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
    Filter = "",
    ReturnTotalSize = false,
    Skip = 0,
};
// Make the request
PagedEnumerable<ListDocumentsResponse, DocumentMetadata> response = documentServiceClient.ListDocuments(request);

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

ListDocuments(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListDocumentsResponse, DocumentMetadata> ListDocuments(string dataset, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns a list of documents present in the dataset.

Parameters
NameDescription
datasetstring

Required. The resource name of the dataset to be listed. Format: projects/{project}/locations/{location}/processors/{processor}/dataset

pageTokenstring

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

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListDocumentsResponseDocumentMetadata

A pageable sequence of DocumentMetadata resources.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
string dataset = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]/dataset";
// Make the request
PagedEnumerable<ListDocumentsResponse, DocumentMetadata> response = documentServiceClient.ListDocuments(dataset);

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

ListDocumentsAsync(DatasetName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListDocumentsResponse, DocumentMetadata> ListDocumentsAsync(DatasetName dataset, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns a list of documents present in the dataset.

Parameters
NameDescription
datasetDatasetName

Required. The resource name of the dataset to be listed. Format: projects/{project}/locations/{location}/processors/{processor}/dataset

pageTokenstring

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

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListDocumentsResponseDocumentMetadata

A pageable asynchronous sequence of DocumentMetadata resources.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
DatasetName dataset = DatasetName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]");
// Make the request
PagedAsyncEnumerable<ListDocumentsResponse, DocumentMetadata> response = documentServiceClient.ListDocumentsAsync(dataset);

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

ListDocumentsAsync(ListDocumentsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListDocumentsResponse, DocumentMetadata> ListDocumentsAsync(ListDocumentsRequest request, CallSettings callSettings = null)

Returns a list of documents present in the dataset.

Parameters
NameDescription
requestListDocumentsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListDocumentsResponseDocumentMetadata

A pageable asynchronous sequence of DocumentMetadata resources.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
ListDocumentsRequest request = new ListDocumentsRequest
{
    DatasetAsDatasetName = DatasetName.FromProjectLocationProcessor("[PROJECT]", "[LOCATION]", "[PROCESSOR]"),
    Filter = "",
    ReturnTotalSize = false,
    Skip = 0,
};
// Make the request
PagedAsyncEnumerable<ListDocumentsResponse, DocumentMetadata> response = documentServiceClient.ListDocumentsAsync(request);

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

ListDocumentsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListDocumentsResponse, DocumentMetadata> ListDocumentsAsync(string dataset, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns a list of documents present in the dataset.

Parameters
NameDescription
datasetstring

Required. The resource name of the dataset to be listed. Format: projects/{project}/locations/{location}/processors/{processor}/dataset

pageTokenstring

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

pageSizeint

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListDocumentsResponseDocumentMetadata

A pageable asynchronous sequence of DocumentMetadata resources.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
string dataset = "projects/[PROJECT]/locations/[LOCATION]/processors/[PROCESSOR]/dataset";
// Make the request
PagedAsyncEnumerable<ListDocumentsResponse, DocumentMetadata> response = documentServiceClient.ListDocumentsAsync(dataset);

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

PollOnceBatchDeleteDocuments(string, CallSettings)

public virtual Operation<BatchDeleteDocumentsResponse, BatchDeleteDocumentsMetadata> PollOnceBatchDeleteDocuments(string operationName, CallSettings callSettings = null)

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

Parameters
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationBatchDeleteDocumentsResponseBatchDeleteDocumentsMetadata

The result of polling the operation.

PollOnceBatchDeleteDocumentsAsync(string, CallSettings)

public virtual Task<Operation<BatchDeleteDocumentsResponse, BatchDeleteDocumentsMetadata>> PollOnceBatchDeleteDocumentsAsync(string operationName, CallSettings callSettings = null)

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

Parameters
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationBatchDeleteDocumentsResponseBatchDeleteDocumentsMetadata

A task representing the result of polling the operation.

PollOnceImportDocuments(string, CallSettings)

public virtual Operation<ImportDocumentsResponse, ImportDocumentsMetadata> PollOnceImportDocuments(string operationName, CallSettings callSettings = null)

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

Parameters
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationImportDocumentsResponseImportDocumentsMetadata

The result of polling the operation.

PollOnceImportDocumentsAsync(string, CallSettings)

public virtual Task<Operation<ImportDocumentsResponse, ImportDocumentsMetadata>> PollOnceImportDocumentsAsync(string operationName, CallSettings callSettings = null)

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

Parameters
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationImportDocumentsResponseImportDocumentsMetadata

A task representing the result of polling the operation.

PollOnceUpdateDataset(string, CallSettings)

public virtual Operation<Dataset, UpdateDatasetOperationMetadata> PollOnceUpdateDataset(string operationName, CallSettings callSettings = null)

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

Parameters
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationDatasetUpdateDatasetOperationMetadata

The result of polling the operation.

PollOnceUpdateDatasetAsync(string, CallSettings)

public virtual Task<Operation<Dataset, UpdateDatasetOperationMetadata>> PollOnceUpdateDatasetAsync(string operationName, CallSettings callSettings = null)

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

Parameters
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationDatasetUpdateDatasetOperationMetadata

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
TypeDescription
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.

UpdateDataset(Dataset, FieldMask, CallSettings)

public virtual Operation<Dataset, UpdateDatasetOperationMetadata> UpdateDataset(Dataset dataset, FieldMask updateMask, CallSettings callSettings = null)

Updates metadata associated with a dataset.

Parameters
NameDescription
datasetDataset

Required. The name field of the Dataset is used to identify the resource to be updated.

updateMaskFieldMask

The update mask applies to the resource.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationDatasetUpdateDatasetOperationMetadata

The RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
Dataset dataset = new Dataset();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Dataset, UpdateDatasetOperationMetadata> response = documentServiceClient.UpdateDataset(dataset, updateMask);

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

UpdateDataset(UpdateDatasetRequest, CallSettings)

public virtual Operation<Dataset, UpdateDatasetOperationMetadata> UpdateDataset(UpdateDatasetRequest request, CallSettings callSettings = null)

Updates metadata associated with a dataset.

Parameters
NameDescription
requestUpdateDatasetRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationDatasetUpdateDatasetOperationMetadata

The RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
UpdateDatasetRequest request = new UpdateDatasetRequest
{
    Dataset = new Dataset(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Dataset, UpdateDatasetOperationMetadata> response = documentServiceClient.UpdateDataset(request);

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

UpdateDatasetAsync(Dataset, FieldMask, CallSettings)

public virtual Task<Operation<Dataset, UpdateDatasetOperationMetadata>> UpdateDatasetAsync(Dataset dataset, FieldMask updateMask, CallSettings callSettings = null)

Updates metadata associated with a dataset.

Parameters
NameDescription
datasetDataset

Required. The name field of the Dataset is used to identify the resource to be updated.

updateMaskFieldMask

The update mask applies to the resource.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationDatasetUpdateDatasetOperationMetadata

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
Dataset dataset = new Dataset();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Dataset, UpdateDatasetOperationMetadata> response = await documentServiceClient.UpdateDatasetAsync(dataset, updateMask);

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

UpdateDatasetAsync(Dataset, FieldMask, CancellationToken)

public virtual Task<Operation<Dataset, UpdateDatasetOperationMetadata>> UpdateDatasetAsync(Dataset dataset, FieldMask updateMask, CancellationToken cancellationToken)

Updates metadata associated with a dataset.

Parameters
NameDescription
datasetDataset

Required. The name field of the Dataset is used to identify the resource to be updated.

updateMaskFieldMask

The update mask applies to the resource.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationDatasetUpdateDatasetOperationMetadata

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
Dataset dataset = new Dataset();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Dataset, UpdateDatasetOperationMetadata> response = await documentServiceClient.UpdateDatasetAsync(dataset, updateMask);

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

UpdateDatasetAsync(UpdateDatasetRequest, CallSettings)

public virtual Task<Operation<Dataset, UpdateDatasetOperationMetadata>> UpdateDatasetAsync(UpdateDatasetRequest request, CallSettings callSettings = null)

Updates metadata associated with a dataset.

Parameters
NameDescription
requestUpdateDatasetRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationDatasetUpdateDatasetOperationMetadata

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateDatasetRequest request = new UpdateDatasetRequest
{
    Dataset = new Dataset(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Dataset, UpdateDatasetOperationMetadata> response = await documentServiceClient.UpdateDatasetAsync(request);

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

UpdateDatasetAsync(UpdateDatasetRequest, CancellationToken)

public virtual Task<Operation<Dataset, UpdateDatasetOperationMetadata>> UpdateDatasetAsync(UpdateDatasetRequest request, CancellationToken cancellationToken)

Updates metadata associated with a dataset.

Parameters
NameDescription
requestUpdateDatasetRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationDatasetUpdateDatasetOperationMetadata

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateDatasetRequest request = new UpdateDatasetRequest
{
    Dataset = new Dataset(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Dataset, UpdateDatasetOperationMetadata> response = await documentServiceClient.UpdateDatasetAsync(request);

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

UpdateDatasetSchema(DatasetSchema, FieldMask, CallSettings)

public virtual DatasetSchema UpdateDatasetSchema(DatasetSchema datasetSchema, FieldMask updateMask, CallSettings callSettings = null)

Updates a DatasetSchema.

Parameters
NameDescription
datasetSchemaDatasetSchema

Required. The name field of the DatasetSchema is used to identify the resource to be updated.

updateMaskFieldMask

The update mask applies to the resource.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DatasetSchema

The RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
DatasetSchema datasetSchema = new DatasetSchema();
FieldMask updateMask = new FieldMask();
// Make the request
DatasetSchema response = documentServiceClient.UpdateDatasetSchema(datasetSchema, updateMask);

UpdateDatasetSchema(UpdateDatasetSchemaRequest, CallSettings)

public virtual DatasetSchema UpdateDatasetSchema(UpdateDatasetSchemaRequest request, CallSettings callSettings = null)

Updates a DatasetSchema.

Parameters
NameDescription
requestUpdateDatasetSchemaRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DatasetSchema

The RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
// Initialize request argument(s)
UpdateDatasetSchemaRequest request = new UpdateDatasetSchemaRequest
{
    DatasetSchema = new DatasetSchema(),
    UpdateMask = new FieldMask(),
};
// Make the request
DatasetSchema response = documentServiceClient.UpdateDatasetSchema(request);

UpdateDatasetSchemaAsync(DatasetSchema, FieldMask, CallSettings)

public virtual Task<DatasetSchema> UpdateDatasetSchemaAsync(DatasetSchema datasetSchema, FieldMask updateMask, CallSettings callSettings = null)

Updates a DatasetSchema.

Parameters
NameDescription
datasetSchemaDatasetSchema

Required. The name field of the DatasetSchema is used to identify the resource to be updated.

updateMaskFieldMask

The update mask applies to the resource.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskDatasetSchema

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
DatasetSchema datasetSchema = new DatasetSchema();
FieldMask updateMask = new FieldMask();
// Make the request
DatasetSchema response = await documentServiceClient.UpdateDatasetSchemaAsync(datasetSchema, updateMask);

UpdateDatasetSchemaAsync(DatasetSchema, FieldMask, CancellationToken)

public virtual Task<DatasetSchema> UpdateDatasetSchemaAsync(DatasetSchema datasetSchema, FieldMask updateMask, CancellationToken cancellationToken)

Updates a DatasetSchema.

Parameters
NameDescription
datasetSchemaDatasetSchema

Required. The name field of the DatasetSchema is used to identify the resource to be updated.

updateMaskFieldMask

The update mask applies to the resource.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskDatasetSchema

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
DatasetSchema datasetSchema = new DatasetSchema();
FieldMask updateMask = new FieldMask();
// Make the request
DatasetSchema response = await documentServiceClient.UpdateDatasetSchemaAsync(datasetSchema, updateMask);

UpdateDatasetSchemaAsync(UpdateDatasetSchemaRequest, CallSettings)

public virtual Task<DatasetSchema> UpdateDatasetSchemaAsync(UpdateDatasetSchemaRequest request, CallSettings callSettings = null)

Updates a DatasetSchema.

Parameters
NameDescription
requestUpdateDatasetSchemaRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskDatasetSchema

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateDatasetSchemaRequest request = new UpdateDatasetSchemaRequest
{
    DatasetSchema = new DatasetSchema(),
    UpdateMask = new FieldMask(),
};
// Make the request
DatasetSchema response = await documentServiceClient.UpdateDatasetSchemaAsync(request);

UpdateDatasetSchemaAsync(UpdateDatasetSchemaRequest, CancellationToken)

public virtual Task<DatasetSchema> UpdateDatasetSchemaAsync(UpdateDatasetSchemaRequest request, CancellationToken cancellationToken)

Updates a DatasetSchema.

Parameters
NameDescription
requestUpdateDatasetSchemaRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskDatasetSchema

A Task containing the RPC response.

Example
// Create client
DocumentServiceClient documentServiceClient = await DocumentServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateDatasetSchemaRequest request = new UpdateDatasetSchemaRequest
{
    DatasetSchema = new DatasetSchema(),
    UpdateMask = new FieldMask(),
};
// Make the request
DatasetSchema response = await documentServiceClient.UpdateDatasetSchemaAsync(request);